feat: optional window-name labels (gated, supersedes #131)#133
Merged
feat: optional window-name labels (gated, supersedes #131)#133
Conversation
Adds AGENTBOARD_PREFER_WINDOW_NAME env var (default false). When enabled, external sessions display the tmux window name instead of the session name, but only when it is non-empty and distinct — preserving the existing behavior for auto-renamed windows. The mobile session switcher also uses session names instead of numeric indices when every visible session has a distinct, non-empty name. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
PR #131 introduced a mobile session-switcher rule that swapped numeric 1..N tabs for session names whenever names were distinct. The rule was client-only and not gated on the new env var, so default users would see the UI change without setting the flag — contradicting the "opt-in only" intent. Plumb config.preferWindowName through the server-config WS message into the session store, and require it true alongside the distinct-names check before tabs render names. Also restore numeric (rather than stringified) labels and trim the rendered name for consistency with the uniqueness check. Bump patch to 0.2.46.
6c6b00e to
a212d4e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Supersedes #131. Carries chuqk's original commit (
432dff1) and adds the gating fix on top.Why a new PR
PR #131 is from a fork (
chuqk/agentboard); maintainer-edit pushes don't firepull_requestevents on the upstream PR, so CI never runs on the fix. This branch is in the same repo, so CI fires immediately. Chuqk's commit and authorship are preserved.What this adds vs #131
In #131 the mobile session-switcher rule swapped numeric
1..Ntabs for session names whenever names were distinct — client-only, not gated onAGENTBOARD_PREFER_WINDOW_NAME. That contradicts the "opt-in only" intent: a default user with two distinct external sessions would already see name labels.This commit:
config.preferWindowNamethrough theserver-configWS message into the client session store (src/shared/types.ts,src/server/index.ts,src/client/stores/sessionStore.ts,src/client/App.tsx).mobileTabsUseNamesonpreferWindowName && namesAreDistinct(src/client/components/Terminal.tsx).String(index + 1)while the existingmobile layout opens drawer and switches sessionstest asserted on numeric children. Reverted to numeric label and trimmed the name when used.0.2.46.Tests
bun run lint,bun run typecheck,bun run test— all green locally (830 tests, 0 fail).Terminal > mobile layout opens drawer) is fixed by this change.Test plan
AGENTBOARD_PREFER_WINDOW_NAME=false(default): mobile tabs render1/2/...AGENTBOARD_PREFER_WINDOW_NAME=trueand distinct window names: mobile tabs render namesAGENTBOARD_PREFER_WINDOW_NAME=trueand repeated names: falls back to numericCredit
Original window-name preference behavior + helper authored by @chuqk in #131.