Skip to content

feat(settings): runtime toggle for prefer-window-name#167

Open
0x79H wants to merge 1 commit into
gbasin:masterfrom
0x79H:feat/prefer-window-name-setting
Open

feat(settings): runtime toggle for prefer-window-name#167
0x79H wants to merge 1 commit into
gbasin:masterfrom
0x79H:feat/prefer-window-name-setting

Conversation

@0x79H

@0x79H 0x79H commented Jul 22, 2026

Copy link
Copy Markdown

Fixes #164.

What

AGENTBOARD_PREFER_WINDOW_NAME currently requires a server restart and isn't discoverable. This wires it into the existing runtime-settings pattern (like tmux-mouse-mode):

  • GET/PUT /api/settings/prefer-window-name, persisted under prefer_window_name in app_settings; the env var remains the initial default, a stored value wins once toggled (same contract as history-max-age-hours). Persist failure rolls back the runtime value and returns 500 (same contract as tmux-mouse-mode).
  • The session refresh worker receives the value per request (RefreshWorkerRequest.preferWindowName) since its own config snapshot is frozen at spawn time.
  • PUT rebroadcasts server-config so already-connected clients (mobile tab labels read preferWindowName from the session store) converge without a reload, and schedules a refresh so sidebar names update within about a second.
  • Settings modal: a "Prefer Window Names" switch placed next to Mouse Mode (the immediate-apply section, not the draft section, so Cancel semantics stay honest).

Verification

  • Container (Debian trixie, non-root, HOSTNAME=127.0.0.1): full suite green, coverage mode and vite build pass on this branch in isolation.
  • Manually exercised end-to-end on a live deployment: toggling flips sidebar labels between session names and window names within one refresh tick, persists across restarts, and the env var still seeds the initial default.

Feel free to rework or take this over entirely — happy either way.

- GET/PUT /api/settings/prefer-window-name persisted in app_settings;
  the env var stays the initial default, a stored value wins
- pass the value to the session refresh worker per request since its
  config snapshot is frozen at spawn
- rebroadcast server-config on change so connected clients converge
  without a reload, and schedule a refresh for prompt sidebar updates
- settings modal: Prefer Window Names switch next to Mouse Mode
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.

Make the prefer-window-name preference configurable from the settings UI

1 participant