Skip to content

feat(shell): global shortcuts and a shortcut overview - #567

Merged
DeepDiver1975 merged 2 commits into
mainfrom
feat/global-shortcuts
Oct 6, 2026
Merged

DeepDiver1975 merged 2 commits into
mainfrom
feat/global-shortcuts

Conversation

@DeepDiver1975

@DeepDiver1975 DeepDiver1975 commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #544, the last child of the v0.8 keyboard epic #545. The app gets global shortcuts and an F1 overview. Every shortcut comes from one registry (ShortcutRegistry), which the key handler, the rail's key hints and the overview all read.

Key What it does
Ctrl+1 … Ctrl+0 Opens a module by its key, in NavModules.All order: 1 ETB, 2 Aufgaben, 3 Funktionen, 4 Kräfte, 5 Beteiligte, 6 Atemschutz, 7 CO-Messung, 8 Dateien, 9 Links, 0 Kontakte. A Stammdaten Navigation that reorders the rail does not move them. A hidden module's key does nothing.
Ctrl+Tab / Ctrl+Shift+Tab Next or previous rail entry as shown, wrapping. Checklisten have no fixed key, so this is how you reach them.
Ctrl+N Opens the ETB with the caret in VON, also from elsewhere in the ETB. On a phone it opens the composer.
F9 Goes to the most urgent open warning: Rückzugsalarm, then Druckabfrage, then Aufgabe fällig, then ILS Rückmeldung.
F1 Shows the shortcut overview. It also opens from a ? button in the command bar, which shows "F1" beside it. On a phone it is the TASTENKÜRZEL row in MEHR.

Decisions the issue left open:

  • The keys themselves: chosen in planning, as listed above.
  • F9 reuses each bar's own jump command, so F9 and a click cannot disagree. A Druckabfrage lands in the Druck field (feat(atemschutz): Druckkontrolle by keyboard — Enter records, warning bar focuses the Trupp #539).
  • The ILS Rückmeldung has nothing to jump to. F9 only focuses its ERLEDIGT button, so confirming it takes a second, deliberate key.
  • Key hints are inline. The rail shows them, and so do the command bar's ? button and the warning bar F9 will act on. Only that bar shows the hint, so the hint never names a bar F9 would skip.
  • No shortcut runs while an overlay is open. This covers the workspace and shell Pending* overlays, the master data editor's confirm, and inline panels. Esc and Enter keep reaching the overlay.
  • Alt and the text-editing keys (Ctrl+A/C/V/X/Y/Z) are never bound. The registry's own key enum has no member for them.

Changes

  • ShortcutRegistry, KeyChord, ShortcutKey and WarningKind live in AppLogic and use no Avalonia types. ModuleLabels now holds the rail labels, which used to be private to the workspace view model, because the overview needs them too.
  • MainWindowViewModel.TryRunShortcut and IncidentWorkspaceViewModel.TryRunShortcut each return false when a shortcut does not apply, so the key goes on to the focused control.
  • IncidentWorkspaceViewModel.MostUrgentWarning is the one priority that both F9 and the bar hints read.
  • ShowModule became ShowNavItem and is the single "user asked for this module" path from fix(focus): focus stays where the user left it (rail, sync rebuilds, reconnect, ETB filter) #542. ModuleFocusRequested now carries ToStartField, so WorkspaceFocus sends Ctrl+N to VON even when focus is already in the ETB.
  • GlobalShortcuts behaviour on MainView. It hooks a tunnelling KeyDown handler on the TopLevel, for two reasons:
  • ShortcutOverviewView follows AboutView and b:Overlay. It has an OverlayContractTests scenario and passes all four clauses.
  • A key-hint text style. On a Meldung the hint takes the chevron's colour, because the muted grey vanishes on the red Rückzugsalarm row.
  • README: a short "Mit der Tastatur" section.

Screenshots

The workspace with every warning bar up. Before:

Before

After. The rail shows each module's key, and the command bar's ? button shows F1. The Rückzugsalarm row shows F9, since F9 acts on that row:

After

The F1 overview, on desktop and at phone width:

F1 overview

F1 overview at phone width

