fix(ui): attach keyboard shortcuts during setup, not after auth bootstrap#12
Conversation
…trap The global keydown listener was only attached inside useAppSession's onMounted callback *after* await bootstrapAuth(). For a returning authenticated user, bootstrap flips authMode to 'ready' (rendering the diff UI) and then awaits enterApp() (load prefs, refresh repos, open repo). If any of those awaits threw or hung, useKeyboardShortcuts was never reached and every shortcut silently failed -- no console error, since those steps route failures through onError handlers. Wire useKeyboardShortcuts synchronously in useAppSession's setup body so the listener attaches immediately and independently of bootstrap timing. This also lets the composable's own onMounted/onUnmounted register in a valid instance context (the previous post-await call leaked the listener). Also add the missing return in the onOpenSearch branch and a unit test covering attach, ArrowUp/Down aliases, the disabled gate, input suppression, and unmount cleanup.
Add a reusable marketing/ folder with ready-to-publish pitch content and on-brand social images for the Git Diff Review beta launch. - posts/ — platform-tailored pitches for LinkedIn (launch announcement), X (builder thread), and Reddit (problem/story, with beta caveats), each with suggested imagery and alt text - cards/ — four branded social cards (hero/OG, screenshot, features, privacy) rendered at 2x from on-brand HTML/CSS templates in cards/src/ that reuse the app's colors, Fira Code font, logo, and screenshots - README.md — index mapping posts to cards and documenting regeneration Static md/html/css/png assets only; no app code changed.
There was a problem hiding this comment.
Code Review
This pull request introduces marketing assets, including launch posts for LinkedIn, Reddit, and X, along with HTML/CSS templates for social cards. On the codebase side, it refactors keyboard shortcut registration in useAppSession.ts to occur synchronously during setup rather than inside onMounted after authentication bootstrapping, preventing shortcuts from breaking if authentication fails or hangs. It also adds a missing return statement in useKeyboardShortcuts.ts and introduces a comprehensive test suite in useKeyboardShortcuts.test.ts. There are no review comments to assess, so no additional feedback is provided.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Content overflowed the 1080px card height, pushing the github/MIT/macOS footer below the visible area. Tighten heading and row spacing and reduce bottom padding so the footer sits fully inside the frame. Re-render PNG.
653f1aa to
da52953
Compare
What & why
This branch carries two unrelated-but-bundled changes:
1. Fix: keyboard shortcuts silently failing for returning users
The global keydown listener was only attached inside
useAppSession'sonMountedcallback afterawait bootstrapAuth(). For a returning authenticated user, bootstrap flipsauthModeto'ready'(rendering the diff UI) and then awaitsenterApp()(load prefs, refresh repos, open repo). If any of those awaits threw or hung,useKeyboardShortcutswas never reached and every shortcut silently failed — no console error, since those steps route failures throughonErrorhandlers.Change: wire
useKeyboardShortcutssynchronously inuseAppSession's setup body so the listener attaches immediately and independently of bootstrap timing. This also lets the composable's ownonMounted/onUnmountedregister in a valid instance context (the previous post-await call leaked the listener).Also: add the missing
returnin theonOpenSearchbranch, and a unit test covering attach,ArrowUp/Downaliases, the disabled gate, input suppression, and unmount cleanup.Files:
packages/ui/src/composables/useAppSession.tspackages/ui/src/composables/useKeyboardShortcuts.tspackages/ui/tests/useKeyboardShortcuts.test.ts2. Docs: launch marketing assets (
marketing/)A reusable
marketing/folder with ready-to-publish pitch content and on-brand social images for the beta launch:cards/src/that reuse the app's colors, Fira Code font, logo, and screenshots.Static md/html/css/png assets only; no app code involved.
Reviewer notes
marketing/cards/src/(seemarketing/README.md).Testing
useKeyboardShortcutsunit test added and covers attach/aliases/disabled-gate/input-suppression/cleanup.