From e36d2b361c61d8bfb541ba795b60dba4f0ef70d0 Mon Sep 17 00:00:00 2001 From: Local Dev Date: Wed, 9 Sep 2026 00:11:26 +0200 Subject: [PATCH] feat(theseus/toolbar): Firefox-style single drag handle, zero-sum URL/search ratio MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The two independent drag handles (right edge of URL bar, left edge of search bar) are replaced with ONE handle sitting between them, wrapped in a new .urlsearch flex container that owns the URL-bar-plus-search-bar budget between the nav buttons on the left and the trailing dock on the right. Zero-sum semantics: dragging the handle right grows the URL bar and shrinks the search bar; dragging left inverts. Nothing else in the toolbar moves — nav buttons, Downloads, extension dock and the ⛓ Theseus logo all sit outside .urlsearch's flex parent. When the window shrinks below the responsive breakpoint the search bar (and the drag handle) hide as before, and the URL bar grows to fill the .urlsearch budget on its own (added flex: 1 1 auto in the data-responsive rules for .urlwrap). Verified static rendering: url=700px → search=157px, url=300px → search=539px, url=default → 60/40 split, narrow window → search hidden and url fills. Old settings (urlBarSize / searchBoxSize / searchBoxWidthPx) are ignored by chrome.html but kept in main's SETTINGS_DEFAULTS so an older chrome.html could still read them on a downgrade. Only urlBarWidthPx is used going forward. --- chrome.html | 196 +++++++++++++++++++++++++-------------------------- package.json | 2 +- 2 files changed, 96 insertions(+), 102 deletions(-) diff --git a/chrome.html b/chrome.html index 5ca6baa..e793e96 100644 --- a/chrome.html +++ b/chrome.html @@ -159,28 +159,22 @@ /* address bar. flex:1 by default consumes remaining space; user can cap it via Settings > Appearance > Address bar size so the extension dock gets more room. min-width guards against squeezing the URL invisible. */ - .urlwrap { position: relative; flex: 1 1 auto; min-width: 200px; display: flex; align-items: center; gap: 4px; background: var(--surface); border: 1px solid var(--line); + /* The address bar and search bar share ONE flex budget between the nav + buttons and the trailing button dock — the whole .urlsearch unit takes + whatever space is left after the fixed items. A single drag handle + between them shifts the ratio (bigger URL bar = smaller search bar, + and vice versa) without moving anything else in the toolbar. When the + window is too narrow for both, the search bar hides (see the + data-responsive rules below); the URL bar keeps working alone. */ + .urlsearch { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 6px; } + .urlwrap { position: relative; flex: 0 1 var(--urlbar-w, 60%); min-width: 220px; display: flex; align-items: center; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 0 6px 0 4px; } - /* Capped URL bar: pin the trailing items (download / extensions / logo / - Theseus) to the RIGHT edge instead of packing them next to the URL bar - — a smaller address bar shouldn't slide everything leftward. margin- - right: auto on the URL bar consumes the slack. */ - .bar[data-urlsize="medium"] .urlwrap { flex: 0 1 640px; margin-right: auto; } - .bar[data-urlsize="compact"] .urlwrap { flex: 0 1 400px; margin-right: auto; } - .bar[data-urlwidth] .urlwrap { flex: 0 0 var(--urlbar-w, auto); margin-right: auto; } - .searchbox { position: relative; } - .bar[data-searchsize="hidden"] .searchbox { display: none; } - .bar[data-searchsize="compact"] .searchbox { width: 180px; } - .bar[data-searchsize="wide"] .searchbox { width: 400px; } - .bar[data-searchwidth] .searchbox { width: var(--searchbox-w, 300px); } - /* Drag-to-resize handles: a thin invisible strip on the trailing edge of - .urlwrap and the leading edge of .searchbox. col-resize cursor makes - the affordance visible; a faint acid tint on hover confirms it's live. */ - .urldrag, .searchdrag { position: absolute; top: 0; bottom: 0; width: 6px; cursor: col-resize; z-index: 10; background: transparent; } - .urldrag { right: -3px; } - .searchdrag { left: -3px; } - .urldrag:hover, .searchdrag:hover, - .urldrag.dragging, .searchdrag.dragging { background: rgb(from var(--acid) r g b / .35); } + .searchbox { flex: 1 1 0; min-width: 140px; } + /* Single drag handle sitting between the two — a thin 6px column with a + col-resize cursor. Zero-sum semantics: dragging right grows the URL + bar and shrinks the search bar; dragging left does the inverse. */ + .bardrag { flex: 0 0 6px; align-self: stretch; cursor: col-resize; background: transparent; border-radius: 3px; } + .bardrag:hover, .bardrag.dragging { background: rgb(from var(--acid) r g b / .35); } /* Adaptive toolbar. A ResizeObserver on .bar sets data-responsive: "0" wide — everything visible (default) "1" tight — auto-hide the search box, min-width for URL bar drops @@ -192,14 +186,17 @@ narrow widths yields to the responsive collapse. */ .bar[data-responsive="1"] .searchbox, .bar[data-responsive="2"] .searchbox, - .bar[data-responsive="3"] .searchbox { display: none; } + .bar[data-responsive="3"] .searchbox, + .bar[data-responsive="1"] .bardrag, + .bar[data-responsive="2"] .bardrag, + .bar[data-responsive="3"] .bardrag { display: none; } .bar[data-responsive="2"] .logo span:not(.gear), .bar[data-responsive="3"] .logo span:not(.gear) { display: none; } .bar[data-responsive="2"] .logo, .bar[data-responsive="3"] .logo { padding: 4px 8px; } .bar[data-responsive="1"] .urlwrap, .bar[data-responsive="2"] .urlwrap, - .bar[data-responsive="3"] .urlwrap { min-width: 120px; } + .bar[data-responsive="3"] .urlwrap { min-width: 120px; flex: 1 1 auto; } /* Level 3: hide the per-extension button row, show the collapsed puzzle button. Dropdown is a floating .extpop the JS builds on click. */ /* Two paths to the collapsed dock: the coarse width-based level 3 @@ -279,8 +276,10 @@ .pwchip { display: inline-flex; align-items: center; gap: 3px; border: none; background: transparent; color: #3fb950; cursor: pointer; padding: 2px 5px; border-radius: 6px; font-size: 11px; font-weight: 700; } .pwchip:hover { background: rgba(63,185,80,.14); } .pwchip svg { width: 14px; height: 14px; } - /* search box: engine icon (click = pick engine) + a wide typing area */ - .searchbox { display: flex; align-items: center; width: 300px; background: var(--surface); border: 1px solid var(--line); + /* search box: engine icon (click = pick engine) + a wide typing area. + Width comes from the parent .urlsearch flex budget (flex: 1 1 0) — + the earlier top rule at line 172 sets that; here we only style. */ + .searchbox { display: flex; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 0 12px 0 3px; } .searchbox:focus-within { border-color: #4b7bec; } /* dropdown button shows the SELECTED engine's favicon (emoji fallback) + a caret */ @@ -391,25 +390,26 @@ -
- - - - - -
-
-