Checklist

  • Commits follow Conventional Commits and are DCO signed off
  • Commits are cryptographically signed
  • make clean ci passes: 0 errors, 0 warnings, every assembly green (Acceptance 522/522, AppLogic 1153/1153), no Test Run Failed. make format-check is clean.
  • One changelog entry in changelog.d/
  • UI changes include before/after screenshots
  • No real master data or personnel data (screenshots use AnonymizedExampleData)

Tests

  • ShortcutRegistryTests cover:
    • chords are unique;
    • every module has exactly one shortcut;
    • no shortcut uses a text-editing key;
    • the German key labels.
  • WorkspaceShortcutTests cover:
    • a module key works under a reordered and a hidden-module Navigation;
    • Ctrl+Tab wraps;
    • Ctrl+N works from inside the ETB and on a phone;
    • an overlay blocks shortcuts;
    • the full F9 priority, including ILS focusing without acknowledging.
  • MainWindowViewModelTests cover F1 from any view, F1 blocked behind About, and module keys doing nothing without an Einsatz.
  • GlobalShortcutTests (headless, real keys on MainView) cover:
    • Ctrl+4 → Kräfte and its first field, with the default rail and a reordered one;
    • Ctrl+N → VON from Kräfte and from inside the ETB;
    • shortcuts do nothing behind a workspace confirm or behind About;
    • Ctrl+Tab and Ctrl+Shift+Tab from a text box;
    • F9 → the Druck field of the Trupp in Rückzugsalarm;
    • F9 → ILS ERLEDIGT;
    • the F1 overview lists exactly the registered shortcuts, and Esc closes it;
    • the rail hints.

🤖 Generated with Claude Code

DeepDiver1975 and others added 2 commits October 6, 2026 14:59
Ctrl+1 … Ctrl+0 open a module by its key, not its rail position, so a
Stammdaten Navigation that reorders the rail does not move them.
Ctrl+Tab / Ctrl+Shift+Tab walk the rail as shown, Checklisten included.
Ctrl+N opens the ETB with the caret in VON, also from elsewhere in the
ETB. F9 goes to the most urgent open warning: Rückzugsalarm, then a due
Druckabfrage, a due Aufgabe, the ILS Rückmeldung. For the Rückmeldung it
only focuses ERLEDIGT, so confirming it takes a second key.

F1, or the new TASTENKÜRZEL button (also in MEHR on a phone), opens an
overview built from ShortcutRegistry, the table the key handler
dispatches on. Each module's key is shown on its rail tab, and F9 on the
one bar it acts on.

The handler tunnels on the TopLevel: Ctrl+Tab only reaches the window
while tunnelling (#537), and with nothing focused a key never passes the
shell. No shortcut runs while an overlay is open.

Fixes #544

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
TASTENKÜRZEL was the widest label on the bar, and the loudest by
accident: its own TextBlocks picked up the global TextBlock style, so it
rendered in Barlow 14 white beside Oswald 13 grey neighbours. It pushed
the action cluster 160px left for a reference aid opened rarely.

It is now a ? glyph and its key, F1, in the bar's grey. Screen readers
and the tooltip say "Tastenkürzel (F1)", and the phone's MEHR list keeps
the word.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
@DeepDiver1975

Copy link
Copy Markdown
Contributor Author

Follow-up (cc62766): the command-bar entry was too loud. Its own TextBlocks picked up the global TextBlock style, so it rendered in Barlow 14 white beside Oswald 13 grey neighbours. It was also the widest label on the bar and pushed the cluster 160px left. It is now a ? glyph and F1 in the bar's grey. Screen readers and the tooltip say "Tastenkürzel (F1)", and the phone's MEHR list keeps the word.

Top to bottom: before #544, the first version of this PR, now.

Command bar before, in the first version of this PR, and now

@DeepDiver1975
DeepDiver1975 merged commit 4620c01 into main Oct 6, 2026
6 checks passed
@DeepDiver1975
DeepDiver1975 deleted the feat/global-shortcuts branch October 6, 2026 13:41
@DeepDiver1975 DeepDiver1975 mentioned this pull request Oct 6, 2026
13 of 14 tasks
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.

feat(shell): global shortcuts and a shortcut overview

1 participant