8000 V0-17: Complete macOS keyboard, accessibility, and external links by kiran-brahma · Pull Request #37 · kiran-brahma/nodepad-app · GitHub
[go: up one dir, main page]

Skip to content

V0-17: Complete macOS keyboard, accessibility, and external links - #37

Merged
kiran-brahma merged 1 commit into
mainfrom
claude/issue-18-macos-interactions
Jul 23, 2026
Merged

kiran-brahma merged 1 commit into
mainfrom
claude/issue-18-macos-interactions

Conversation

@kiran-brahma
Copy link
Copy Markdown
Owner

Closes #18. Part of #1.

What this does

Completes the macOS keyboard, accessibility, focus, reduced-motion, and external-link behavior across the finished V0 surfaces.

  • Command-K opens a command palette (cmdk) that runs actions App already owned; the palette owns no business rule. Command-Z session undo (already skips text editing) is unchanged.
  • Escape is coordinated by a priority-ordered escape stack: palette (80) > modal (60) > inline draft (40) > note-focus lock (0), so the topmost dismissible surface closes before focus clears.
  • Modals (Cloud consent, Rename Label, command palette) trap focus, cycle Tab within, and restore focus to the invoker. Inline note-card and workspace-rename forms cancel on Escape via a shared EscapeDismiss.
  • External links in a Note's Markdown never navigate the webview: the ReactMarkdown a override routes explicit http/https URLs through one Tauri command that re-validates the scheme in Rust (external_link.rs) and hands the URL to the macOS open shell opener. Non-HTTP(S) schemes render as inert text. The single durable seam (workspace-client) gains one binding; no new Tauri plugin or capability.
  • Status/errors use text/semantics, not color alone: the over-limit Annotation counter reads "Over the limit" (role=alert); Synthesis/Enrichment status are aria-live; the consent dialog announces its saving state.
  • Reduced motion: a defensive prefers-reduced-motion media query neutralises animation without hiding state (V0 has no essential animation).
  • Visible focus: a global :focus-visible ring for every interactive control.

New modules

  • src-tauri/src/external_link.rs — scheme validation (pure, unit-tested) + macOS shell opener.
  • src/escape-stack.ts — coordinated Escape priority.
  • src/modal-focus.ts — focus trap + restore-to-invoker.
  • src/command-palette.tsx — Command-K palette + useCommandPaletteShortcut.
  • src/external-link.tsx — ReactMarkdown a override.
  • src/escape-dismiss.tsx — shared inline-form Escape cancellation.

Workflow followed

Per AGENTS.md: prd-simplicity-audit (docs/audits/issue-18-simplicity-audit.md, PROCEED) → parallel Standards + Spec code-review (all actionable findings addressed) → scoped fallow (no introduced dead code or duplication; the one introduced complexity regression in App was extracted into a module-level buildPaletteActions and the remaining single conditional render is documented as pre-existing orchestrator debt out of scope for this slice) → focused tests + full check gate.

Gates

  • typecheck, lint (0 warnings), vitest (153 passed), cargo test (180 passed; +3 new external-link tests), web build, cargo check (no warnings).
  • fallow audit --base HEAD: introduced dead-code 0, introduced complexity 0, introduced duplication 0. The 44 inherited dead-code errors are pre-existing legacy-scaffold dependencies, out of scope.

Manual VoiceOver smoke pass (automation cannot prove these)

Please verify on a macOS build:

  • With VoiceOver on, create/organize/search/navigate/export using only the keyboard; confirm focus moves predictably and no focus trap escapes the app.
  • Open the Cloud consent dialog and the Rename Label modal with VoiceOver; confirm focus enters the dialog, Tab cycles within, Escape restores focus to the opener, and the dialog is announced.
  • Command-K opens the palette; arrow/typing selects; Enter runs; Escape closes and returns focus.
  • In a Note containing an explicit https link and a mailto link, activate the link with VoiceOver/Enter and confirm it opens in the default browser; confirm the mailto link is inert (no navigation, no app launch).
  • Toggle System Settings → Accessibility → Reduce Motion, and confirm no transitions/state are hidden.
  • Tab through every surface and confirm a visible focus ring appears on each control.

Do not merge without review.

Issue #18. Complete the keyboard, accessibility, focus, reduced-motion, and
external-link behavior across the finished V0 surfaces.

Shortcuts and Escape:
- Command-K opens a command palette (cmdk) that runs the actions App already
  owned; the palette learns no business rule.
- Command-Z session undo already skipped text editing; unchanged.
- Escape is now coordinated by a priority-ordered escape stack so the topmost
  dismissible surface (palette > modal > inline draft) closes before the
  note-focus lock clears. The note-focus lock demoted to the lowest priority.

Modals and focus:
- useModalFocus traps focus inside a true modal, cycles Tab within it, and
  restores focus to the invoker on close. Applied to the Cloud consent
  disclosure, the Rename Label dialog, and the command palette.
- Inline note-card and workspace-rename forms cancel on Escape via a shared
  EscapeDismiss component.

External links:
- A Note's Markdown links never navigate the webview: the ReactMarkdown `a`
  override routes explicit http/https URLs through one Tauri command that
  re-validates the scheme in Rust and hands the URL to the macOS `open` shell
  opener. Non-HTTP(S) schemes render as inert text. The single durable seam
  (workspace-client) gains one binding; no new Tauri plugin or capability.

Status, reduced motion, and visible focus:
- The over-limit Annotation counter reads "Over the limit" (role=alert), not
  color alone. Synthesis and enrichment status get aria-live; the consent
  dialog announces its saving state.
- A defensive prefers-reduced-motion media query neutralises animation
  without hiding state (V0 has no essential animation).
- Global :focus-visible ring for every interactive control.

Tests:
- User-level keyboard, accessibility, focus-trap, external-link, scheme
  rejection, reduced-motion, and "don't steal shortcuts" integration tests.
- Rust unit tests for the external-link scheme predicate.
- vitest now excludes stale agent-worktree checkouts under .claude/.

Workflow: prd-simplicity-audit (docs/audits/issue-18-simplicity-audit.md,
PROCEED), parallel Standards+Spec code-review (findings addressed), scoped
fallow (no introduced dead code/duplication; App complexity threshold
documented as pre-existing orchestrator debt), and the full check gate
(typecheck, lint, vitest, cargo test, web build, cargo check).
@kiran-brahma
kiran-brahma merged commit 48a1115 into main Jul 23, 2026
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.

V0-17: Complete macOS keyboard, accessibility, and external links

1 participant

0