Skip to content

refactor(site/src/pages/AgentsPage): require always-passed sidebar props - #29889

Closed
DanielleMaywood wants to merge 1 commit into
mainfrom
nullability/sidebar
Closed

DanielleMaywood wants to merge 1 commit into
mainfrom
nullability/sidebar

Conversation

@DanielleMaywood

Copy link
Copy Markdown
Collaborator

AgentsPageLayout is the only production caller of ChatsSidebar, and it passes every callback and flag (onReorderPinnedAgent, onRenameTitle, onProposeTitle, chatPendingRename/onChatPendingRenameChange, onBeforeNewAgent, onRetryLoad, onLoadMore, onCollapse, hasNextPage, isFetchingNextPage, isLoading, isArchiving, isLoadingModelConfigs, canManageAgentSettings). ChatsSidebar passes them on to ChatsPanel, SettingsPanel, LoadMoreSentinel, RenameChatDialog and ChatSearchDialog, always with defined values. The same holds for SidebarTabView (chatTitle, onClose from AgentChatPageView), ChatSummary (isCostLoading, costError, isSubagent from ChatSummaryPanel) and ChatActionsMenuItems (isArchiving, isArchiveBlocked from ChatTreeNode and ChatTopBar). The optional types and their guards could never matter.

These props are now required and the dead guards and defaults are gone. The Search nav item and button, the collapse buttons, the Retry button, the mobile Close panel button and the rename dialog's Generate button now always render, which is what production already showed. ChatsSidebar no longer has its uncontrolled rename-dialog fallback, because the layout always owns that state. As a result ChatsPanel/ChatTreeContext onOpenRenameDialog became required as well.

Tests and stories now pass the required props. The ChatsSidebar stories keep rename state in a small wrapper, the way the layout does, so the rename stories still open the dialog. Some props stay optional on purpose: SidebarTabView keeps its chatTitle && check because an empty title should still hide the label. ChatActionsMenuItems.onOpenRenameDialog stays optional because ChatTopBar passes undefined for archived chats. The chatFamilyAllowsArchive/chatStatusAllowsArchive status params stay nullable (documented fail-open). getModelDisplayName.lastModelConfigID is left for the settings/misc cluster, which owns modelDisplayName.

Part of the AgentsPage nullability cleanup; see #29888 for the methodology. Dead slots in this cluster: 35 before, 1 after (the modelDisplayName slot above).

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

@DanielleMaywood
DanielleMaywood marked this pull request as ready for review September 25, 2026 10:55
@DanielleMaywood
DanielleMaywood requested a review from a team as a code owner September 25, 2026 10:55
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 25, 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-09-25T10:58:01.457015Z 8e30734 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.

@linear-code

linear-code Bot commented Sep 30, 2026

Copy link
Copy Markdown

CODAGT-1258

AgentsPageLayout is the only production caller of ChatsSidebar and
passes every callback and flag, and AgentChatPageView, ChatSummaryPanel,
ChatTreeNode and ChatTopBar do the same for SidebarTabView, ChatSummary
and ChatActionsMenuItems. The optional props and their guards were dead.

Make those props required and delete the guards and defaults. The
search, collapse, retry, close and title-generate controls now render
unconditionally, as they already did in production. ChatsSidebar drops
its uncontrolled rename-dialog fallback since the layout always owns
that state.

Tests and stories pass the now-required props; the ChatsSidebar stories
hold rename state in a small wrapper like the layout does.
@github-actions github-actions Bot added the stale This issue is like stale bread. label Oct 27, 2026
@github-actions github-actions Bot closed this Oct 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stale This issue is like stale bread.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant