Skip to content

refactor: updates prompt model parameters UI#2548

Merged
akshaydeo merged 1 commit intov1.5.0from
04-07-refactor_updates_prompt_model_parameters_ui
Apr 16, 2026
Merged

refactor: updates prompt model parameters UI#2548
akshaydeo merged 1 commit intov1.5.0from
04-07-refactor_updates_prompt_model_parameters_ui

Conversation

@roroghost17
Copy link
Copy Markdown
Contributor

@roroghost17 roroghost17 commented Apr 7, 2026

Summary

Refactored the prompt settings panel to use an accordion layout, separating configuration and deployments into collapsible sections for improved organization and space utilization.

Changes

  • Converted the settings panel from a scrollable layout to an accordion-based interface with "Configuration" and "Deployments" sections
  • Added PromptDeploymentsAccordionItem component to handle the deployments section within the accordion
  • Enhanced the AccordionContent component with a containerClassName prop for better layout control
  • Modified PromptDeploymentView to accept an optional omitTitle prop for cleaner integration
  • Improved accordion trigger styling for better alignment and spacing

Type of change

  • Bug fix
  • Feature
  • Refactor
  • Documentation
  • Chore/CI

Affected areas

  • Core (Go)
  • Transports (HTTP)
  • Providers/Integrations
  • Plugins
  • UI (Next.js)
  • Docs

How to test

Validate the accordion functionality and layout in the prompt settings panel:

  1. Navigate to the prompts interface
  2. Select a prompt to view the settings panel
  3. Verify the "Configuration" section expands/collapses properly
  4. Verify the "Deployments" section appears when a prompt is selected
  5. Test that only one section can be open at a time
  6. Ensure all existing functionality (provider selection, model parameters, etc.) works within the accordion
# UI
cd ui
pnpm i || npm i
pnpm test || npm test
pnpm build || npm run build

Screenshots/Recordings

If UI changes, add before/after screenshots or short clips.

Breaking changes

  • Yes
  • No

Related issues

Link related issues and discussions. Example: Closes #123

Security considerations

No security implications - this is a UI layout refactor that doesn't affect authentication, data handling, or API interactions.

Checklist

  • I read docs/contributing/README.md and followed the guidelines
  • I added/updated tests where appropriate
  • I updated documentation where needed
  • I verified builds succeed (Go and UI)
  • I verified the CI pipeline passes locally if applicable

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 7, 2026

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Added accordion-based layout to settings panel with collapsible sections for better content organization.
  • UI Improvements

    • Updated accordion component styling with refined trigger alignment and transitions.
    • Enhanced accordion component to support customizable container styling.
    • Improved settings panel organization with conditional section rendering.

Walkthrough

The PR restructures prompt deployment UI components by introducing an accordion-based layout. A new PromptDeploymentsAccordionItem component displays deployments as an accordion section. The PromptDeploymentView now accepts optional parameters, the settings panel switches from ScrollArea to Accordion layout, and the base Accordion component gains enhanced styling and a containerClassName prop. One import reorganization in routingRuleSheet.tsx contains no functional changes.

Changes

Cohort / File(s) Summary
Prompt Deployment Components
ui/app/_fallbacks/enterprise/components/prompt-deployments/promptDeploymentView.tsx, ui/app/_fallbacks/enterprise/components/prompt-deployments/promptDeploymentsAccordionItem.tsx
Updated PromptDeploymentView signature to accept optional { omitTitle?: boolean } parameter. Added new PromptDeploymentsAccordionItem client component that renders deployments within an accordion section, consuming selectedPromptId from context and managing open/closed state based on activeSection.
Settings Panel Integration
ui/components/prompts/fragments/settingsPanel.tsx
Replaced ScrollArea-based layout with Accordion-based layout. Integrated PromptDeploymentsAccordionItem when a prompt is selected. Added openSection state to track which section ("parameters" or "deployments") is expanded and conditionally render accordion content.
UI Component Enhancement
ui/components/ui/accordion.tsx
Updated AccordionTrigger layout with w-full min-w-0, changed alignment to items-center, and replaced transition-all with transition-colors. Extended AccordionContent function signature to accept optional containerClassName prop merged onto the outer container element.
Routing Rules
ui/app/workspace/routing-rules/views/routingRuleSheet.tsx
Reorganized import statements with no functional changes to component logic, state management, validation, or control flow.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 Hops of joy, accordion springs!
A new deployment section brings,
UI blooms in structured grace,
Components find their perfect place.
With scrolls replaced by folds so neat,
The UI's rhythm now complete! 🎵

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR's accordion UI refactor does not relate to the linked issue #123 about Files API support for providers like OpenAI or Anthropic. Either link relevant issues related to prompt settings UI improvements or clarify why #123 is linked if Files API work is separate from this PR's scope.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: refactoring the prompt model parameters UI with an accordion layout.
Description check ✅ Passed The description is comprehensive, covering summary, changes, type of change, affected areas, testing instructions, and other required sections.
Out of Scope Changes check ✅ Passed All changes are focused on refactoring the prompt settings panel UI to use an accordion layout with proper component modifications.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 04-07-refactor_updates_prompt_model_parameters_ui

