refactor(site): restructure AgentsPage folder#23750
Closed
DanielleMaywood wants to merge 1 commit intomainfrom
Closed
refactor(site): restructure AgentsPage folder#23750DanielleMaywood wants to merge 1 commit intomainfrom
DanielleMaywood wants to merge 1 commit intomainfrom
Conversation
Restructure the AgentsPage directory for consistent conventions: Moves: - UserCompactionThresholdSettings → components/ - useAgentChime → utils/chime (pure functions, not a hook) - pasteHelpers.test.ts → ChatMessageInput/ (co-locate with source) - DateRangePicker/ + Calendar/ → site/src/components/ (shared) - ai-elements/ → ChatElements/ with PascalCase renames Splits: - AttachmentPreview + ImageThumbnail + UploadState from AgentChatInput - ContextUsageIndicator from AgentChatInput - ScrollAnchoredContainer from AgentDetailView - StreamingOutput from ConversationTimeline - useChatStore from ChatContext Settings page-per-tab: - Delete monolithic AgentSettingsPageView (1144 lines) - Rewrite AgentSettingsPage as layout with Outlet - Create 8 child route pages with lazy imports - Extract AdminBadge to shared component - Create PageView files for behavior, usage, templates tabs - Lift queries into pages, pass data as props Renames: - AgentDetail → AgentChatPage - components/AgentDetail/ → components/ChatConversation/ - TopBar → ChatTopBar (moved up, page chrome not conversation) - ChatContext → chatStore - AgentDetailView → AgentChatPageView - AgentDetailContent → ChatPageContent - AgentDetailSkeleton → AgentChatPageSkeleton - chatStore.test.ts → chatStore.createStore.test.ts
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.
Restructure
site/src/pages/AgentsPage/to enforce consistent conventions and improve maintainability.Changes
Moves
UserCompactionThresholdSettings+ stories →components/useAgentChime+ test →utils/chime(pure functions, not a hook)pasteHelpers.test.ts→ChatMessageInput/(co-locate with source)DateRangePicker/+Calendar/→site/src/components/(shared, used by TemplatePage)ai-elements/→ChatElements/with PascalCase renames,tool/→tools/Splits
AttachmentPreview+ImageThumbnail+UploadStateextracted fromAgentChatInput.tsxContextUsageIndicator+ ring constants + token helpers extracted fromAgentChatInput.tsxScrollAnchoredContainer+isNearBottom+SCROLL_THRESHOLDextracted fromAgentDetailView.tsxStreamingOutput+hasTransientLiveStatusextracted fromConversationTimeline.tsxuseChatStorehook + private helpers extracted fromChatContext.tsSettings page-per-tab extraction
AgentSettingsPageView.tsx(1144 lines)AgentSettingsPage.tsxas layout with<Outlet />AdminBadgeto shared componentPageViewfiles for behavior, usage, templates tabsRenames
AgentDetail→AgentChatPagecomponents/AgentDetail/→components/ChatConversation/TopBar→ChatTopBar(moved up one level, page chrome not conversation)ChatContext→chatStoreAgentDetailView→AgentChatPageViewAgentDetailContent→ChatPageContentAgentDetailSkeleton→AgentChatPageSkeletonchatStore.test.ts→chatStore.createStore.test.tsConfig updates
vite.config.mtsReact Compiler regex (ChatElements now inside AgentsPage)site/AGENTS.mdto reflect new pathsrouter.tsxwith lazy imports and nested settings routesAll 125 files changed, zero type errors (
pnpm checkclean).Implementation notes
git mvto preserve history (84 renames tracked by git)<RequirePermission isFeatureVisible={permissions.editDeploymentConfig}>saveSystemPromptMutation.mutate(...)) withMutationsuffixUserCompactionThresholdSettingsupdated to receive lifted query/mutation data as props