Make your computer a home for your AI partner. Avibe is the local-first Agent OS: Vibey, its built-in AI partner, works out of the box, and Claude Code, Codex & OpenCode run unchanged beside it — reach them from your browser, phone, or any chat app.
Python agentagent-osaiai-agentsai-partnerchatopsclaudeclaude-codecodexdevtoolsdiscord-botlark-botllmlocal-firstlong-term-memoryopencodeslack-botvibe-codingvibeywechat
feat(desktop): confine the drag strip to the sidebar so pane headers reach the top (#2207)
Maxcbac1ad047de
diff --git a/desktop/README.md b/desktop/README.mdindex 0d5e3635d..1bd5ae762 100644--- a/desktop/README.md+++ b/desktop/README.md@@ -225,19 +225,22 @@ On macOS the main window uses an overlay title bar with a hidden title: thetraffic lights float over the page and there is no separate title strip.WKWebView has no `app-region` CSS, and Tauri's drag-region attribute needs an IPCgrant the Workbench origin must not have, so the shell lays one transparent-native view (`src/macos_title_bar.rs`) over the top 28pt, above the WebView. A-drag there moves the window; a double-click follows the system "double-click a-window's title bar" setting. No capability or command is added. The shell also-sets `--shell-titlebar-inset: 28px` on the top-level document before any page-script runs; `ui/src/index.css` defaults it to `0px`, and Workbench surfaces-that reach the top edge add it so no control sits under the strip. Because the-shell can adopt an already-running Runtime whose older Workbench predates this-contract, the overlay is opt-in per page: after every main-window page load the-shell natively asks whether the page declares-`<meta name="avibe-shell-titlebar-inset">` (both `index.html` files do). A page-that does not, or cannot answer, gets the standard title bar with the window-title, the strip hidden, and the inset reset to `0px`. Windows and Linux keep-the native title bar and a zero inset.+native view (`src/macos_title_bar.rs`) over the sidebar's top — a 248x28pt+strip at the top-left corner, above the WebView, where the traffic lights float.+A drag there moves the window; a double-click follows the system "double-click a+window's title bar" setting. No capability or command is added. Everything right+of the sidebar keeps its full height, so the main pane's chat and search headers+reach the window's top edge. The shell also sets `--shell-titlebar-inset: 28px`+on the top-level document before any page script runs; `ui/src/index.css`+defaults it to `0px`, and left-edge and full-window Workbench surfaces add it so+no control sits under the strip or the traffic lights. Because the shell can+adopt an already-running Runtime whose Workbench was built against different+strip geometry (or none), the overlay is opt-in per page: after every+main-window page load the shell natively asks whether the page declares+`<meta name="avibe-shell-title-strip" content="248x28">` (both `index.html`+files do). A page that does not, or cannot answer, gets the standard title bar+with the window title, the strip hidden, and the inset reset to `0px`. Windows+and Linux keep the native title bar and a zero inset.For manual acceptance, use a packaged test install with isolated app config anda fake loopback Runtime: set a non-default frame, quit/relaunch, hide/Open, anddiff --git a/desktop/index.html b/desktop/index.htmlindex 867ee3912..c92352eb3 100644--- a/desktop/index.html+++ b/desktop/index.html@@ -4,10 +4,10 @@<meta charset="UTF-8" /><meta name="viewport" content="width=device-width, initial-scale=1.0" /><title>Avibe</title>- <!-- Tells the macOS desktop shell this page lays itself out below its overlay- title bar (--shell-titlebar-inset); without it the shell keeps the standard- title bar. -->- <meta name="avibe-shell-titlebar-inset" content="supported" />+ <!-- Tells the macOS desktop shell this page keeps the shell's 248x28 top-left+ drag strip free of controls (--shell-titlebar-inset); without an exact+ match the shell keeps the standard title bar. -->+ <meta name="avibe-shell-title-strip" content="248x28" /></head><body><main class="stage" role="main">diff --git a/desktop/src-tauri/src/macos_title_bar.rs b/desktop/src-tauri/src/macos_title_bar.rsindex 52c7611aa..ab78f3bcc 100644--- a/desktop/src-tauri/src/macos_title_bar.rs+++ b/desktop/src-tauri/src/macos_title_bar.rs@@ -4,23 +4,27 @@//! title, so the traffic lights float over the page instead of sitting on a//! separate grey strip. Two things then have to hold://!-//! - The page must keep its own controls out of the strip. It learns the-//! strip's height from `--shell-titlebar-inset`, which [`inset_script`] sets on-//! the root element before any Workbench script runs.-//! - The strip must still move the window. WKWebView honours no `app-region`-//! CSS and swallows the mouse-down that would start a native drag, and Tauri's+//! - The page must keep the strip's region free of its own controls. The strip+//! covers only the sidebar's top — the traffic lights float there — so the+//! main pane's chat and search headers reach the window's top edge with their+//! ordinary padding. Left-edge and full-window surfaces learn the strip's+//! height from `--shell-titlebar-inset`, which [`inset_script`] sets on the+//! root element before any Workbench script runs.+//! - The strip must move the window. WKWebView honours no `app-region` CSS and+//! swallows the mouse-down that would start a native drag, and Tauri's//! drag-region attribute needs an IPC grant the remote Workbench origin//! deliberately does not have. So the shell lays one transparent native view//! over the strip, above the WebView: a drag there moves the window and a//! double-click does what the system title bar would, with no page script//! involved and no capability widened.//!-//! Both only hold for a page that knows the inset. The shell can adopt a-//! Runtime it did not ship, whose older Workbench still puts controls in the top-//! 28 points, so every loaded page is asked, natively and without IPC, whether-//! it declares [`SUPPORT_META`]. A page that does keeps the overlay; any other-//! page, or a page that cannot answer, gets the standard title bar back with the-//! strip hidden and the inset reset to zero.+//! Both only hold for a page built against this exact geometry. The shell can+//! adopt a Runtime it did not ship, whose Workbench keeps a different region+//! free — or none at all — so every loaded page is asked, natively and without+//! IPC, whether it declares [`SUPPORT_META`] with the geometry this shell+//! draws. A page that does keeps the overlay; any other page, or a page that+//! cannot answer, gets the standard title bar back with the strip hidden and+//! the inset reset to zero.use block2::RcBlock;use objc2::rc::Retained;@@ -40,6 +44,13 @@ use tauri::{Webview, WebviewWindow};/// macOS title bar of a window without a toolbar, where the traffic lights sit.pub const TITLE_BAR_INSET: f64 = 28.0;+/// Width, in points, of the strip: the Workbench sidebar's minimum width+/// (`MIN_SIDEBAR_WIDTH` in `ui/src/lib/sidebarWidth.ts`). The sidebar can only+/// grow from there and keeps its whole top edge free, so the strip never+/// reaches the main pane, whose headers therefore keep the window's full+/// height. The traffic lights float over the sidebar, above the strip.+pub const TITLE_BAR_STRIP_WIDTH: f64 = 248.0;+/// Publishes [`TITLE_BAR_INSET`] to the Workbench and the bootstrap page. User/// scripts run after the document element exists and before any page script./// Top-level document only: Show Page content in subframes is laid out by the@@ -51,17 +62,27 @@ pub fn inset_script() -> String {)}-/// The `<meta name>` a page carries when it lays itself out below the strip.-/// The Workbench (`ui/index.html`) and the bootstrap page (`index.html`) both-/// declare it; a Workbench from before the overlay title bar does not.-const SUPPORT_META: &str = "avibe-shell-titlebar-inset";+/// The `<meta name>` a page carries when it keeps the strip's region free, with+/// the geometry it was built against as the content (`240x28`). The Workbench+/// (`ui/index.html`) and the bootstrap page (`index.html`) both declare it. A+/// page from another release that kept a different region free carries a+/// different name or content, so skew in either direction falls back to the+/// standard title bar instead of covering that page's controls.+const SUPPORT_META: &str = "avibe-shell-title-strip";++/// The geometry half of the [`SUPPORT_META`] contract, `<width>x<height>` in+/// points, derived from the constants the strip is drawn with.+fn support_geometry() -> String {+ format!("{TITLE_BAR_STRIP_WIDTH}x{TITLE_BAR_INSET}")+}-/// Answers whether the loaded top-level page declares [`SUPPORT_META`], and-/// makes the published inset agree with that answer.+/// Answers whether the loaded top-level page declares [`SUPPORT_META`] for this+/// shell's exact strip geometry, and makes the published inset agree.fn support_probe() -> String {+ let geometry = support_geometry();format!("(function () {{ \- var supported = document.querySelector('meta[name=\"{SUPPORT_META}\"]') !== null; \+ var supported = document.querySelector('meta[name=\"{SUPPORT_META}\"][content=\"{geometry}\"]') !== null; \document.documentElement.style.setProperty('--shell-titlebar-inset', supported ? '{TITLE_BAR_INSET}px' : '0px'); \return supported ? 'supported' : 'unsupported'; }})()")@@ -139,15 +160,18 @@ pub fn install(window: &WebviewWindow) {};let strip = TitleBarDragStrip::new(mtm,- NSRect::new(NSPoint::new(0.0, y), NSSize::new(bounds.size.width, TITLE_BAR_INSET)),+ NSRect::new(+ NSPoint::new(0.0, y),+ NSSize::new(TITLE_BAR_STRIP_WIDTH, TITLE_BAR_INSET),+ ),);- // Pinned to the top edge and stretched with the width on every resize.+ // Pinned to the top-left corner, fixed size, on every resize.let pin_top = if flipped {NSAutoresizingMaskOptions::ViewMaxYMargin} else {NSAutoresizingMaskOptions::ViewMinYMargin};- strip.setAutoresizingMask(NSAutoresizingMaskOptions::ViewWidthSizable | pin_top);+ strip.setAutoresizingMask(NSAutoresizingMaskOptions::ViewMaxXMargin | pin_top);content.addSubview_positioned_relativeTo(&strip, NSWindowOrderingMode::Above, None);});}@@ -208,18 +232,36 @@ fn set_overlay(window: &NSWindow, overlay: bool, _mtm: MainThreadMarker) {mod tests {use super::*;- /// A page that lays itself out below the strip must say so, or the shell- /// falls back to the standard title bar for it. Both pages the shell can- /// show at the current release declare the name the shell asks for.+ /// A page that keeps the strip's region free must say so for this exact+ /// geometry, or the shell falls back to the standard title bar for it. Both+ /// pages the shell can show at the current release declare it.#[test]- fn every_page_this_release_serves_declares_overlay_support() {+ fn every_page_this_release_serves_declares_this_strip_geometry() {let crate_dir = std::path::Path::new(env!("CARGO_MANIFEST_DIR"));for page in ["../index.html", "../../ui/index.html"] {let html = std::fs::read_to_string(crate_dir.join(page)).expect("page is readable");assert!(- html.contains(&format!("<meta name=\"{SUPPORT_META}\"")),- "{page} must declare {SUPPORT_META}"+ html.contains(&format!(+ "<meta name=\"{SUPPORT_META}\" content=\"{}\"",+ support_geometry()+ )),+ "{page} must declare {SUPPORT_META} for {}",+ support_geometry());}}++ /// The strip must never reach the main pane, whose headers use the full+ /// window height. The sidebar guarantees that by never shrinking below the+ /// strip's width; if its minimum changes, the strip and the geometry+ /// contract must change with it.+ #[test]+ fn the_strip_never_outgrows_the_workbench_sidebar() {+ let widths = std::path::Path::new(env!("CARGO_MANIFEST_DIR")).join("../../ui/src/lib/sidebarWidth.ts");+ let widths = std::fs::read_to_string(widths).expect("sidebarWidth.ts is readable");+ assert!(+ widths.contains(&format!("MIN_SIDEBAR_WIDTH = {TITLE_BAR_STRIP_WIDTH};")),+ "the sidebar's minimum width must equal the native drag strip's width ({TITLE_BAR_STRIP_WIDTH}px)"+ );+ }}diff --git a/ui/index.html b/ui/index.htmlindex 478ba4472..eb49d1bd1 100644--- a/ui/index.html+++ b/ui/index.html@@ -11,10 +11,10 @@home + visualViewport --app-vvh chat, see useViewportHeightVar). --><meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /><title>Avibe</title>- <!-- Tells the macOS desktop shell this page lays itself out below its overlay- title bar (--shell-titlebar-inset); without it the shell keeps the standard- title bar. -->- <meta name="avibe-shell-titlebar-inset" content="supported" />+ <!-- Tells the macOS desktop shell this page keeps the shell's 248x28 top-left+ drag strip free of controls (--shell-titlebar-inset); without an exact+ match the shell keeps the standard title bar. -->+ <meta name="avibe-shell-title-strip" content="248x28" /><!-- PWA / iOS standalone: "Add to Home Screen" launches a full-screen app(no Safari chrome), which sidesteps the iOS keyboard whitespace/accessorydiff --git a/ui/src/components/ui/image-viewer.tsx b/ui/src/components/ui/image-viewer.tsxindex de4b7b661..2dca26dcb 100644--- a/ui/src/components/ui/image-viewer.tsx+++ b/ui/src/components/ui/image-viewer.tsx@@ -147,7 +147,7 @@ export const ImageViewerProvider: React.FC<{ images: string[]; children: React.Rrole="dialog"aria-modal="true">- <div className="absolute right-4 top-[calc(1rem+var(--shell-titlebar-inset))] z-10 flex items-center gap-2">+ <div className="absolute right-4 top-4 z-10 flex items-center gap-2">{/* Zoom buttons: a pointer-device affordance (touch zooms by pinch).stopPropagation so clicking a control doesn't also close the viewer. */}<Buttondiff --git a/ui/src/components/workbench/ChatPage.tsx b/ui/src/components/workbench/ChatPage.tsxindex fe708a181..232f707f6 100644--- a/ui/src/components/workbench/ChatPage.tsx+++ b/ui/src/components/workbench/ChatPage.tsx@@ -3669,7 +3669,7 @@ export const ChatHeaderBar: React.FC<ChatHeaderBarProps> = ({ session, agents, d// hairline bottom border separating it from the scrolling transcript.// No project-id pill and no override banner — both were noise the user// flagged (regression feedback #1/#3).- <div className="shrink-0 border-b border-border bg-surface/70 px-4 py-2.5 backdrop-blur md:px-8 md:pt-[max(0.625rem,var(--shell-titlebar-inset))]">+ <div className="shrink-0 border-b border-border bg-surface/70 px-4 py-2.5 backdrop-blur md:px-8"><div className="mx-auto flex w-full max-w-[1080px] items-center gap-3"><Buttontype="button"diff --git a/ui/src/components/workbench/SearchPage.tsx b/ui/src/components/workbench/SearchPage.tsxindex d3dbbcb8e..23eea5854 100644--- a/ui/src/components/workbench/SearchPage.tsx+++ b/ui/src/components/workbench/SearchPage.tsx@@ -102,7 +102,7 @@ export const SearchPage: React.FC = () => {// routes here (sidebar field + ⌘K own search), but keep it sane if hit.<div className="fixed inset-0 z-40 flex flex-col bg-background pt-[env(safe-area-inset-top)] md:absolute">{/* Header — back chevron + active search field (design.pen P6Nsz/KmsNV). */}- <header className="flex shrink-0 items-center gap-2.5 border-b border-border bg-background/92 px-4 py-3 backdrop-blur md:pt-[max(0.75rem,var(--shell-titlebar-inset))]">+ <header className="flex shrink-0 items-center gap-2.5 border-b border-border bg-background/92 px-4 py-3 backdrop-blur"><Buttontype="button"variant="ghost"