feat(agents): unify settings dialog for users and admins#22914
Merged
feat(agents): unify settings dialog for users and admins#22914
Conversation
Refactor the admin-only Configure Agents dialog into a unified Settings dialog accessible to all users via a gear icon in the sidebar. Changes: - Add settings gear button to the bottom-left of the sidebar (next to user avatar) - Remove the admin-only "Admin" button from the top toolbar - Add "Custom Prompt" tab (always visible) for per-user instructions - Admin-only tabs (Providers, Models, Behavior) remain gated behind isAgentsAdmin - Wire up getUserChatCustomPrompt / updateUserChatCustomPrompt API methods and React Query hooks - Dialog defaults to the Custom Prompt tab on open - Rename dialog title from "Configure Agents" to "Settings"
70e5c60 to
7c913f8
Compare
Contributor
Documentation CheckUpdates Needed
Automated review via Coder Tasks |
- Add AdminBadge component with tooltip for content panel headers - Use plain ShieldIcon (no tooltip) in sidebar nav items - Render SectionHeader externally for Providers/Models with AdminBadge - Add AdminBadge to Behavior section header
…ontent panel - Wrap ShieldIcon in a <span> so TooltipTrigger asChild has a proper DOM element that can receive pointer/focus events. - Add [scrollbar-width:thin] and matching scrollbar-color to the content panel's overflow container.
- Remove separate "Behavior" sidebar tab; merge system prompt into
the "Prompts" tab below the user custom prompt, separated by an hr.
- System prompt section only renders when canSetSystemPrompt is true,
with AdminBadge inline next to the heading.
- Set delayDuration={0} on all TooltipProvider instances so shield
tooltips appear instantly on hover.
- Cap textareas at max-h-[240px] with thin scrollbar and minRows={4}
so both prompts fit comfortably without the panel overflowing.
- Update stories to reflect merged tab structure.
Add badge prop to SectionHeader that renders next to the h2 label. Switch Providers and Models headers from action to badge so the Admin pill sits right of the title.
…no resize
- Rename "Personal Prompt" → "Personal Instructions"
- Rename "System Prompt" → "System Instructions"
- Both textareas start at minRows={1} and auto-grow
- Placeholder: "Additional behavior, style, and tone preferences"
- Remove resize handle (resize-none)
…update system placeholder - Let react-textarea-autosize manage overflow internally so scrollbar hides when content does not exceed max-h-[240px]. - System instructions placeholder now reads "Additional behavior, style, and tone preferences for all users".
The react-textarea-autosize component sets overflow:hidden as an inline style during height measurement. Without overflow-y-auto to override it, content disappears when adding newlines before the height recalculates. Removed scrollbar-color (the explicit track/thumb colors were making the scrollbar always visually render). Kept scrollbar-width: thin so the scrollbar is unobtrusive when it does appear at max-height.
- Add mocks for getUserChatCustomPrompt and updateUserChatCustomPrompt - Update placeholder text to match new System Instructions textarea - Handle multiple Save buttons (personal + system forms)
mattvollmer
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
Refactors the admin-only "Configure Agents" dialog into a unified Settings dialog accessible to all users via a gear icon in the sidebar.
What changed
Settings gear in sidebar: A gear icon now appears in the bottom-left of the sidebar (next to the user avatar dropdown). Clicking it opens the Settings dialog. This replaces the admin-only "Admin" button that was in the top toolbar.
Custom Prompt tab (all users): A new "Custom Prompt" tab is always visible in the dialog. Users can write personal instructions that are applied to all their new chats (stored per-user via the
/api/experimental/chats/config/user-promptendpoint).Admin tabs remain gated: The Providers, Models, and Behavior (system prompt) tabs only appear for admin users, preserving the existing RBAC model.
API + query hooks: Added
getUserChatCustomPrompt/updateUserChatCustomPromptmethods to the TypeScript API client and corresponding React Query hooks.Files changed
site/src/api/api.tssite/src/api/queries/chats.tssite/src/pages/AgentsPage/ConfigureAgentsDialog.tsxsite/src/pages/AgentsPage/AgentsSidebar.tsxsite/src/pages/AgentsPage/AgentsPageView.tsxonOpenSettingsto sidebarsite/src/pages/AgentsPage/AgentsPage.tsx*.stories.tsx