Skip to content

refactor(site/src/pages/AgentsPage): compose the right panel from SidebarTab children - #31568

Merged
DanielleMaywood merged 4 commits into
mainfrom
refactor/agents-built-in-terminal-tab
Nov 5, 2026
Merged

DanielleMaywood merged 4 commits into
mainfrom
refactor/agents-built-in-terminal-tab

Conversation

@DanielleMaywood

@DanielleMaywood DanielleMaywood commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

Note

This PR was generated by Coder Agents on behalf of @DanielleMaywood.

Stage 2 of the AgentChatPageView simplification (stage 1: #31476). Behavior is unchanged.

The right panel is now composed as children instead of being built from config arrays and a render switch:

<SidebarTabView activeTabId={...} onActiveTabChange={...} ...>
  <SidebarTab id="summary" label="Summary"><ChatSummaryPanel /></SidebarTab>
  <SidebarTab id="git" label="Git" badge={...}><GitPanel /></SidebarTab>
  ...
  {userTabs.map((tab) => <SidebarTab key={tab.id} ...><UserTabPanel tab={tab} /></SidebarTab>)}
</SidebarTabView>
LLM Slop Description
  • SidebarTabView is a compound component. It reads its <SidebarTab> children for the tab bar and owns the effective-tab fallback and close-to-neighbor selection (SidebarTab.onClose receives the next active tab id).
  • Each SidebarTab provides {isActive, isPanelOpen, isExpanded} through useTabPanelState(). ChatSummaryPanel, DebugPanel, DesktopPanel, GitPanel and TerminalPanel derive their own flags from it with the rules they had before, so their isVisible, isExpanded, isHot and autoFocus props are gone.
  • New AppPanel (Browser and workspace app tabs) and UserTabPanel (terminal, workspace app, port), replacing UserTabContent and renderTabContent.
  • The built-in Terminal is synthesized as the first user terminal tab, so it shares rendering and numbering with the rest. nameUnlabeledTerminals gives unlabeled terminals "Terminal", "Terminal 2", and so on.
  • Removed from the View: sidebarTabConfigs, getEffectiveTabId, the neighbor logic, handleToggleSingletonTab and the per-panel flag computations. The View goes from 1060 to 960 lines.
  • Existing tests and stories were updated for the removed props; the panel stories that need a hidden state use a TabPanelStateContext decorator. No new tests.
  • Intentionally preserved: the singleton order mismatch between the tab bar and the add menu, and the per-panel visibility rule differences (for example Desktop gates on active tab only).

Checks: pnpm check, pnpm lint (including the compiler check), pnpm lint:types, AgentsPage unit (134 files) and storybook (87 files) tests, the frontend-deep-review roles and the FE1 to FE10 audit.

Design review and plan

AgentChatPageView: why it looks like this, and how to simplify it

Scope: site/src/pages/AgentsPage/AgentChatPage/AgentChatPageView.tsx (1125 lines) and its container AgentChatPage.tsx (870 lines), on origin/main a512a7f (2026-10-29). Line numbers below refer to that commit. "View" = AgentChatPageView.tsx, "Page" = AgentChatPage.tsx.

Method: four read-only research lanes (git history, PR bodies, review threads), one cross-check of the 8 most load-bearing claims (7 confirmed, 1 uncertain, 0 refuted), then three parallel design passes under different constraints. Confidence is high unless marked.

1. Headline numbers

2. Root causes

  1. The View is the lowest common owner of the transcript and the right panel. feat(site): rich preview for the spawn_computer_use_agent tool #23684 moved tab selection out of SidebarTabView so a transcript tool (the inline desktop preview) could open the Desktop tab. Every feature that links the two lands here: Desktop open, Preview open, Git panel writing into the composer.
  2. Each right-panel feature arrived with its own state, persistence, support check, render case and, if tools can open it, its own context. There is no shared tab shape, so a new tab means shotgun surgery.
  3. Panels stay mounted on purpose (fix(site/src/pages/AgentsPage): preserve right panel tab state across switches #23737: unmounting lost scroll, commit drafts and VNC; feat: support multiple terminal tabs on the agents right panel #26089: hidden canvas terminals keep their pixels). So the View must tell each panel "you are shown". Each feature wrote its own flag, and the flags disagree.
  4. The Sept 2026 refactor series (refactor(site/src/pages/AgentsPage): extract AgentChatPage helpers and hooks #29032 to refactor(site/src/pages/AgentsPage): fetch workspace options in <ChatPageInput /> #29118) moved reads into the leaves but deliberately stopped at the send pipeline. refactor(site/src/pages/AgentsPage): extract AgentChatPage helpers and hooks #29032 says the send pipeline and View "stay put". refactor(site/src/pages/AgentsPage): pass Chat instead of sliced chat flags #29064 says "Handlers stay props". refactor(site): drive plan mode from mutation pending state #29117 made mutation pending state drive isInputDisabled. The View became a relay. You noted the cost on refactor(site/src/pages/AgentsPage): extract AgentChatPage helpers and hooks #29032 ("So many props getting drilled").
  5. The loading view needs neither chat nor store, so it was split off (refactor(site): separate AgentsPage and AgentDetail into container/view pairs #22812) and its layout copied.

3. Catalogue: what each part does, why, and whether the reason still holds

Verdict key: Keep, Move (to the owner named), Delete.

3.1 Prop relay (Page to View)

Concern Why it exists Still holds? Verdict
Model and reasoning selection, MCP selection, editing state, mutations, pending flags (View 113-136, 153-176) submitChatTurn and isInputDisabled read them (Page 507-520, 654-698). #29032, #29064, #29117 Yes, they must stay in the Page Keep in the Page, but stop relaying them through the View. Pass the composer as a node (your #30638)
Model setup counts (providerCount, modelCount, unsupportedProviderNames, canConfigureAgentSetup) Inferred: the Page already ran the queries Partly. ChatPageInput is the only consumer, and AgentCreateForm already derives the same values itself (AgentCreateForm.tsx 542-652) Move into ChatPageInput (optional)
sshCommand (Page 613-616) #22529 No. Its only consumer is WorkspacePill, four hops down. SSHButton already reads deploymentSSHConfig itself Move into WorkspacePill
Pagination, urlTransform, gitWatcher The Page owns the infinite query and the store hydration. The git watcher also feeds the composer's folder (#24295) Yes Keep, forwarded directly

3.2 Chat column

Concern Why Still holds? Verdict
ChatTopBar + liveChatStatus (326, 834) ChatTopBar reads its own data (#29074, #29116). Archive is gated on live status (#29065) Yes Keep
Model notices (843-856) The notice depends on the Page's resolved model (#27960) Yes Keep the derivation in the Page
Archived banner and hidden composer (857, 914) Layout decisions (#29035, #29119) Yes Keep
Read-only owner notice (788-795) #24941, #25736, #30483 No. It is a second check of the Page's isViewerNotOwner. #30483 itself lists "one viewer-permission check" as a follow-up Move into ChatPageInput, as #30638 does. Only the UX moves. Submission and mutation permission checks stay where they are
attachedWorkspace, preferredFolder (397-421) #23964 badge; #24295 prefers the git root for monorepos Yes Move to ChatPageInput and the Page, as in #30638
onImplementPlan / onSendAskUserQuestionResponse gating (894-903) #24236, #29117 isOtherUserReadOnly || is redundant in production: isInputDisabled already includes viewer-not-owner (Page 242-243, 515-520) Delete the redundant term. The Page passes undefined when a turn can't be submitted
onEditUserMessage gating (886-890) #25736 Medium-confidence bug: an archived chat you own still gets an edit handler while the composer is hidden Fix, as a product call
License and runtime hours (797-806) #27902. Inferred: keep the callout presentational No. QueuedForCapacityCallout is the only consumer, and the stories already drive it through providers (cross-check confirmed) Move into the callout
initialActiveTurnMaxMessageId + initialMessages (332-341) #28130. Must be captured when the transcript mounts Yes, but ChatPageTimeline mounts at the same moment (medium) Move into ChatPageTimeline
key={agentId} on the View (Page 787) and on ChatPageTimeline (875) No written reason No. KeyedAgentChatPage already keys the whole subtree (Page 854-867) Delete

3.3 Right-panel tab model

Concern Why Still holds? Verdict
Active tab saved per chat (351, 368-373) A chat switch remounts the page (#24631) Yes Keep
No saving for archived chats (370, 376, 382, 388) Codex review on #24631: clicking tabs in an archived chat re-created the keys that archiving had just cleared, so "unarchive starts fresh" broke Yes, but the rule is written 4 times (a 5th copy in Preview), and archive clears it in 4 call sites Keep one rule
Three persistence effects for user tabs, terminal hidden, singletons (375-391) #26089 review: functional updaters plus effect saves to avoid stale closures. #28370 added the third Partly. The split from the inline sidebarTabId save is historical only. The effects write "[]" on every mount, and they rewrite state if a chat is unarchived while open (cross-check confirmed) Consolidate into one save path. Every mutation path counts, including tool-triggered opens and closes. Keep a small effect if handler saves would need duplicate writes
validateUserRightPanelTabs (445) #26208: tabs are hidden, not deleted, when their app or port goes away Yes Keep. It is the one eligibility check for user tabs
UserTabContent fallbacks (200-265) Added for consistency, and for a bot finding No. All are unreachable, because only validated tabs get here (cross-check confirmed) Delete
Singleton support (429-443), render guards (672, 680, 689), toggle guard (763) #28370: Browser loaded its iframe on every page load, so panels now start hidden and are toggled from a dropdown. A saved choice survives a temporary loss of support Data yes. The check is written 3 times, and the dropdown already filters Keep one check
Singleton order and labels #26166 keeps terminals rightmost The order is written in 3 places and disagrees (tab bar: debug, browser, desktop; canonical list and menu: browser, desktop, debug) Keep one list
Built-in Terminal as its own concept (defaultTerminalHidden, 357, 450, 549-554, 688-704) #26089: closeable and restorable, and "no Terminal 2 without Terminal 1" Partly. It costs an extra key, an extra render path and a numbering offset. It already uses reconnectionToken = chatId (cross-check confirmed) Render it through the normal terminal path as a synthesized tab. No storage migration
Dense terminal numbering (469-494) #26089, #26208 Yes Keep. It gets simpler once the built-in Terminal is a normal terminal
getEffectiveTabId falls back to the first tab (496) #23920, #24631. Never writes back Yes Keep. It has one caller and lives in the misleadingly named ChatsSidebar/
Close picks the neighbor tab (733-760) #26089. The reason is inferred Yes Keep

3.4 Activation and tab content

Concern Why Still holds? Verdict
Tab selection lives in the View Transcript tools open tabs (#23684) Yes. This is the page's integration job Keep one authority for active and shown tabs
onOpenDesktop only when the panel can render (511-518) #28370: otherwise a tool can select a tab the list omits Yes Keep, derived from the same support check
Open handlers dedupe (567-640) #26208. Reopening a command app must not start another session (#26089) Yes Keep, next to the tab kind
Pending terminal (362, 520-537) #26089: avoid a blank frame when switching terminal canvases. Every TerminalPanel fires onReady once per mount, so the guard is required Unclear. A 100 ms fallback caps the benefit, and nobody has measured it Decide after a visual check: delete, or keep inside the terminal tab code
Per-panel visibility flags (648, 676, 685, 692-699, 709, 218-219, 238) #23920: one resolved tab drives both the highlight and the content The single source holds. The flags disagree: Summary, Debug and Terminal include "panel open"; Desktop, Browser and app tabs don't. With the panel closed and Desktop active, VNC connects and Ctrl/Cmd+0/1 are captured (medium) Compute "shown" once, in SidebarTabView
WorkspaceAppFrame.active TaskPage leftover (#26088) Uncertain. Removing it changes display:none to invisible-but-laid-out Low priority, needs a visual check
TerminalClientSessionContext (366, 809) #27677: one session per page visit, surviving tab close and reopen Yes. Only TerminalPanel consumes it Keep, or pass it as a prop
ChatWorkspaceContext (810) #24194, #29550: transcript tool renderers Yes, but unrelated to tabs Wrap only the timeline

3.5 Layout, expansion, loading

Concern Why Still holds? Verdict
Panel open state owned by the Page #22983: loading and loaded views share it, so there is no shift. #28387: narrow-viewport suppression never touches the saved preference Yes Keep
Expansion gate (345-349, 968) #28387 review. RightPanel's expanded styling ignores isOpen (cross-check confirmed) Yes Move isOpen && into RightPanel
dragVisualExpanded relay (342-349, 971) #22633: siblings react during a drag Partly. All live consumers are inside RightPanel. The exception is the chat column's hidden, which is visually redundant because the expanded panel is absolute inset-0 z-30 (medium) RightPanel passes the live value to its own children. The chat column uses committed state
--agents-chat-panel-min-width, max-lg:hidden, h-full #25894, #22744/#24161, #29602 Yes Keep, written once
shouldShowSidebar, flex-row, data-testid="agents-chat-panel", {" "} Leftovers (#22837, #22718, #29017) No Delete
Separate loading view and the handleLoadingDraftChange seed #22812, #26415 Yes, while the loading composer is a different instance Keep the seed. Share the layout
Loading top bar with a no-op toggle and stale icon (1057-1062) n/a Bug Fix
Suspense skeleton #22983, #23439 It predates the lg breakpoint, the CSS variable and narrow-viewport suppression Share the layout

4. The three alternative designs

All three agree on Section 3's Delete/Move rows. They differ on the right panel and on page composition.

Design A: Delete and colocate (no new abstractions)

  • Apply every deletion and move above. Adopt refactor(site/src/pages/AgentsPage): move chat pages to ChatComposer #30638's composer node.
  • Extract two components along existing visual seams:
    • AgentChatRightPanel (about 440 lines, 16 props): user tabs, the terminal flag, pending, expansion, content.
    • AgentChatLayout (about 35 lines): the frame shared by loading, loaded and Suspense.
  • Tool-openable singletons stay in the View with their eligibility. User tabs move into the panel.
  • Result: about 340 lines and 22 props in the View.
  • Strength: smallest conceptual change, and every PR is independently safe.
  • Weakness:
    • Tab state is split between the View and the panel, so the archived rule lives in both.
    • Singleton eligibility stays in the page, against "features own eligibility".
    • Preview still needs about 8 touch points.
    • Hiding the chat column relies on a CSS :has data-attribute coupling.

Design B: Layout shell with slots (dissolve the View)

  • Delete AgentChatPageView. One AgentChatPageShell (about 140 lines) with topBar, notices, main, composer and rightPanel slots renders every state: loading, loaded, error, not-found and Suspense.
  • AgentChatPage composes the leaves directly, so no prop passes through a non-reader.
  • ChatRightPanel owns all tab state. Tools reach it through an imperative ref.open(target).
  • Strength:
    • Removes all three layout copies and the whole relay.
    • The shell keeps one top-bar and panel instance from loading to loaded.
  • Weakness:
    • The Page stays about 750 lines and becomes the composition root.
    • The imperative handle raises lifecycle questions, such as a tool firing before the panel mounts.
    • The shell must stay light because the router imports it eagerly.
    • The largest story churn of the three (66 View stories are redistributed).

Design C: Feature-owned tabs

  • SidebarTabView computes { isActive, isShown, isExpanded } once and calls tab.render(view).
  • Each feature is a module that owns its label, eligibility, selection, persistence and transcript opener context: Debug, Browser, Desktop, workspace tabs, and later Preview.
  • A registry hook lists the features. Persistence goes through one archived-aware helper.
  • The built-in Terminal becomes a seeded tab (storage migration with a legacy read). The pending terminal is deleted.
  • Result: about 190 lines and 14 props in the View. Preview is one module plus one line.
  • Strength: matches "features own eligibility and selection, the page owns activation". Fixes visibility drift structurally.
  • Weakness:
    • It is a small framework: feature type, registry, useSingletonTab, reduceRight provider nesting, hooks returning render closures.
    • It needs a storage migration, and features would share one singleton key with read-modify-write.
    • Deleting the pending terminal is an unmeasured UX bet.

Comparison

A B C
Pass-through contracts removed Most All Most
Duplicated decisions removed Most, except split tab ownership Most All
New abstractions 2 components Shell, panel, imperative handle Feature type, registry, 2 helpers
Touch points for a Preview-like tab About 8 About 6 (all inside the panel) 2
Storage migration No No Yes
Fit with your preferences Strong on "no controllers", weak on "features own eligibility" Mixed (ref handle, Page grows) Strong on ownership, weak on "no new controllers"
Migration risk Low Medium to high Medium

5. Recommendation: A's cleanup, then decide on C's ownership principle (without its framework)

Measure progress by contracts, duplicated decisions and effects removed, not by the View's line count.

Stage 1: design-agnostic cleanup (all three designs agree). Each item is an independent PR.

  1. Delete the dead code: unreachable UserTabContent fallbacks, repeated support checks, aliases, no-op classes, unused test id, inner keys, the redundant read-only gating term.
  2. Move leaf-only values into their consumers:
    • license values into QueuedForCapacityCallout
    • sshCommand into WorkspacePill
    • the timeline anchor into ChatPageTimeline
    • ChatWorkspaceContext around the timeline only
  3. Rebase refactor(site/src/pages/AgentsPage): move chat pages to ChatComposer #30638 onto the post-refactor(site): organize agent pages into route folders #31142 paths: the composer becomes a node, ChatPageInput owns its read-only presentation and attachedWorkspace, and the Page gates the turn-action handlers. Making the timeline a node too is a separate, optional PR.
  4. RightPanel owns the expansion gate and the live drag value. This deletes the View-level relay. Needs a manual drag check.
  5. SidebarTabView computes "shown" once and hands it to each panel. This fixes the Desktop, Browser and app-tab inconsistency.
  6. One save path per persisted value, covering every mutation path, with the archived rule written once. Render the built-in Terminal through the normal terminal path (synthesized, no migration). Add the missing Vitest coverage for terminal add and numbering, close and reopen, dedupe, and the archived rule.

Stage 2: reassess. After Stage 1 the View is mostly a list of regions plus tab activation. Two choices:

  • (a) Keep the tab model in the View as the single authority, and move only content rendering into a right-panel component. This is the small, A-shaped option.
  • (b) Share one layout between the loaded, loading and Suspense states. Adopt this only if it doesn't need B's imperative handle.

Stage 3, only if Preview still hurts: apply C's principle at the smallest scale.

  • Each tab-owning feature exposes its tab, menu toggle and opener from its own module.
  • The View lists the features explicitly. No registry hook, no reduceRight, no storage migration, no shared read-modify-write keys.
  • Preview's selection, reload and archived handling move into the Preview feature. Its auto-open must not be a page-level handled-ID effect.

Not recommended for now: B's imperative ref, C's registry and seeded-terminal migration, and any new controller or provider around the whole page.

6. Decisions needed from you

  1. Pending terminal: delete it after a quick visual check (it caps at 100 ms), or keep it inside the terminal tab code?
  2. Archived chats you own: should they stop offering "Edit message"? Today the composer is hidden but edit is offered.
  3. Singleton order: unify on one list? Today the tab bar and the menu disagree.
  4. Sequencing with your stacks: land Stage 1 before or after Preview feat(site): add a Preview tab for open_preview #31286, and revive the composer stack (refactor(site/src/pages/AgentsPage): move chat pages to ChatComposer #30638) now?

7. Risks to validate during implementation

  • Tool-opened tabs while the panel is hidden or narrow-suppressed.
  • Restoring saved tabs, eligibility changes (app or port disappears, then returns), and the archived rule.
  • Read-only submission. Permission checks stay at the mutation boundaries.
  • Live drag-to-expand and drag-to-close after the relay moves into RightPanel.
  • Loading-to-loaded draft survival, and the embed route at narrow widths.

…ebarTab children

SidebarTabView now takes <SidebarTab> children and owns the effective
tab and close-to-neighbor selection. Each SidebarTab provides its
active, panel-open and expanded state through useSidebarTab(), so each
panel derives its own visibility flags with its existing rules instead
of AgentChatPageView computing per-panel props.

AppPanel wraps WorkspaceAppFrame for the Browser and workspace app
tabs, and UserTabPanel replaces the inline UserTabContent. The built-in
Terminal renders as the first user terminal tab.

Behavior is unchanged.

@DanielleMaywood DanielleMaywood left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This review was performed by ai-review, an automated review bot.

2 inline findings.

Coverage
Coverage: 17 of 17 files reviewed; 35 rules.
Candidates: 179 found, 160 outside changed lines, 0 already discussed, 19 evaluated.
Findings: 2 (8 sites, 0 pre-existing sites), 0 over budget, 0 failed.
Model: deepseek/deepseek-v4.1-flash; 19 questions, 19 answered, 0 abstained, 0 cached; 0 uncalibrated findings held back; 18823 input and 7464 output tokens.

@DanielleMaywood

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-30T11:02:22.318375Z b7d1131 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b7d11318ba

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@DanielleMaywood
DanielleMaywood marked this pull request as ready for review October 30, 2026 11:00
@DanielleMaywood DanielleMaywood assigned Copilot and unassigned Copilot Oct 30, 2026
@DanielleMaywood
DanielleMaywood requested a review from a team as a code owner October 30, 2026 11:00
@pr-queue-manager
pr-queue-manager Bot requested a review from jaaydenh November 2, 2026 08:17
Comment on lines +43 to +48
type TabPanelState = {
isActive: boolean;
/** Whether the right panel is open, regardless of the active tab. */
isPanelOpen: boolean;
isExpanded: boolean;
};

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.

The "is this panel visible?" rule now lives in each panel. isPanelOpen && isActive is repeated in ChatSummaryPanel, DebugPanel and TerminalPanel, while DesktopPanel and AppPanel check isActive alone, with nothing saying that difference is intentional. The design doc names "the flags disagree" as a root cause, and spreading the rule over five files makes that disagreement harder to spot and easy to copy wrong in the next panel.

Suggestion: derive it once here.

type TabPanelState = {
	isActive: boolean;
	/** Whether the right panel is open, regardless of the active tab. */
	isPanelOpen: boolean;
	isExpanded: boolean;
	/** The right panel is open and this tab is active. */
	isVisible: boolean;
};

Compute it in SidebarTab (and the default context value), then have Summary, Debug and Terminal read isVisible instead of re-deriving it. Where a panel deliberately uses isActive alone (Desktop, AppPanel), a one-line comment saying why would keep it from looking like a bug.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Note

This reply was generated by Coder Agents on behalf of @DanielleMaywood.

Thanks, the repetition is real, but I'm keeping this PR as is:

  • isVisible would not replace anything. TerminalPanel's isHot is isPanelOpen && (isActive || isPending), so isPanelOpen has to stay in the state. Adding isVisible gives three fields where one is derived from the other two, to save two one-line derivations (Summary and Debug).
  • There is no "why" to write for Desktop and AppPanel. History shows Desktop's isActive-only gate was never a decision: it came in fix(site): delay desktop VNC connection until tab is selected #23861, when SidebarTabView had no panel-open input at all, and was never revisited while Summary and Debug later gated on the panel being open. Today that means Desktop activates VNC and keeps its zoom shortcuts registered while the panel is closed, which looks like a latent bug. AppPanel's active only toggles flex/hidden, so panel-open makes no difference there, but that is also not recorded intent. A rationale comment would be invented.

This PR is a behavior-preserving refactor, so it keeps each panel's existing rule. Making Desktop respect the panel being closed changes behavior and belongs in a separate PR, where unifying the rule is the natural place to do it.

Comment on lines +279 to +282
const nextActiveTabId =
effectiveTabId === tabId
? remainingTabIds[Math.min(closedTabIndex, remainingTabIds.length - 1)]
: undefined;

@jakehwll jakehwll Nov 4, 2026 •

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.

ugh, number indexes

@jakehwll jakehwll 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 🚀

…-in-terminal-tab

# Conflicts:
#	site/src/pages/AgentsPage/AgentChatPage/AgentChatPageView.tsx
@DanielleMaywood
DanielleMaywood enabled auto-merge (squash) November 5, 2026 09:23
@DanielleMaywood
DanielleMaywood merged commit f132e49 into main Nov 5, 2026
27 of 28 checks passed
@DanielleMaywood
DanielleMaywood deleted the refactor/agents-built-in-terminal-tab branch November 5, 2026 09:31
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 5, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants