Registry Mirror
Skip to content

Latest commit

 

History

History
161 lines (111 loc) · 10.9 KB

development.md

File metadata and controls

161 lines (111 loc) · 10.9 KB

Development and verification

← Back to README

Prerequisites

  • Windows x64, .NET 10 SDK, and Node.js 22.6+ with npm.
  • Microsoft Edge WebView2 Runtime for the desktop UI.
  • Connected displays for native layout tests and any applications used by the test profiles.

Build from a clean checkout

.\scripts\build.ps1

The script restores the .NET solution, installs frontend dependencies with npm ci when the lockfile exists, builds the React UI, copies it to the desktop host's wwwroot, and builds the solution. Use -SkipNpmInstall for subsequent builds with dependencies already installed.

.\src\Profiled.Desktop\bin\Debug\net10.0-windows\Profiled.exe

wwwroot, dist, bin, obj, and TypeScript build metadata are generated and ignored. Source assets belong in Profiled.Ui/src/assets (category icons, branding, illustrations, grain), Profiled.Ui/public or the desktop Assets directory (profiled.ico, profiled-64.png, grain.png). Keep package-lock.json committed.

Tests

dotnet test tests\Profiled.Core.Tests\Profiled.Core.Tests.csproj
npm --prefix src/Profiled.Ui test

The Windows GitHub Actions workflow runs frontend tests, a full build from source, and .NET tests. Existing focused test:* npm scripts are also available. TypeScript also checks unused locals and parameters during the normal build. Test folders mirror Profiles, Displays, Settings, Runtime, Shortcuts, and Host responsibilities while retaining a single .NET test command.

For layout work, npm --prefix src/Profiled.Ui run dev starts Vite. A plain browser has no native WebView bridge, so the complete app needs the desktop host or explicit test fixtures. Browser fixtures are not evidence of native display transitions.

Package

.\scripts\package.ps1
.\scripts\package.ps1 -SkipNpmInstall -NoLaunch

Packaging builds and stages the UI, then publishes a Release win-x64 self-contained single-file EXE. It replaces artifacts\installer\Profiled.exe after publishing succeeds. It closes running instances before replacing the EXE and launches the new copy unless -NoLaunch is set. A locked destination falls back to a timestamped EXE.

The EXE contains .NET and app assets; WebView2 and any applications assigned to profiles are separate requirements. Keep local build outputs out of Git. Distribute binaries as release assets when preparing a release, not as source commits.

Manual acceptance

Before sharing a runtime change, check:

  1. Create, edit and save a profile; reopen the app and confirm its exact behaviour flags and shortcuts.
  2. Run Default setup → profile → Default setup for each intended monitor/TV setup. Confirm desktop restoration and launcher behaviour.
  3. Restart Windows with the configured startup target; test tray reopening, DPI/scaling, and saved window placement.
  4. Reconnect a display and confirm stable inventory, identity matching, and available refresh modes.
  5. Resize the main window through intermediate widths/heights up to maximized; check the footer, last controls, detected displays, scaled canvas dragging, and that the content zooms up on large windows.
  6. Check that status messages appear in the title bar notice and that the tray menu, title bar and About open from the brand at 100%, 125% and 150% scaling.
  7. Confirm rejected duplicate shortcuts remain local and do not change the persisted binding.
  8. Close the main window to the tray. Use a controller shortcut to activate a profile, then restore Default setup with a separate combination.
  9. Check that display reconciliation keeps saved app assignments. With Close profile applications enabled, verify that a session-started app receives a close request and a copy opened before the profile stays open.

For optional LAN control, follow Remote Control and Home Assistant. HTTP acceptance alone does not prove a completed profile transition.

Local data and troubleshooting

Path Contents
%LOCALAPPDATA%\Profiled\settings.json Configuration, profile data, optional API token
%LOCALAPPDATA%\Profiled\state.json Runtime state and return layouts
%LOCALAPPDATA%\Profiled\Logs Rotated application logs
%LOCALAPPDATA%\Profiled\WebView2 WebView user data

New installations store data under the Profiled directory. If no Profiled settings or runtime state exist and a previous installation has settings or state (including backups), all services continue using the previous data directory. The app keeps the old Windows startup value and single-instance identifiers to preserve Windows startup approval and instance coordination during upgrades. The bundled WebView is served from the Profiled virtual host.

Do not commit local settings, tokens, logs, or user-specific diagnostics. Tests should use temporary isolated files.

The remaining --console / --gaming and --profile / --pcgaming command-line aliases support older callers. --work requests Default setup; --safe-mode on a fresh process forces the Work startup target and opens the main window. Console Shell / Explorer replacement is no longer supported.

Working on the interface

