fix(native-chat): place effort after model picker

This commit is contained in:
Merge Sim
2026-09-08 10:33:21 -07:00
parent bba68b1bdd
commit d6632351ef
2 changed files with 37 additions and 27 deletions
@@ -220,7 +220,12 @@ describe('NativeChatSessionOptionPickers', () => {
/>
)
await waitFor(() =>
expect(screen.getAllByTestId('dropdown-root')[1]?.getAttribute('data-open')).toBe('true')
expect(
screen
.getByRole('button', { name: 'Model Opus 4.8' })
.closest('[data-testid="dropdown-root"]')
?.getAttribute('data-open')
).toBe('true')
)
rerender(
@@ -232,7 +237,12 @@ describe('NativeChatSessionOptionPickers', () => {
/>
)
await waitFor(() =>
expect(screen.getAllByTestId('dropdown-root')[0]?.getAttribute('data-open')).toBe('true')
expect(
screen
.getByRole('button', { name: 'Effort High' })
.closest('[data-testid="dropdown-root"]')
?.getAttribute('data-open')
).toBe('true')
)
})
@@ -270,8 +280,8 @@ describe('NativeChatSessionOptionPickers', () => {
)
expect(
screen
.getByRole('button', { name: 'Effort High · Fast' })
.compareDocumentPosition(screen.getByRole('button', { name: 'Model Opus 4.8' })) &
.getByRole('button', { name: 'Model Opus 4.8' })
.compareDocumentPosition(screen.getByRole('button', { name: 'Effort High · Fast' })) &
Node.DOCUMENT_POSITION_FOLLOWING
).not.toBe(0)
@@ -241,6 +241,29 @@ function NativeChatSessionOptionPickersInner({
return (
<div className="flex min-w-0 items-center gap-0.5">
<DropdownMenu
key={`model:${requestedModelSequence ?? 'idle'}`}
defaultOpen={requestedModelSequence !== null}
>
<PickerTrigger
label={nativeChatModelPillLabel(model)}
tooltipLabel={modelTooltip}
disabled={isWorking || pendingId !== null}
disabledReason={modelReason}
dispatched={sessionOptionDispatchUnconfirmed(model)}
/>
<DropdownMenuContent align="start" side="top" collisionPadding={8} className="w-64">
{modelReason && !model.settable ? (
<DropdownMenuLabel className="font-normal">{modelReason}</DropdownMenuLabel>
) : null}
<DescriptorMenuRows
descriptor={model}
pending={pendingId !== null}
setValue={(value) => setOption(model, value)}
invokeAction={() => invokeAction(model)}
/>
</DropdownMenuContent>
</DropdownMenu>
{options.length > 0 ? (
<DropdownMenu
key={`options:${requestedOptionsSequence ?? 'idle'}`}
@@ -275,29 +298,6 @@ function NativeChatSessionOptionPickersInner({
</DropdownMenuContent>
</DropdownMenu>
) : null}
<DropdownMenu
key={`model:${requestedModelSequence ?? 'idle'}`}
defaultOpen={requestedModelSequence !== null}
>
<PickerTrigger
label={nativeChatModelPillLabel(model)}
tooltipLabel={modelTooltip}
disabled={isWorking || pendingId !== null}
disabledReason={modelReason}
dispatched={sessionOptionDispatchUnconfirmed(model)}
/>
<DropdownMenuContent align="start" side="top" collisionPadding={8} className="w-64">
{modelReason && !model.settable ? (
<DropdownMenuLabel className="font-normal">{modelReason}</DropdownMenuLabel>
) : null}
<DescriptorMenuRows
descriptor={model}
pending={pendingId !== null}
setValue={(value) => setOption(model, value)}
invokeAction={() => invokeAction(model)}
/>
</DropdownMenuContent>
</DropdownMenu>
</div>
)
}