Skip to content

🪞 fix: Match Prompt Cache TTL Control to Region Combobox Styling - #13839

Merged
danny-avila merged 1 commit into
devfrom
fix/prompt-cache-ttl-combobox
Jun 19, 2026
Merged

danny-avila merged 1 commit into
devfrom
fix/prompt-cache-ttl-combobox

Conversation

@danny-avila

Copy link
Copy Markdown
Collaborator

Summary

Follow-up to #13835. The Prompt Cache Duration control rendered with a different style than the rest of the parameters panel and shifted layout when opened.

Root cause: it used component: 'dropdown' → DynamicDropdown → SelectDropDown (headless-ui Listbox), whereas the sibling Region selector uses component: 'combobox' → DynamicCombobox → ControlCombobox (Ariakit). The two render differently:

dropdown (before) combobox (after, = Region)
Trigger style darker fill + chevron rounded, surface-secondary
Options inline Listbox + Transition → layout shift Ariakit.SelectPopover with portal → no shift
Custom-endpoint persist // TODO no-op (doesn't setOption) persists via setOption

Change

Switch both the Anthropic and Bedrock promptCacheTtl definitions from dropdown to combobox and rename placeholder/placeholderCode → selectPlaceholder/selectPlaceholderCode. Data-only change — the generic componentMapping already routes combobox to DynamicCombobox.

Bonus: because DynamicCombobox calls setOption unconditionally (unlike DynamicDropdown's custom branch), this also fixes the custom-endpoint persistence gap raised in the #13835 Codex review.

Notes

  • ControlCombobox always renders a search box, which is heavier than needed for two options (5m / 1h) but matches Region's behavior. Happy to add an optional showSearch prop to suppress it for short lists as a separate change if preferred.
  • default: undefined is preserved, so the SDK's 1h default still applies until the user picks a value.

Testing

  • data-provider build + parameterSettings/schemas specs (122) pass; lint clean.
  • Before/after: control now matches the Region selector's rounded trigger and opens in a portal popover (no layout shift).

The Prompt Cache Duration control used `component: 'dropdown'`
(DynamicDropdown → SelectDropDown), which renders with a different
trigger style than the sibling Region selector and expands its options
inline (headless-ui Listbox) — causing a visual mismatch and layout
shift in the parameters panel.

Switch both the Anthropic and Bedrock promptCacheTtl definitions to
`component: 'combobox'` (DynamicCombobox → ControlCombobox), the same
component Region uses: matching rounded trigger styling, an Ariakit
popover (portal, no layout shift), and — as a bonus — it persists
selections via setOption on custom endpoints (DynamicDropdown's custom
branch is a no-op TODO). Renames the placeholder fields to the
combobox's selectPlaceholder/selectPlaceholderCode.
@danny-avila danny-avila changed the title 💄 fix: Render promptCacheTtl as combobox to match Region styling fix: Render promptCacheTtl as combobox to match Region styling Jun 19, 2026
@danny-avila danny-avila changed the title fix: Render promptCacheTtl as combobox to match Region styling 🪞 fix: Match Prompt Cache TTL Control to Region Combobox Styling Jun 19, 2026
@danny-avila
danny-avila merged commit 2c6db6b into dev Jun 19, 2026
31 checks passed
@danny-avila
danny-avila deleted the fix/prompt-cache-ttl-combobox branch June 19, 2026 02:25
fuuuzzy pushed a commit to fuuuzzy/LibreChat that referenced this pull request Jul 7, 2026
…reChat-AI#13839)

The Prompt Cache Duration control used `component: 'dropdown'`
(DynamicDropdown → SelectDropDown), which renders with a different
trigger style than the sibling Region selector and expands its options
inline (headless-ui Listbox) — causing a visual mismatch and layout
shift in the parameters panel.

Switch both the Anthropic and Bedrock promptCacheTtl definitions to
`component: 'combobox'` (DynamicCombobox → ControlCombobox), the same
component Region uses: matching rounded trigger styling, an Ariakit
popover (portal, no layout shift), and — as a bonus — it persists
selections via setOption on custom endpoints (DynamicDropdown's custom
branch is a no-op TODO). Renames the placeholder fields to the
combobox's selectPlaceholder/selectPlaceholderCode.
ThomasVuNguyen pushed a commit to ThomasVuNguyen/LibreChat that referenced this pull request Jul 15, 2026
…reChat-AI#13839)

The Prompt Cache Duration control used `component: 'dropdown'`
(DynamicDropdown → SelectDropDown), which renders with a different
trigger style than the sibling Region selector and expands its options
inline (headless-ui Listbox) — causing a visual mismatch and layout
shift in the parameters panel.

Switch both the Anthropic and Bedrock promptCacheTtl definitions to
`component: 'combobox'` (DynamicCombobox → ControlCombobox), the same
component Region uses: matching rounded trigger styling, an Ariakit
popover (portal, no layout shift), and — as a bonus — it persists
selections via setOption on custom endpoints (DynamicDropdown's custom
branch is a no-op TODO). Renames the placeholder fields to the
combobox's selectPlaceholder/selectPlaceholderCode.
LogicalAbsurd pushed a commit to LogicalAbsurd/LibreChat that referenced this pull request Aug 27, 2026
…reChat-AI#13839)

The Prompt Cache Duration control used `component: 'dropdown'`
(DynamicDropdown → SelectDropDown), which renders with a different
trigger style than the sibling Region selector and expands its options
inline (headless-ui Listbox) — causing a visual mismatch and layout
shift in the parameters panel.

Switch both the Anthropic and Bedrock promptCacheTtl definitions to
`component: 'combobox'` (DynamicCombobox → ControlCombobox), the same
component Region uses: matching rounded trigger styling, an Ariakit
popover (portal, no layout shift), and — as a bonus — it persists
selections via setOption on custom endpoints (DynamicDropdown's custom
branch is a no-op TODO). Renames the placeholder fields to the
combobox's selectPlaceholder/selectPlaceholderCode.
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.

1 participant