Start with Architecture. Keep profile layout, application, behaviour and shortcuts in the canonical Profile record. Derive view maps instead of creating another synchronized state collection. Persist through the settings adapter to preserve older JSON configurations.

CSS modules are imported by src/Profiled.Ui/src/styles.css; the import order preserves the cascade. Check dashboard, profile displays, behaviour, application, shortcuts, default-setup settings and general settings in EN/PL at both short and narrow sizes. Include long profile names, names with spaces and mixed case, overflowed and searched profile lists, and no-application profiles. Follow the Retro Digital materials and typography described in Architecture. Read-only browser fixtures verify rendering; real monitor switching and launcher focus require Windows testing.

After profile-editing changes, verify create, edit, rename and delete. Renaming must retain the existing ID, application and shortcuts and keep the profile count unchanged. A pending display-layout commit must not overwrite changes made in later wizard steps.

For first-run changes, test language → saved display layout → Summary, including the back path. Complete setup once without opening optional editors and once after saving shortcuts or general settings. Verify change cancellation, revisiting both optional editors, and reopening Profiled after completion. Check keyboard focus and the interface at the Windows minimum window size and 125% scaling.

Publishing a release

Configure the update signing key before publishing a stable release. The release workflow signs the update manifest for the same portable EXE.

End users download the EXE or ZIP from GitHub Releases. Build scripts stay in scripts/ for development and CI; generated binaries stay under ignored artifacts/.

For a release, add notes at docs/releases/vX.Y.Z.md, commit the verified source and documentation, then push a version tag:

git tag -a v0.3.0 -m "Profiled 0.3.0"
git push origin main
git push origin v0.3.0

Use a new version for each published release. The Windows release workflow scans Git history for secrets, audits dependencies, runs frontend/backend tests, builds the tagged source, and uploads Profiled.exe and Profiled-win-x64.zip. It publishes the release after all uploads succeed. Tags with a prerelease suffix are marked as prereleases; ordinary versions appear as the latest release. The workflow can also be rerun manually against an existing tag.

To reproduce assets locally:

.\scripts\package.ps1 -SkipNpmInstall -NoLaunch -Version 0.3.0
.\scripts\create-release-assets.ps1 -Version 0.3.0
# artifacts\releases\0.3.0\

The packaging version override is optional. Normal developer builds use the version in the desktop project. Release-asset creation checks that the EXE product version matches the requested version. The ZIP includes the EXE and license texts.

Security and license checks

CI scans full Git history with a pinned, checksum-verified Gitleaks release and rejects high/critical npm and NuGet advisories. Dependabot checks npm, NuGet and GitHub Actions weekly. Directory.Build.props enables transitive NuGet auditing; global.json selects the latest installed stable .NET 10 feature band.

Before updating dependencies, refresh license notices. UI builds generate the offline notices page. Tests verify that every resolved production npm package has matching notices and that the complete texts reach the generated output. A release ZIP contains the EXE, LICENSE.txt and THIRD_PARTY_NOTICES.txt; the EXE also contains the offline license page.

Run the history scanner on Windows with ./scripts/check-secrets.ps1. Do not add settings, diagnostics, private walkthroughs, or generated packages to Git. Keep local Git author and committer identities on your GitHub noreply email. After a history rewrite, old clones must be replaced or explicitly rebased; merging old branches can reintroduce removed files and private metadata.

Repository protection

Enable required CI checks for main and disable force pushes/deletion once the repository is public or its plan supports private-branch protection. GitHub Free blocks branch protection for private repositories. Native GitHub secret scanning and private vulnerability reporting also depend on repository eligibility; the pinned Gitleaks check in CI remains available while the repository is private.

Dependency update review

Dependabot checks on Mondays in Europe/Warsaw (npm 09:00, NuGet 09:15, Actions 09:30), with at most three normal npm PRs, three NuGet PRs and one Actions PR. Minor/patch updates are grouped by React stack, frontend libraries/tooling, .NET maintenance and Actions maintenance. SDL3-CS and its Windows native runtime always share a group, including major updates, so they can be tested together. Other major updates remain individual PRs. Security updates have separate groups and are not blocked by the normal PR limit.

Review release notes, test behaviour and refresh affected license notices before merging. Passing CI is required evidence, not permission to enable blind auto-merge. Merged branches are deleted automatically. Close redundant PRs only after their updates are represented in a replacement group.

For a solo-maintained protected main, require a pull request and passing windows CI, require the branch to be up to date and conversations to be resolved, and block force pushes/deletion. Set required approving reviews to zero: the owner cannot approve their own PR. This retains PR/CI review without waiting for an unavailable second maintainer. Enable these rules when the GitHub plan or public visibility permits them.