Skip to content

Add Developer settings tab with cache clear and broker stats - #53

Merged
comp615 merged 3 commits into
block:mainfrom
comp615:dev-settings-tab
Sep 14, 2026
Merged

comp615 merged 3 commits into
block:mainfrom
comp615:dev-settings-tab

Conversation

@comp615

@comp615 comp615 commented Sep 14, 2026

Copy link
Copy Markdown
Collaborator

What

Adds a Developer section to Settings with two tools:

  • Clear cache — calls the existing relay.clearCache(), wiping cached channels, messages, and media (head/window state, media prep, persistence) while keeping account, relay, and sidebar settings. This gives a repeatable way to test cold loads and reload behavior without removing relay configuration.
  • Relay broker stats — polls the dev broker's /api/relay/stats (queries, errors, media, connects) every 5s, with a graceful "unavailable" state when the endpoint doesn't exist.

Visibility gating

The tab renders only when import.meta.env.DEV and the hostname is localhost/127.0.0.1. The hostname check is required in addition to DEV because packaged desktop builds serve production bundles from tauri://localhost. The same flag gates the section allowlist in src/app/navigation.ts so deep links to settings/developer don't fail as "unavailable" on dev while being blocked in production builds.

Also includes the relay/media request logging groundwork from 33c4d32 (client logging gated behind localStorage['buzz.debug.relay']==='1' plus broker-side logging) so the stats and the cache tool have a debugging story end to end.

Validation

  • pnpm typecheck, biome on touched files: clean
  • Verified in the running app on localhost:1430: tab hidden check logic reviewed, Developer tab renders, broker stats populate from the live dev broker, Clear cache completes and shows a status confirmation
  • No test coverage added: pure UI/gating over existing store APIs; existing suites unchanged

🤖 Description written by AI (Amp); commits signed off by the agent on Charlie Croom's behalf per DCO.

comp615 and others added 2 commits September 14, 2026 11:18
Gate client warm/preparation logging behind localStorage
(buzz.debug.relay) and log every dev-broker request, query filter,
media fetch and origin rejection to the Vite output.

Signed-off-by: Charlie Croom <ccroom@squareup.com>
Amp-Thread-ID: https://ampcode.com/threads/T-01a0a053-f85b-754c-a353-03fb77a26363
Co-authored-by: Amp <amp@ampcode.com>
Visible only on localhost in dev builds (hostname check excludes packaged
desktop, which serves production bundles from tauri://localhost). Exposes
the relay broker /api/relay/stats counters and a clear-cache action that
keeps account and sidebar settings.

Signed-off-by: Charlie Croom <ccroom@squareup.com>
Amp-Thread-ID: https://ampcode.com/threads/T-01a0a053-f85b-754c-a353-03fb77a26363
Co-authored-by: Amp <amp@ampcode.com>

@baxen baxen left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Signed-off-by: Charlie Croom <ccroom@squareup.com>
Amp-Thread-ID: https://ampcode.com/threads/T-01a0a053-f85b-754c-a353-03fb77a26363
Co-authored-by: Amp <amp@ampcode.com>
@comp615
comp615 requested a review from a team as a code owner September 14, 2026 18:49
@comp615
comp615 merged commit 88e2496 into block:main Sep 14, 2026
12 checks passed
@comp615
comp615 deleted the dev-settings-tab branch September 14, 2026 19:20
delkc added a commit that referenced this pull request Sep 15, 2026
* origin/main:
  Fix inline mention styling in channels (#74)
  Fix self-replenishing background channel warming (#71)
  Add links and thread previews (#42)
  Add shared receive-only channel and thread typing (#33)
  Warm channel heads in the background before they are opened (#54)
  Add Developer settings tab with cache clear and broker stats (#53)
  Request sized relay media for avatars (#58)
  Allow parallel browser development ports (#57)
  Add worktree bootstrap for local configuration (#56)
  Make thread opens part of navigation history (#55)
  Remove the decoded-avatar hot set; respect Save-Data (#60)
  Add CODEOWNERS reviewers (#61)
  Add guarded Workflows page and session capability (#48)

Signed-off-by: Clay Delk <clay.delk@gmail.com>

# Conflicts:
#	dev/relay-broker.mjs
#	src/bundled/channels/ChannelsPage.tsx
#	src/features/messages/ChannelTimeline.tsx
#	src/features/messages/MessageComposer.tsx
#	src/features/messages/MessageRow.tsx
#	src/features/messages/ThreadPanel.test.tsx
#	src/features/messages/ThreadPanel.tsx
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