Comment @coderabbitai help to get the list of available commands and usage tips.

@roroghost17 roroghost17 force-pushed the 04-07-feat_updates_prompts_plugin_flow branch from 5f923f9 to face6b2 Compare April 7, 2026 14:20
@roroghost17 roroghost17 force-pushed the 04-07-refactor_updates_prompt_model_parameters_ui branch 2 times, most recently from 77478f2 to f5f03a7 Compare April 7, 2026 14:22
@roroghost17 roroghost17 force-pushed the 04-07-feat_updates_prompts_plugin_flow branch from face6b2 to 44734e7 Compare April 7, 2026 14:22
@roroghost17 roroghost17 force-pushed the 04-07-refactor_updates_prompt_model_parameters_ui branch from f5f03a7 to c1cd6b8 Compare April 7, 2026 19:50
@roroghost17 roroghost17 force-pushed the 04-07-feat_updates_prompts_plugin_flow branch from 44734e7 to 369f154 Compare April 7, 2026 19:50
@roroghost17 roroghost17 force-pushed the 04-07-refactor_updates_prompt_model_parameters_ui branch from c1cd6b8 to 729fa28 Compare April 9, 2026 13:20
@roroghost17 roroghost17 force-pushed the 04-07-feat_updates_prompts_plugin_flow branch from 369f154 to 56330d2 Compare April 9, 2026 13:20
@roroghost17 roroghost17 force-pushed the 04-07-refactor_updates_prompt_model_parameters_ui branch from 729fa28 to bf18504 Compare April 9, 2026 13:22
@roroghost17 roroghost17 force-pushed the 04-07-feat_updates_prompts_plugin_flow branch from 56330d2 to 548ddba Compare April 9, 2026 13:22
@roroghost17 roroghost17 force-pushed the 04-07-refactor_updates_prompt_model_parameters_ui branch from bf18504 to 36cfa1c Compare April 10, 2026 06:55
@roroghost17 roroghost17 force-pushed the 04-07-feat_updates_prompts_plugin_flow branch 2 times, most recently from 4f1cda0 to 5c75f3d Compare April 10, 2026 07:03
@roroghost17 roroghost17 force-pushed the 04-07-refactor_updates_prompt_model_parameters_ui branch from 36cfa1c to 32633c8 Compare April 10, 2026 07:03
@roroghost17 roroghost17 marked this pull request as ready for review April 10, 2026 07:24
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 10, 2026

Confidence Score: 4/5

Safe to merge after addressing the stale openSection state when a prompt is deselected.

One P1 issue: when openSection === "deployments" and the selected prompt is cleared, the panel renders in a degraded collapsed state. All other changes are clean and well-structured.

ui/components/prompts/fragments/settingsPanel.tsx — needs a useEffect to reset openSection to "parameters" when selectedPromptId is cleared while "deployments" is active.

Important Files Changed

