Skip to content

feat(desktop): keyboard shortcuts — ⌘⇧N new channel + ↑-to-edit last message#809

Merged
wesbillman merged 1 commit into
mainfrom
brain/kbd-shortcuts
Jun 1, 2026
Merged

feat(desktop): keyboard shortcuts — ⌘⇧N new channel + ↑-to-edit last message#809
wesbillman merged 1 commit into
mainfrom
brain/kbd-shortcuts

Conversation

@wesbillman

Copy link
Copy Markdown
Collaborator

What

Two keyboard shortcuts for the desktop app:

  • ⌘⇧N — open the new-channel flow from anywhere.
  • ↑ in an empty composer — open edit mode for your most recent message, resolved per-surface (channel / DM / thread, with a >= tie-break on timestamp).

The notable fix

The ↑-to-edit shortcut appeared broken in the packaged app: it only worked if you clicked out of the composer and back in first. Root cause was a focus bug, not a keymap bug.

On send, isSending flips true → the composer is passed disabled → the editor's editable goes false → the WebView blurs the contenteditable, stranding focus on <body>. When the send settles and the editor becomes editable again, nothing restores focus, so ↑ never reaches the editor's keydown handler.

Fix: in the editable-toggle effect, record editor.isFocused before disabling, and call editor.commands.focus() on re-enable if it had focus — scoped to that one editor so it can't steal focus from another composer.

This reproduces only in the app's WebView; Chromium does not blur on the contenteditable toggle, so our existing "composer keeps focus after send" e2e passes in Chromium with or without this fix. A true regression guard needs a Tauri-webdriver harness that drives the real WebView — tracked as a follow-up rather than bolted on here as a false-safety Chromium test.

Tests / checks

  • typecheck, biome lint clean
  • 339 unit, full pre-push suite (clippy rust+tauri, rust/web/tauri/mobile tests) green
  • 117/117 smoke e2e green (incl. 3 new ArrowUp cases in messaging.spec.ts)

Notes

  • Two documented file-size overrides added (useRichTextEditor.ts 560, MessageComposer.tsx 800→820), each with a rationale comment. The keymap-extraction split of useRichTextEditor.ts is the tracked follow-up.
  • Follow-ups: (1) Tauri-webdriver e2e harness to guard the WebView focus regression; (2) extract the 3 inline Tiptap keymap extensions out of useRichTextEditor.ts.

…message

- ⌘⇧N opens the new-channel flow from anywhere
- ↑ in an empty composer opens edit mode for your most recent message,
  resolved per-surface (channel / DM / thread, >= tie-break)
- Fix the WebView blur-on-send bug: the editable-toggle on `isSending`
  blurred the contenteditable in the app WebView, stranding focus on body
  so ↑ never reached the editor. Now record `isFocused` before disable and
  restore focus to that same editor on re-enable (scoped, won't steal focus
  from another composer). Confirmed via instrumented probes in the WebView.
- 3 ArrowUp e2e cases in messaging.spec.ts (Chromium passes with/without the
  focus fix — the WebView regression needs a Tauri-webdriver harness; tracked
  as a follow-up).
- check-file-sizes.mjs: documented overrides for useRichTextEditor.ts (560)
  and bump MessageComposer.tsx (800 → 820) for the edit-callback wiring.

Signed-off-by: npub1yxv5wk0u0fh6dwt925wntn7h397jvteyj4r87ttcd9xae7n2t3lqqj9jmm <21994759fc7a6fa6b965551d35cfd7897d262f2495467f2d78694ddcfa6a5c7e@sprout-oss.stage.blox.sqprod.co>
@wesbillman wesbillman requested a review from a team as a code owner June 1, 2026 15:45
@wesbillman

Copy link
Copy Markdown
Collaborator Author

@codex please review

@wesbillman wesbillman merged commit d810608 into main Jun 1, 2026
15 checks passed
@wesbillman wesbillman deleted the brain/kbd-shortcuts branch June 1, 2026 16:12
tlongwell-block pushed a commit that referenced this pull request Jun 1, 2026
* origin/main:
  feat(desktop): keyboard shortcuts — ⌘⇧N new channel + ↑-to-edit last message (#809)
  fix(desktop): scope agent sweep to the owning app instance (#808)

Signed-off-by: tlongwell-block <109685178+tlongwell-block@users.noreply.github.com>

# Conflicts:
#	desktop/scripts/check-file-sizes.mjs
wpfleger96 added a commit that referenced this pull request Jun 1, 2026
…s merge

Main merged #809 (⌘⇧N shortcut) which added 23 lines to AppSidebar.tsx
for the controlled create-channel dialog. Bump override from 810 to 830.
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