Repository navigation
feat(desktop): integrate the title bar into the sidebar top strip #5910
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
3bf418a
feat(desktop): integrate the title bar into the sidebar top strip
lidge-jun ee2f867
fix(desktop): write the collapsed flag outside the state updater
lidge-jun 7d64a1c
feat(desktop): single 40px title row; collapsed sidebar leaves the la…
lidge-jun 03deb68
fix(desktop): center the traffic lights on the shared row
lidge-jun 3e02302
fix(desktop): keep macOS titlebar clear at narrow widths and zoom
lidge-jun 4065a7b
fix(desktop): query only native window scale for titlebar clearance
lidge-jun da00f56
Merge branch 'dev' into devin/1790406915-integrated-titlebar
lidge-jun File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| { | ||
| "$schema": "../gen/schemas/desktop-schema.json", | ||
| "identifier": "dashboard-titlebar", | ||
| "description": "Integrated title bar: the loopback dashboard's top strips drag and double-click-zoom the main window", | ||
| "windows": ["main"], | ||
| "remote": { | ||
| "urls": ["http://127.0.0.1:*"] | ||
| }, | ||
| "permissions": [ | ||
| "core:window:allow-start-dragging", | ||
| "core:window:allow-toggle-maximize" | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| /* | ||
| Integrated title bar (Codex-style): the sidebar's top strip holds the window's traffic | ||
| lights and the collapse toggle; the main column's top strip carries the quota summary | ||
| on the same row. Desktop shell only moves the chrome — the strips render everywhere so | ||
| the collapse toggle exists in the plain browser dashboard too, where its drag wiring | ||
| is a no-op. | ||
|
|
||
| Sizes this file owns: | ||
| --titlebar-h strip height; the shell parks the traffic lights at y=16 inside it | ||
| --tl-inset macOS-only gap the lights occupy: 18px lead + 52px of lights + 10px air | ||
| --rail-w collapsed sidebar width | ||
| */ | ||
|
|
||
| .app { --titlebar-h: 44px; --tl-inset: 80px; --rail-w: 52px; } | ||
|
|
||
| .sidebar-top { | ||
| display: flex; | ||
| align-items: center; | ||
| height: var(--titlebar-h, 44px); | ||
| flex: 0 0 auto; | ||
| /* Bleed over the sidebar's own padding so the strip is edge-to-edge draggable. */ | ||
| margin: -18px -14px 0; | ||
| padding: 0 10px 0 14px; | ||
| user-select: none; | ||
| -webkit-user-select: none; | ||
| } | ||
|
|
||
| .app--macos .sidebar-top { | ||
| padding-left: var(--tl-inset, 80px); | ||
| } | ||
|
|
||
| .sidebar-collapse { | ||
| display: inline-flex; | ||
| align-items: center; | ||
| justify-content: center; | ||
| width: 28px; | ||
| height: 28px; | ||
| flex: 0 0 auto; | ||
| padding: 0; | ||
| border: none; | ||
| border-radius: var(--radius-sm); | ||
| background: none; | ||
| color: var(--muted); | ||
| cursor: pointer; | ||
| transition: background var(--motion-fast), color var(--motion-fast); | ||
| } | ||
| .sidebar-collapse:hover { background: var(--accent-soft); color: var(--text); } | ||
| .sidebar-collapse:focus-visible { outline: 2px solid var(--accent-ring); outline-offset: 2px; } | ||
| .sidebar-collapse svg { width: 18px; height: 18px; } | ||
|
|
||
| .main-top { | ||
| position: sticky; | ||
| top: 0; | ||
| z-index: var(--z-sticky); | ||
| display: flex; | ||
| align-items: stretch; | ||
| min-height: var(--titlebar-h, 44px); | ||
| background: var(--bg); | ||
| border-bottom: 1px solid var(--border); | ||
| user-select: none; | ||
| -webkit-user-select: none; | ||
| } | ||
| /* The quota bar fills the strip; its own border rides inside the strip's. */ | ||
| .main-top > .quota-summary-bar { | ||
| flex: 1 1 auto; | ||
| min-width: 0; | ||
| position: static; | ||
| border-bottom: none; | ||
| } | ||
|
|
||
| /* Collapsed rail: only the top strip survives — lights + toggle, exactly like Codex. */ | ||
| @media (min-width: 761px) { | ||
| .app { transition: grid-template-columns 160ms ease; } | ||
| /* Double class beats the base `.app` columns regardless of stylesheet order. */ | ||
| .app.app--nav-collapsed { grid-template-columns: var(--rail-w) 1fr; } | ||
| .app--nav-collapsed .sidebar > :not(.sidebar-top) { display: none; } | ||
| .app--nav-collapsed .sidebar-top { padding-left: 12px; } | ||
| .app--macos.app--nav-collapsed { --rail-w: 122px; } | ||
| .app--macos.app--nav-collapsed .sidebar-top { padding-left: var(--tl-inset, 80px); } | ||
| } | ||
|
|
||
| /* The mobile drawer keeps its own chrome; the strip would duplicate the drawer head. */ | ||
| @media (max-width: 760px) { | ||
| .sidebar-top { display: none; } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| /** | ||
| * The integrated title bar's two strips, laid out the way the Codex desktop app is: | ||
| * traffic lights live in the sidebar's top strip next to a collapse toggle, and the | ||
| * main column's top strip carries the quota summary on the same row. | ||
| * | ||
| * `SidebarTopStrip` is the sidebar's first child and the only child that survives a | ||
| * collapse; `MainTopStrip` wraps whatever sits at the top of `.main`. Both spread the | ||
| * window-chrome handlers, which no-op outside the desktop shell. | ||
| */ | ||
| import type { ReactNode } from "react"; | ||
| import { IconPanelLeft } from "../icons"; | ||
| import { useT } from "../i18n/shared"; | ||
| import { windowChromeHandlers } from "../lib/window-chrome"; | ||
| import "./app-titlebar.css"; | ||
|
|
||
| export function SidebarTopStrip({ collapsed, onToggle }: { collapsed: boolean; onToggle: () => void }) { | ||
| const t = useT(); | ||
| const label = collapsed ? t("nav.expandSidebar") : t("nav.collapseSidebar"); | ||
| return ( | ||
| <div className="sidebar-top" {...windowChromeHandlers()}> | ||
| <button | ||
| type="button" | ||
| className="sidebar-collapse" | ||
| onClick={onToggle} | ||
| aria-expanded={!collapsed} | ||
| aria-controls="app-sidebar" | ||
| aria-label={label} | ||
| title={label} | ||
| > | ||
| <IconPanelLeft /> | ||
| </button> | ||
| </div> | ||
| ); | ||
| } | ||
|
|
||
| export function MainTopStrip({ children }: { children?: ReactNode }) { | ||
| return ( | ||
| <div className="main-top" {...windowChromeHandlers()}> | ||
| {children} | ||
| </div> | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the desktop shell opens Models → Combos with quota data available, this wrapper makes
.quota-summary-barno longer a direct child of.main. The existing rules ingui/src/components/quota-summary-bar/quota-summary-bar.css:268-278therefore stop matching, leaving.main-inner--combosatheight: 100dvh; the new 40px title-bar sibling then makes the page one title-bar taller than the viewport and clips or scrolls the bottom of the workspace. Update those selectors for.main-topor otherwise size the Combos shell to the remaining height.Useful? React with 👍 / 👎.