diff --git a/studio/frontend/src/app/provider.tsx b/studio/frontend/src/app/provider.tsx index 8abb1df63e..1cc3d1ee57 100644 --- a/studio/frontend/src/app/provider.tsx +++ b/studio/frontend/src/app/provider.tsx @@ -255,7 +255,7 @@ const MAC_NATIVE_CHROME_STYLE = { "--studio-non-chat-content-top-inset": "34px", "--studio-hidden-route-top-inset": "34px", "--studio-chat-header-height": "44px", - "--studio-chat-header-padding-top": "8px", + "--studio-chat-header-padding-top": "7px", "--studio-chat-control-height": "33px", "--studio-chat-header-right-inset": "0px", } as CSSProperties; diff --git a/studio/frontend/src/components/app-sidebar.tsx b/studio/frontend/src/components/app-sidebar.tsx index 8aa4db99f4..d263a6a739 100644 --- a/studio/frontend/src/components/app-sidebar.tsx +++ b/studio/frontend/src/components/app-sidebar.tsx @@ -1183,7 +1183,11 @@ export function AppSidebar() { )}
-
+
{/* Portaled surfaces render to document.body, escaping the parent's hidden wrapper, so gate them on `active` to keep them off other tabs. */} {active && } diff --git a/tests/studio/test_desktop_reliability_frontend_contract.py b/tests/studio/test_desktop_reliability_frontend_contract.py index a576e3fe42..4848a82535 100644 --- a/tests/studio/test_desktop_reliability_frontend_contract.py +++ b/tests/studio/test_desktop_reliability_frontend_contract.py @@ -28,6 +28,7 @@ APP_PROVIDER = FRONTEND / "app/provider.tsx" CLIPBOARD_FILES = FRONTEND / "features/chat/utils/clipboard-files.ts" TAURI_CAPABILITIES = REPO / "studio/src-tauri/capabilities/default.json" +CHAT_PAGE = FRONTEND / "features/chat/chat-page.tsx" def test_file_actions_route_through_native_commands_only_in_tauri(): @@ -216,6 +217,34 @@ def test_expanded_titlebar_button_and_corner_match_sidebar_edge(): ) +def test_visible_mac_sidebar_header_is_a_drag_region(): + source = APP_SIDEBAR.read_text(encoding = "utf-8") + header = source.split("", 1)[0] + drag_region = "data-tauri-drag-region={usesNativeMacTitlebar || undefined}" + + assert drag_region in header + assert header.index(drag_region) < header.index('"relative z-10 flex items-center') + + +def test_mac_chat_header_controls_share_the_titlebar_row(): + source = CHAT_PAGE.read_text(encoding = "utf-8") + provider = APP_PROVIDER.read_text(encoding = "utf-8") + + assert "shouldUseNativeMacWindowTitlebar" not in source + assert "[--studio-content-top-inset:var(--studio-mac-titlebar-height" not in source + assert source.count("var(--studio-mac-traffic-light-inset") == 2 + assert '"--studio-chat-header-padding-top": "7px"' in provider + assert "pt-[var(--studio-content-top-inset,0px)] md:flex-row" in source + assert "absolute top-[var(--studio-content-top-inset,0px)]" in source + + +def test_collapsed_mac_sidebar_hides_divider(): + source = APP_SIDEBAR.read_text(encoding = "utf-8") + + assert "group-data-[collapsible=icon]:[&_[data-sidebar=sidebar]]:border-r-0" in source + assert "top-[var(--studio-mac-titlebar-height,34px)]" not in source + + def test_chat_sidebar_row_actions_visible_on_coarse_pointers(): """unslothai/unsloth#7276: Recents chat kebab must be tappable on iPad.""" sidebar_source = APP_SIDEBAR.read_text(encoding = "utf-8")