diff --git a/.github/workflows/alpha.yml b/.github/workflows/alpha.yml index 42edf965..7cc87fd5 100644 --- a/.github/workflows/alpha.yml +++ b/.github/workflows/alpha.yml @@ -91,19 +91,21 @@ jobs: GH_TOKEN: ${{ github.token }} GH_REPO: ${{ github.repository }} ALPHA_NOTE: ${{ inputs.note }} + ALPHA_BRANCH: ${{ github.ref_name }} # a branch name can hold $( ) and backticks run: | $ErrorActionPreference = 'Continue' $PSNativeCommandUseErrorActionPreference = $false $tag = '${{ steps.ver.outputs.tag }}' $exe = '${{ steps.asset.outputs.path }}' $note = $env:ALPHA_NOTE # data, never spliced into the script + $branch = $env:ALPHA_BRANCH $body = @" **Alpha build - not a release.** Installs over a normal Wind install and shares its settings; roll back by running the stable installer from the Latest release. | | | |---|---| - | branch | ``${{ github.ref_name }}`` | + | branch | ``$branch`` | | commit | ``${{ steps.ver.outputs.sha7 }}`` | | base version | ``${{ steps.ver.outputs.version }}`` | | sha256 | ``${{ steps.asset.outputs.sha256 }}`` | @@ -138,10 +140,12 @@ jobs: - name: Summary shell: pwsh + env: + ALPHA_BRANCH: ${{ github.ref_name }} run: | "## Wind ${{ steps.ver.outputs.alpha }} (pre-release)" >> $env:GITHUB_STEP_SUMMARY "" >> $env:GITHUB_STEP_SUMMARY - "- branch ``${{ github.ref_name }}``" >> $env:GITHUB_STEP_SUMMARY + "- branch ``$env:ALPHA_BRANCH``" >> $env:GITHUB_STEP_SUMMARY "- tag ``${{ steps.ver.outputs.tag }}``" >> $env:GITHUB_STEP_SUMMARY "- sha256 ``${{ steps.asset.outputs.sha256 }}``" >> $env:GITHUB_STEP_SUMMARY "- the stable release keeps the Latest badge; this does not" >> $env:GITHUB_STEP_SUMMARY diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cfc722a7..1597b0ee 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,6 +25,10 @@ jobs: shell: cmd working-directory: ui run: npm ci + - name: Keybind rules, JS half (node --test) + shell: cmd + working-directory: ui + run: npm run test:rules - name: Build settings host and UI (WindConfig.exe, ui/dist) shell: cmd run: build.bat config diff --git a/docs/architecture/11-build-test-release.md b/docs/architecture/11-build-test-release.md index 3c631703..e78d39ef 100644 --- a/docs/architecture/11-build-test-release.md +++ b/docs/architecture/11-build-test-release.md @@ -30,7 +30,7 @@ headlessly, so the unit tests are the only verification loop that runs everywher - The `test` target compiles `tests\*.cpp` with `/DWIND_TESTS` against only the pure sources. The authoritative list is the `:test` target in `build.bat`; today it is `transform`, `zoom_controller`, `config`, `profiles`, `cursor_mapper`, `lock_detector`, `cursor_lock`, - `mouse_ballistics`, `crosshair`, `config_ui/ini_edit`, `logging` and `tray_items`. + `mouse_ballistics`, `crosshair`, `config_ui/ini_edit`, `logging`, `tray_items` and `hitch_record`. - Header-only pure modules (`engine_pick.h`, `drag_follow.h`, `hdr_scale.h`, `keybind_rules.h`, `config_ui/wind_watchdog.h` and others) ride in through their test files. - One test file per module (`tests/test_.cpp`). A new pure `.cpp` also goes into the @@ -38,15 +38,17 @@ headlessly, so the unit tests are the only verification loop that runs everywher - Files that straddle the line put their OS half under `#ifndef WIND_TESTS`. `src/config.cpp` is the example: `ParseConfig` and `StripUiOnlyKeys` above, `LoadConfig` and the only `#include ` below. -- `tests/fixtures/keybind_cases.txt` is shared by the C++ and the JavaScript bind rules. +- `tests/fixtures/keybind_cases.txt` is shared by the C++ and the JavaScript bind rules. The JS half + is `ui/tests/keybind-rules.nodetest.mjs`, run by `npm run test:rules` in `ui/` (`node --test`, no + browser) and by CI. -**UI suite.** `ui/tests/` holds 12 Playwright specs, run with `npx playwright test` in `ui/` (the +**UI suite.** `ui/tests/` holds 11 Playwright specs, run with `npx playwright test` in `ui/` (the config starts the Vite server). A fake `window.chrome.webview` answers the host's messages and records them in `window.__msgs`. When you add a bridge message to `HandleWebMessage`, extend the mock in the same change. Details in [09](09-settings-ui.md). **CI** (`.github/workflows/build.yml`, on pull requests and pushes to `main`) builds the app and -runs the doctest suite. It does not run the UI suite; that is a local gate for UI changes. +runs the doctest suite. It also runs the JS keybind-rule test. The Playwright UI suite is a local gate for UI changes. ## Local UIAccess deploy diff --git a/installer/app.nsh b/installer/app.nsh index 2066442a..b0369104 100644 --- a/installer/app.nsh +++ b/installer/app.nsh @@ -8,7 +8,9 @@ !include "LogicLib.nsh" -!define WV2_CLIENT "SOFTWARE\WOW6432Node\Microsoft\EdgeUpdate\Clients\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}" +; The machine-wide install is under WOW6432Node; the per-user install is not (no WOW6432Node in HKCU). +!define WV2_CLIENT_HKLM "SOFTWARE\WOW6432Node\Microsoft\EdgeUpdate\Clients\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}" +!define WV2_CLIENT_HKCU "Software\Microsoft\EdgeUpdate\Clients\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}" ; Wind's own two kernel objects. Both are Local\, i.e. session-scoped, and UAC elevation ; stays inside the session, so the elevated installer and the user's Wind see the same @@ -117,12 +119,14 @@ Var LicenceDir ; where "Read the full licence" put its copy, empty until then ; ---- WebView2 ---------------------------------------------------------------- ; WindConfig.exe paints an empty shell without the Evergreen runtime. Microsoft's ; uninstaller leaves `pv` behind set to "0.0.0.0" rather than deleting it, so a value -; being present is not proof (src\webview2_probe.h pins that rule and tests it). +; being present is not proof. src\webview2_probe.h is the tested statement of that rule; NSIS +; cannot call it, so this macro mirrors it for the two values the uninstaller leaves. !macro WIND_ENSURE_WEBVIEW2 StrCpy $0 "" - ReadRegStr $0 HKLM "${WV2_CLIENT}" "pv" + ReadRegStr $0 HKLM "${WV2_CLIENT_HKLM}" "pv" ${If} $0 == "" - ReadRegStr $0 HKCU "${WV2_CLIENT}" "pv" + ${OrIf} $0 == "0.0.0.0" + ReadRegStr $0 HKCU "${WV2_CLIENT_HKCU}" "pv" ${EndIf} ${If} $0 == "" ${OrIf} $0 == "0.0.0.0" diff --git a/src/version.h b/src/version.h index d362638b..dcbea1ba 100644 --- a/src/version.h +++ b/src/version.h @@ -4,7 +4,7 @@ #define WIND_VER_MAJOR 0 #define WIND_VER_MINOR 24 -#define WIND_VER_PATCH 8 +#define WIND_VER_PATCH 9 // String form for logs/snapshot/UI. Keep in sync with the numeric parts above. -#define WIND_VERSION_STR "0.24.8" +#define WIND_VERSION_STR "0.24.9" diff --git a/src/webview2_probe.h b/src/webview2_probe.h index d8269d23..7e9b5417 100644 --- a/src/webview2_probe.h +++ b/src/webview2_probe.h @@ -3,7 +3,9 @@ // only subtlety is that Microsoft's uninstaller leaves the value behind set to "0.0.0.0" // rather than deleting it, so a non-empty value is not proof of presence. // WindConfig.exe paints an empty shell without the runtime, which is why this is checked. -// NO : pure, so the rule is testable. +// NO : pure, so the rule is testable. Nothing in the C++ binaries calls it: the check +// that matters runs in the NSIS installer (installer\app.nsh, WIND_ENSURE_WEBVIEW2), which mirrors +// this rule and cannot include it. Keep the two in step. #include #include "installer_state.h" diff --git a/tests/fixtures/keybind_cases.txt b/tests/fixtures/keybind_cases.txt index 60a3a780..7baf8834 100644 --- a/tests/fixtures/keybind_cases.txt +++ b/tests/fixtures/keybind_cases.txt @@ -2,7 +2,7 @@ # key mods: bit 1 Ctrl, 2 Alt, 4 Shift, 8 Win # wheel # click