Filename Overview
ui/components/prompts/fragments/settingsPanel.tsx New accordion layout; openSection can get stuck on "deployments" when a prompt is deselected, collapsing the Configuration section without resetting state.
ui/components/ui/accordion.tsx Added containerClassName prop to AccordionContent for applying classes to the outer Radix wrapper; clean, minimal, well-documented change.
ui/app/_fallbacks/enterprise/components/prompt-deployments/promptDeploymentsAccordionItem.tsx New accordion item component for the Deployments section; properly guarded by selectedPromptId and integrates cleanly with the parent accordion state.
ui/app/_fallbacks/enterprise/components/prompt-deployments/promptDeploymentView.tsx Added omitTitle prop to the function signature; prop is intentionally unused in the fallback (correct pattern for enterprise stubs).
ui/app/workspace/routing-rules/views/routingRuleSheet.tsx No functional changes visible in this file relative to the base commit; appears to be an incidental inclusion (likely reformatted).

Reviews (15): Last reviewed commit: "refactor: updates prompt model parameter..." | Re-trigger Greptile

Comment thread ui/components/ui/accordion.tsx
Comment thread ui/components/prompts/fragments/settingsPanel.tsx
Comment thread ui/components/prompts/fragments/settingsPanel.tsx
Copy link
Copy Markdown
Contributor Author

@coderabbitai full review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 12, 2026

✅ Actions performed

Full review triggered.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (1)
ui/components/prompts/fragments/settingsPanel.tsx (1)

122-123: Prefer reusing the shared section type to avoid drift.

SettingsSection duplicates SettingsSidebarSection from PromptDeploymentsAccordionItem. Reusing one type will keep this stack safer as sections evolve.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@ui/components/prompts/fragments/settingsPanel.tsx` around lines 122 - 123,
The local SettingsSection type duplicates PromptDeploymentsAccordionItem's
SettingsSidebarSection; remove the duplicate type and import/reuse
PromptDeploymentsAccordionItem's SettingsSidebarSection (or the shared exported
type if available), then update the useState generic and initial value to use
that imported type (e.g., useState<SettingsSidebarSection |
undefined>("parameters")). If the type isn't exported yet, export it from
PromptDeploymentsAccordionItem (or create a single shared type file) and update
both places to reference that shared symbol.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@ui/app/_fallbacks/enterprise/components/prompt-deployments/promptDeploymentsAccordionItem.tsx`:
- Around line 30-32: The new interactive AccordionTrigger for "Deployments" is
missing a stable test selector; update the AccordionTrigger element (the JSX
component named AccordionTrigger in promptDeploymentsAccordionItem.tsx) to
include a data-testid attribute following the project convention like
data-testid="prompt-deployments-trigger" (pattern:
<entity>-<element>-<qualifier>), ensuring the value uniquely identifies this
Deployments trigger for tests.

In
`@ui/app/_fallbacks/enterprise/components/prompt-deployments/promptDeploymentView.tsx`:
- Line 4: The omitTitle prop on PromptDeploymentView is declared but unused, so
passing omitTitle has no effect; update the PromptDeploymentView function to
accept and destructure the prop (omitTitle) and conditionally skip rendering the
title element (the JSX element that renders the deployment prompt title inside
PromptDeploymentView) when omitTitle is true—locate the title markup in
PromptDeploymentView and wrap it with a conditional that renders it only when
!omitTitle.

In `@ui/components/prompts/fragments/settingsPanel.tsx`:
- Around line 165-167: Add a stable test selector to the new accordion trigger
by adding a data-testid attribute to the AccordionTrigger element in
settingsPanel.tsx; set it to the project convention value (for example
"prompts-configuration-trigger") so the element can be reliably selected in
tests and QA.

---

Nitpick comments:
In `@ui/components/prompts/fragments/settingsPanel.tsx`:
- Around line 122-123: The local SettingsSection type duplicates
PromptDeploymentsAccordionItem's SettingsSidebarSection; remove the duplicate
type and import/reuse PromptDeploymentsAccordionItem's SettingsSidebarSection
(or the shared exported type if available), then update the useState generic and
initial value to use that imported type (e.g., useState<SettingsSidebarSection |
undefined>("parameters")). If the type isn't exported yet, export it from
PromptDeploymentsAccordionItem (or create a single shared type file) and update
both places to reference that shared symbol.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: efb40927-f5cf-4541-ab54-112de6fa5570

📥 Commits

