Skip to content

chore: enable Cmd+R reload in production builds - #468

Merged
kalvinnchau merged 1 commit into
mainfrom
coffee/cmd-r-reload-production
Sep 30, 2026
Merged

kalvinnchau merged 1 commit into
mainfrom
coffee/cmd-r-reload-production

Conversation

@kalvinnchau

Copy link
Copy Markdown
Contributor

What

Un-gates the Cmd+R reload host shortcut so built (production) apps support webview refresh. Previously the registration was wrapped in if (import.meta.env.DEV), so Cmd+R did nothing in release builds.

Why

The legacy buzz desktop app always registered Cmd+R (useReloadShortcut -> WebSocket teardown -> window.location.reload()). buzz-app's port was dev-only, losing that parity in built apps. buzz-app's relay sockets are plain webview WebSockets (src/features/relay/live.ts:207) torn down automatically by page reload, so the old native teardown shim is not needed; plain window.location.reload() is sufficient.

Changes

  • src/app/shortcuts.ts: register the shortcut unconditionally; rename development-reload -> app-reload (title "Reload Buzz"), HOST_SHORTCUT_ORDER.development -> .reload (same order value).
  • src/app/ShortcutSettings.test.tsx: assert the row unconditionally instead of branching on import.meta.env.DEV.

Validation

  • vitest run src/app/ShortcutSettings.test.tsx (14 passed), biome check on touched files, tsc --noEmit clean.
  • Deferred: production-build verification in the native app (press Cmd+R, expect webview reload and "Reload Buzz" in the shortcut list).

The reload host shortcut was gated behind import.meta.env.DEV, so
built apps had no Cmd+R refresh. Register it unconditionally as
"Reload Buzz" (id app-reload), matching the always-on reload
shortcut in the legacy buzz desktop app.

Signed-off-by: Kalvin Chau <kalvin@block.xyz>
@kalvinnchau
kalvinnchau marked this pull request as ready for review September 30, 2026 19:17
@kalvinnchau
kalvinnchau requested review from a team, comp615 and wesbillman as code owners September 30, 2026 19:17
@kalvinnchau kalvinnchau changed the title Enable Cmd+R reload in production builds chore: enable Cmd+R reload in production builds Sep 30, 2026
@kalvinnchau
kalvinnchau merged commit f0634f5 into main Sep 30, 2026
47 of 54 checks passed
@kalvinnchau
kalvinnchau deleted the coffee/cmd-r-reload-production branch September 30, 2026 20:06
cynfria pushed a commit that referenced this pull request Sep 30, 2026
…followup

* origin/main:
  Group inventory by community and use compact rows outside the current community (#290)
  chore: enable Cmd+R reload in production builds (#468)
  ci: run playwright jobs in the pinned docker image (#469)
  fix(profile): let the web profiling page follow the browser window size (#467)
  Let plugin pages publish NIP-AR artifacts and embed the host thread view (#434)

Signed-off-by: Tree Trunks <6ba22921d9dc2ad0aa6ecdf63787ddd24726e266d866da31af69f2e4e146ace5@buzz.block.builderlab.xyz>
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.

2 participants