Repository navigation
refactor(site): separate AgentsPage and AgentDetail into container/view pairs - #22812
Merged
Merged
Conversation
DanielleMaywood
force-pushed
the
agents-fix-issue-1
branch
7 times, most recently
from
March 9, 2026 22:24
0ea30e0 to
f157470
Compare
DanielleMaywood
marked this pull request as ready for review
March 9, 2026 22:36
…ew pairs Splits the two largest AgentsPage files into container/view pairs following the established project convention (e.g. WorkspacesPage/WorkspacesPageView). - AgentsPage.tsx → container (AgentsPage.tsx) + view (AgentsPageView.tsx) - AgentDetail.tsx → container (AgentDetail.tsx) + view (AgentDetailView.tsx) Containers handle data fetching, hooks, state, and error/loading guards. Views are pure rendering components that receive all data as props. All existing named exports remain importable from their original paths.
Add full coverage stories for AgentDetailView, AgentDetailLoadingView, and AgentDetailNotFoundView. Export AgentDetailTimeline and AgentDetailInput from AgentDetail.tsx so stories use the real components instead of stubs.
…nd internalizing UI state - AgentsPageView: remove 4 props duplicated between direct props and outletContext (chatErrorReasons, requestArchiveAgent, requestUnarchiveAgent, requestArchiveAndDeleteWorkspace); View now destructures them from outletContext. - AgentDetailView: move 6 panel/sidebar UI state props into the View as local useState (showSidebarPanel, isRightPanelExpanded, dragVisualExpanded and their setters); derive hasDiffStatus and hasGitRepos from existing props instead of receiving them. - Move auto-open sidebar logic into the View alongside the state it mutates. - Update stories to match reduced prop interfaces.
DanielleMaywood
force-pushed
the
agents-fix-issue-1
branch
from
March 10, 2026 11:56
780c21c to
cb0b00a
Compare
DanielleMaywood
force-pushed
the
agents-fix-issue-1
branch
from
March 10, 2026 12:00
cb0b00a to
0d61029
Compare
kylecarbs
approved these changes
Mar 10, 2026
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Summary
Splits the two largest AgentsPage files into container/view pairs following the established project convention (e.g.
WorkspacesPage/WorkspacesPageView,UsersPage/UsersPageView), then simplifies the resulting View components.Changes
Container/View split
AgentsPage.tsx→ container (AgentsPage.tsx) + view (AgentsPageView.tsx)AgentDetail.tsx→ container (AgentDetail.tsx) + view (AgentDetailView.tsx)Containers handle data fetching, mutations, and routing. Views are presentational components that receive data as props.
View simplification
AgentsPageView (18 → 14 props):
outletContext.emptyStateNode: ReactNoderender prop — View now rendersAgentCreateFormdirectly from data props.toolbarEndContent: ReactNoderender prop withisAgentsAdminflag — View owns the Admin button.isConfigureAgentsDialogOpen) moved into the View since both consumers (toolbar button, create form) are now rendered there.AgentDetailView (53 → 43 props):
AgentDetailTimelineandAgentDetailInputcomponent props — View imports them directly.showSidebarPanel,isRightPanelExpanded,dragVisualExpanded) asuseStateinside the View.hasDiffStatusandhasGitReposfrom data the View already receives.AgentDetail container:
useOutletContextas non-optional (always rendered as child route ofAgentsPage) — eliminated 5 module-level noop fallback constants and all??defensive access.Other fixes
chatsLoadErrorprop type changed fromError | undefinedtoError | nullto match TanStack Query convention, removing a redundant ternary.[&_[cmdk-item]]underscore escape that was broken by auto-format (underscore is Tailwind's space escape in arbitrary selectors).AgentsEmptyState→AgentCreateForm(it's a full chat creation form, not an empty state placeholder).Storybook
AgentDetailView(loaded, loading, not-found states).AgentsPageView.AgentsEmptyState.stories.tsx→AgentCreateForm.stories.tsx.All existing named exports remain importable from their original paths.