diff --git a/src/renderer/src/components/native-chat/NativeChatSessionOptionPickers.test.tsx b/src/renderer/src/components/native-chat/NativeChatSessionOptionPickers.test.tsx
index e7d3eda0985..cc9963b94b2 100644
--- a/src/renderer/src/components/native-chat/NativeChatSessionOptionPickers.test.tsx
+++ b/src/renderer/src/components/native-chat/NativeChatSessionOptionPickers.test.tsx
@@ -40,7 +40,23 @@ vi.mock('@/components/ui/dropdown-menu', () => {
children: React.ReactNode
disabled?: boolean
}) =>
{children}
,
- DropdownMenuContent: ({ children }: { children: React.ReactNode }) => {children}
,
+ DropdownMenuContent: ({
+ children,
+ side,
+ collisionPadding
+ }: {
+ children: React.ReactNode
+ side?: string
+ collisionPadding?: number
+ }) => (
+
+ {children}
+
+ ),
DropdownMenuLabel: ({ children }: { children: React.ReactNode }) => {children}
,
DropdownMenuSeparator: () =>
,
DropdownMenuItem: ({
@@ -172,6 +188,23 @@ const fast: SessionOptionDescriptor = {
afterEach(() => cleanup())
describe('NativeChatSessionOptionPickers', () => {
+ it('prefers collision-aware upward placement for model and option menus', () => {
+ render(
+
+ )
+
+ const menus = screen.getAllByTestId('session-option-menu')
+ expect(menus).toHaveLength(2)
+ for (const menu of menus) {
+ expect(menu.getAttribute('data-side')).toBe('top')
+ expect(menu.getAttribute('data-collision-padding')).toBe('8')
+ }
+ })
+
it('renders model and joined option labels, and hides an empty options pill', () => {
const { rerender } = render(
descriptor.valueSource === 'dispatched')}
/>
-
+
{options.map((descriptor, index) => {
const reason = nativeChatSessionOptionDisabledReason(descriptor.disabledReason)
return (
@@ -272,7 +272,7 @@ function NativeChatSessionOptionPickersInner({
disabledReason={modelReason}
dispatched={model.valueSource === 'dispatched'}
/>
-
+
{modelReason && !model.settable ? (
{modelReason}
) : null}