Reviewing files that changed from the base of the PR and between 5c75f3d and 32633c8.

📒 Files selected for processing (5)
  • ui/app/_fallbacks/enterprise/components/prompt-deployments/promptDeploymentView.tsx
  • ui/app/_fallbacks/enterprise/components/prompt-deployments/promptDeploymentsAccordionItem.tsx
  • ui/app/workspace/routing-rules/views/routingRuleSheet.tsx
  • ui/components/prompts/fragments/settingsPanel.tsx
  • ui/components/ui/accordion.tsx

Comment thread ui/components/prompts/fragments/settingsPanel.tsx Outdated
@roroghost17 roroghost17 force-pushed the 04-07-feat_updates_prompts_plugin_flow branch from 5c75f3d to 26f752b Compare April 13, 2026 12:27
@roroghost17 roroghost17 force-pushed the 04-07-refactor_updates_prompt_model_parameters_ui branch from 32633c8 to 7dca2fa Compare April 13, 2026 12:27
@roroghost17 roroghost17 force-pushed the 04-07-refactor_updates_prompt_model_parameters_ui branch from e335344 to 43002ba Compare April 13, 2026 13:46
@roroghost17 roroghost17 force-pushed the 04-07-feat_updates_prompts_plugin_flow branch from 8b33aec to 014fd47 Compare April 13, 2026 13:46
@roroghost17 roroghost17 force-pushed the 04-07-refactor_updates_prompt_model_parameters_ui branch from 43002ba to e93673c Compare April 13, 2026 18:17
@roroghost17 roroghost17 force-pushed the 04-07-feat_updates_prompts_plugin_flow branch 2 times, most recently from 7eb2cbc to 7cd2a3d Compare April 13, 2026 19:15
@roroghost17 roroghost17 force-pushed the 04-07-refactor_updates_prompt_model_parameters_ui branch from e93673c to b837551 Compare April 13, 2026 19:15
@roroghost17 roroghost17 force-pushed the 04-07-feat_updates_prompts_plugin_flow branch from 7cd2a3d to fe6f971 Compare April 14, 2026 10:17
@roroghost17 roroghost17 force-pushed the 04-07-refactor_updates_prompt_model_parameters_ui branch 2 times, most recently from c1b9df5 to 58be647 Compare April 15, 2026 20:19
@roroghost17 roroghost17 force-pushed the 04-07-feat_updates_prompts_plugin_flow branch from fe6f971 to 272618a Compare April 15, 2026 20:19
@roroghost17 roroghost17 force-pushed the 04-07-refactor_updates_prompt_model_parameters_ui branch from 58be647 to 6b59828 Compare April 15, 2026 21:42
@roroghost17 roroghost17 force-pushed the 04-07-feat_updates_prompts_plugin_flow branch from 272618a to 53dd746 Compare April 15, 2026 21:42
@roroghost17 roroghost17 force-pushed the 04-07-refactor_updates_prompt_model_parameters_ui branch from 6b59828 to f13c53d Compare April 16, 2026 08:05
@roroghost17 roroghost17 force-pushed the 04-07-feat_updates_prompts_plugin_flow branch from 53dd746 to 29a6458 Compare April 16, 2026 08:05
@roroghost17 roroghost17 force-pushed the 04-07-feat_updates_prompts_plugin_flow branch from 29a6458 to 9cd0a3e Compare April 16, 2026 11:42
@roroghost17 roroghost17 force-pushed the 04-07-refactor_updates_prompt_model_parameters_ui branch 2 times, most recently from 31196ed to 7462cc9 Compare April 16, 2026 14:50
@roroghost17 roroghost17 force-pushed the 04-07-feat_updates_prompts_plugin_flow branch 2 times, most recently from 423ec88 to 944dd72 Compare April 16, 2026 15:52
@roroghost17 roroghost17 force-pushed the 04-07-refactor_updates_prompt_model_parameters_ui branch from 7462cc9 to 2a1ede0 Compare April 16, 2026 15:52
Copy link
Copy Markdown
Contributor

akshaydeo commented Apr 16, 2026

