Skip to content

[T-115] Keyboard shortcuts (g b, g c, /, j/k, r, ?) and shortcuts dialog #184

Closed

Description

@CodewithJha

Task T-115 · Milestone M8 — Dashboard · Size S · Priority P2 · Epic #8

Implements NFR-ACC-001 · NFR-USE-001

Branch feat/t-115-keyboard-shortcuts-and-shortcuts-dialog — one task = one branch = one PR (doc 32 §6)

Summary

Register global shortcuts per doc 13 §4 through lib/keyboard.ts and implement the ? dialog (Radix Dialog) listing them; feature-level shortcuts (j/k, r) registered by their features.

Context / motivation

Power-user productivity and keyboard accessibility.

Scope

In scope

  • Shortcuts disabled while typing in inputs.

Implementation guidance

  • app/shortcuts.tsx: global table {keys, description, action} for g b (Bench), g c (last visited campaign from a small store), / (focus the page's search input via SearchFocusContext) and ? (open dialog). Features register scoped ones (j/k, r) through lib/keyboard.ts; the dialog lists both, grouped.
  • components/ShortcutsDialog: Radix Dialog with a shortcuts table; aria-keyshortcuts on relevant buttons.
  • Standards: respect the layering contracts (doc 16 §2) and conventions in doc 34; no hard-coded tunables — thresholds/defaults come from typed settings (doc 27); no magic numbers (ruff PLR2004); public APIs typed (mypy strict) and documented.

Acceptance criteria

  • Each shortcut tested; dialog accessible (focus trap, Esc).
  • Shortcuts ignored inside inputs.
  • The dialog lists feature shortcuts only while that feature is mounted.
  • Tests listed below added and green in CI; coverage of new code meets the gate in doc 18 §3.
  • Docs, config reference and CHANGELOG Unreleased updated where behaviour, keys or interfaces changed.
  • Definition of Done (doc 32 §3) satisfied.

Tests required

  • web/src/app/shortcuts.test.tsx.

Dependencies

Blocked by: #168 (T-086c), #163 (T-085b)

Blocks: #188 (T-114)

Parallelization notes

Files / paths owned by this task — avoid editing other paths; shared files (pyproject.toml entry points, cli/main.py, api/routers/__init__.py, router.tsx, docker/compose.yaml, ci.yml) are append-only:

  • web/src/app/shortcuts.tsx
  • web/src/components/ShortcutsDialog/**

Small.

Definition of Done

Per doc 32 §3 and AGENTS.md §5: lint, format, mypy strict and import-linter green; tests added and passing; docs updated; PR template completed with Closes #<this issue>; Conventional Commit messages referencing T-115 (doc 16 §6); commits authored only by the repository owner identity (AGENTS.md §4); CI green; reviewer checklist (doc 32 §5.1) satisfied.

References

Design docs: doc 13 §4

Requirements: NFR-ACC-001 · NFR-USE-001 (traceability: doc 28)

External:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions