mirror of
https://github.com/stablyai/orca.git
synced 2026-11-19 04:23:57 +00:00
fix(agent-picker): keep the Legacy models row last, expanding older models above it
This commit is contained in:
@@ -227,6 +227,7 @@ export function descriptorRowElements(
|
||||
...choices.filter((choice) => !choice.legacy).map(choiceRow),
|
||||
...(more.length > 0 && moreChoices
|
||||
? [
|
||||
...(moreChoices.shown ? more.map(choiceRow) : []),
|
||||
<ListRow
|
||||
key="more-choices"
|
||||
title={
|
||||
@@ -235,8 +236,7 @@ export function descriptorRowElements(
|
||||
: t('chat.sessionOptionRows.moreModels', 'More models')
|
||||
}
|
||||
onPress={moreChoices.onToggle}
|
||||
/>,
|
||||
...(moreChoices.shown ? more.map(choiceRow) : [])
|
||||
/>
|
||||
]
|
||||
: [])
|
||||
]
|
||||
|
||||
@@ -272,14 +272,14 @@ export function AgentLaunchSetupPanel({
|
||||
{/* One keyed array, so a row moving between sections keeps its highlight. */}
|
||||
{[
|
||||
...modelRows.rows.map(renderModelRow),
|
||||
...modelRows.legacyRows.map(renderModelRow),
|
||||
<AgentPickerLegacyModelsToggle
|
||||
key="legacy-toggle"
|
||||
total={modelRows.legacyCount}
|
||||
expanded={legacyExpanded}
|
||||
disabled={disabled}
|
||||
onToggle={toggleLegacy}
|
||||
/>,
|
||||
...modelRows.legacyRows.map(renderModelRow)
|
||||
/>
|
||||
]}
|
||||
</CommandGroup>
|
||||
</CommandList>
|
||||
|
||||
@@ -106,6 +106,7 @@ export function AgentChoiceMenu({
|
||||
<DropdownMenuContent align="start" collisionPadding={8} className="w-80">
|
||||
<DropdownMenuRadioGroup value={value}>
|
||||
{mainChoices.map(radioItem)}
|
||||
{shownLegacy.map(radioItem)}
|
||||
{legacyChoices.length > 0 ? (
|
||||
<DropdownMenuItem
|
||||
inset
|
||||
@@ -118,7 +119,6 @@ export function AgentChoiceMenu({
|
||||
{toggleBody}
|
||||
</DropdownMenuItem>
|
||||
) : null}
|
||||
{shownLegacy.map(radioItem)}
|
||||
</DropdownMenuRadioGroup>
|
||||
</DropdownMenuContent>
|
||||
</DropdownMenu>
|
||||
@@ -160,12 +160,12 @@ export function AgentChoiceMenu({
|
||||
<SourceControlActionOptionTrigger label={current} disabled={disabled} />
|
||||
<SelectContent>
|
||||
{mainChoices.map(selectItem)}
|
||||
{shownLegacy.map(selectItem)}
|
||||
{legacyChoices.length > 0 ? (
|
||||
<SelectItem value={LEGACY_TOGGLE} aria-expanded={legacyExpanded}>
|
||||
<span className="flex w-full min-w-0 items-center gap-2">{toggleBody}</span>
|
||||
</SelectItem>
|
||||
) : null}
|
||||
{shownLegacy.map(selectItem)}
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</SourceControlActionOptionField>
|
||||
|
||||
+2
-2
@@ -115,14 +115,14 @@ export function NativeChatModelCombobox({
|
||||
{/* One keyed array, so a row moving between sections keeps its highlight. */}
|
||||
{[
|
||||
...choices.filter((choice) => !folded(choice)).map(renderChoice),
|
||||
...(legacyExpanded ? legacyChoices.map(renderChoice) : []),
|
||||
<AgentPickerLegacyModelsToggle
|
||||
key="legacy-toggle"
|
||||
total={legacyChoices.length}
|
||||
expanded={legacyExpanded}
|
||||
selection="palette"
|
||||
onToggle={toggleLegacy}
|
||||
/>,
|
||||
...(legacyExpanded ? legacyChoices.map(renderChoice) : [])
|
||||
/>
|
||||
]}
|
||||
</CommandGroup>
|
||||
</NativeChatSessionOptionWriteGroup>
|
||||
|
||||
Reference in New Issue
Block a user