Merge activity

  • Apr 16, 4:34 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Apr 16, 4:42 PM UTC: Graphite rebased this pull request as part of a merge.
  • Apr 16, 4:43 PM UTC: @akshaydeo merged this pull request with Graphite.

@akshaydeo akshaydeo changed the base branch from 04-07-feat_updates_prompts_plugin_flow to graphite-base/2548 April 16, 2026 16:40
@akshaydeo akshaydeo changed the base branch from graphite-base/2548 to v1.5.0 April 16, 2026 16:41
@akshaydeo akshaydeo dismissed coderabbitai[bot]’s stale review April 16, 2026 16:41

The base branch was changed.

@akshaydeo akshaydeo force-pushed the 04-07-refactor_updates_prompt_model_parameters_ui branch from 2a1ede0 to f49aac1 Compare April 16, 2026 16:41
@akshaydeo akshaydeo merged commit a1680a6 into v1.5.0 Apr 16, 2026
9 of 15 checks passed
@akshaydeo akshaydeo deleted the 04-07-refactor_updates_prompt_model_parameters_ui branch April 16, 2026 16:43
Comment on lines 122 to +156
@@ -131,66 +140,98 @@ export function SettingsPanel() {
}

return (
<div className="flex h-full flex-col">
<ScrollArea className="grow overflow-y-auto" viewportClassName="no-table">
<div className="space-y-6 p-4">
<div className="flex flex-col gap-2" data-testid="settings-provider">
<Label className="text-muted-foreground text-xs font-medium uppercase">Provider</Label>
<ComboboxSelect
options={providerOptions}
value={provider}
onValueChange={(v) => v && onProviderChange(v)}
placeholder="Select provider"
hideClear
/>
</div>

<div className="flex flex-col gap-2" data-testid="settings-model">
<Label className="text-muted-foreground text-xs font-medium uppercase">Model</Label>
<ModelMultiselect
provider={provider}
keys={filterKeys && filterKeys.length > 0 ? filterKeys : undefined}
vks={filterVks}
value={model}
onChange={(v) => onModelChange(v)}
isSingleSelect
unfiltered
placeholder={!provider ? "Select a provider first" : "Select model"}
disabled={!provider}
/>
</div>

{(providerKeys.length > 0 || providerVirtualKeys.length > 0) && !!provider && (
<ApiKeySelectorView
providerKeys={providerKeys}
virtualKeys={providerVirtualKeys}
value={apiKeyId}
onValueChange={(v) => onApiKeyIdChange(v ?? "__auto__")}
disabled={!provider}
/>
)}

{Object.keys(variables).length > 0 && (
<>
<Separator />
<VariablesTableView variables={variables} onChange={setVariables} />
</>
)}

{model && (
<>
<Separator />

<div className="flex flex-col gap-4">
<Label className="text-muted-foreground text-xs font-medium uppercase">Model Parameters</Label>
<ModelParameters model={model} config={modelParams} onChange={handleModelParamsChange} hideFields={["promptTools"]} />
<div className="flex h-full min-h-0 flex-col">
<div className="flex min-h-0 flex-1 flex-col px-4 pb-4 pt-2">
<Accordion
type="single"
collapsible
value={openSection ?? ""}
onValueChange={(v) => {
if (v === "parameters" || v === "deployments") {
setOpenSection(v);
} else {
setOpenSection(undefined);
}
}}
className="flex min-h-0 flex-1 flex-col"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Stale openSection state when a prompt is deselected

When the user has the "Deployments" section active (openSection === "deployments") and then deselects the current prompt, selectedPromptId becomes falsy and PromptDeploymentsAccordionItem unmounts — but openSection stays "deployments". Because the AccordionItem for "Configuration" computes its className using openSection:

openSection === "parameters" ? "flex-1" : "shrink-0 overflow-hidden"

…it gets "shrink-0 overflow-hidden" even though nothing is actually open, leaving the panel showing only a shrunken collapsed trigger bar. The user has to manually click "Configuration" to restore a usable layout.

Consider resetting openSection back to "parameters" when selectedPromptId is cleared:

useEffect(() => {
  if (!selectedPromptId && openSection === "deployments") {
    setOpenSection("parameters");
  }
}, [selectedPromptId, openSection]);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants