Skip to content

Stage J5a: move the Shortcuts page into its own page, with an overlay interface - #111

Merged
uyujkk merged 5 commits into
mainfrom
claude/ui-j5-shortcuts
Nov 9, 2026
Merged

uyujkk merged 5 commits into
mainfrom
claude/ui-j5-shortcuts

Conversation

@uyujkk

@uyujkk uyujkk commented Nov 9, 2026

Copy link
Copy Markdown
Owner

Summary

Stage J5a: the Shortcuts page moves out of MainWindow, and the page and overlay talk through an interface (docs/development/UI-Structure-Plan.md, J5). J5 is split in two because the page and overlay touch about 3,100 lines in 10 files; J5b (the overlay content and its settings) follows in its own PR, stacked on this one.

  • dccc3a5: lists what the Shortcuts page and overlay depend on, in UI-Structure-Plan.md.
  • 29b851e: pure move.
    • The page goes to Pages/ShortcutsPage; its shared state goes into ShortcutPageViewModel.
    • IShortcutOverlay (AppServices.Overlay: IsVisible, IsClickThrough, Open, Hide, Toggle, Refresh(bindingsChanged)) is the only way the page, the hotkey and the window reach the overlay.
  • 50633db: appearance. InfoBar, SettingsCards and key caps; a unit-tested Core helper splits a binding's key text into caps, including a literal "+" key.
  • 63ac80f: usage flow (before → now):
    1. Rights note: a caption line and a button → an InfoBar. It warns when the selected game runs with more rights than the manager, with "Restart as administrator" as its button.
    2. Mod, window and input: three drop-downs and a switch in one row → three setting cards; the window card has its own refresh button.
    3. Status: two lines of text → a status bar ("Sending to: window · Input: on/off · input method · Overlay: open/closed") with the last result as its message. With no window it's a warning with "Refresh windows".
    4. Bindings: two-column cards → one row per binding: what it does, where it comes from, key caps, and Send. Unsendable bindings are greyed out with the reason. "Show INI file" moved into the "…" menu.
    5. Global hotkey: drop-downs plus "Apply" and "Disable" → an on/off switch, and a chosen key combination applies at once. Nothing is left to forget to apply.
    6. Empty states: a blank list → "No Mods in this repository" with "Open the dashboard", and "This Mod has no key bindings" with "Show INI file".
    7. Layout: a settings column beside the bindings → one column at every width (send target → status → bindings → settings). The side column was too narrow for setting cards in Russian.
  • e6500a9: merges main after Stage J4-b: first-run game cards, getting-started tips and a hideable search box #110 (J4-b); no conflicts.

The three hint fixes listed in the roadmap (the F10 wording, "keys can't be changed here" with the INI button, "slots only save parameter values") had already shipped in 4.6.2; the roadmap now says so.

Unchanged behaviour: F10 timing, how keys are sent, the global hotkey, click-through, the automatic-contrast calculation, and what slot switching and saving produce. The overlay content and its six settings blocks stay on the window side until J5b. ShortcutBindings.cs belongs to the Mod workspace and waits for J7.

MainWindow* (code + XAML): 23,439 → 23,011 lines.

On a machine with a red system accent, the informational InfoBar icon is red too; it follows the accent like everything since J1T.

Test plan

  • scripts\test-all.ps1: Release build 0 warnings
  • UI tests 30/30 on this branch, including a new Shortcuts test; existing overlay tests pass
  • Code-style check
  • Shortcuts screenshots (zh/en/ru × 1000×800 / 1400×900 × light/dark); no Russian truncation
  • After merging main: test-all, UI tests 33/33 and the style check pass on the J5b branch, which contains this one
  • Checks in a real game, listed in J5b's PR

🤖 Generated with Claude Code

uyujkk and others added 5 commits November 9, 2026 03:18
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pure move. The page's controls leave MainWindow for ShortcutsPage, which still builds them in code as before and
shows ShortcutPageViewModel: the Mod list and choice, the target window, input arming, the status line, the
durations, the privilege text and hotkey errors now live there, and the page sends its clicks as requests.
The overlay is reached through the new IShortcutOverlay (AppServices.Overlay); MainWindow implements it until J5b.
Until then the window also builds the page's appearance, behaviour and character follow blocks through the
IShortcutPageSettings bridge. ShortcutModOption and ShortcutTarget move to Models; MainWindow.PageLayout.cs is gone.

Screenshots match the baseline. New unit tests for the view model's rules and a UI smoke test for the page.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Appearance (docs/development/UI-Fluent-Design-Plan.md, "快捷键(J5)"), like the PowerToys keyboard and settings pages:
- The page is XAML now. Whether keys can reach the game is an InfoBar (a warning when the selected window runs with
  more rights), with "Restart as administrator" as its action instead of a caption and a button.
- The Mod, the target window (with a refresh button) and "Enable input" are setting cards.
- Each binding is one row: what it does and where it comes from, its keys drawn as key caps by the new KeyVisual
  control, and a Send button; a binding that cannot be sent is greyed out with the reason. "Hide unsendable"
  is a switch on the bindings title row and "Show INI file" moved to its "..." menu.
- The overlay, character follow and sending settings are SettingsExpanders; the durations are setting cards.
- One column at every width (bindings, then settings): the settings column beside the bindings was too narrow for
  setting cards, so ShortcutsLayoutPolicy is gone.

The three roadmap hints were already done in 4.6.2; the roadmap says so. New: ShortcutKeyCaps with tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Usage flow, from the user's side:
- A status InfoBar under the send target says where keys go now: the window (or "no window selected"), input
  on/off, the input method and whether the overlay is open, with the last result as its message. It is a warning
  with "Refresh windows" when there is no window, informational while input is off, success when keys can be sent.
- The global hotkey is a switch next to its chord; choosing a chord applies it at once. The Apply and Disable
  buttons are gone, so there is nothing left to forget to apply.
- Empty states: a repository without Mods says so and offers "Open the dashboard"; a Mod without bindings says
  its INI has no key = lines and offers "Show INI file".
- The page reads top to bottom: what to send to which window, the status, the bindings, then the overlay settings;
  character follow and sending stay folded as advanced settings.

New UI test: the hotkey switch turns the hotkey off and on and it is saved. Removed the now unused keys
ShortcutPanel.Disable, ShortcutPanel.HotkeyGroup and ShortcutPanel.GlobalHotkeyDisabledOrUnavailableChoose.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@uyujkk
uyujkk merged commit 1c317ba into main Nov 9, 2026
4 checks passed
@uyujkk
uyujkk deleted the claude/ui-j5-shortcuts branch November 16, 2026 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant