From 531996de1e0cf6f86cdff421d2bb1a9d24467a1a Mon Sep 17 00:00:00 2001 From: Daniel Date: Thu, 10 Sep 2026 05:16:05 +0200 Subject: [PATCH] feat: search finds what is inside a tab, and the menu head reads toggle, mark, search MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Search now reaches sub-navigation, because people look for "bili" rather than "Calculators". It reads whatever a loaded component exposes — data-calc, data-subtab, data-section — so it covers every tab with sub-navigation instead of one hard-coded list, and the relevant components are warmed when the palette opens. Opening a result survives the component still loading, and reaching one from the assistant navigates first and opens it after. Menu head order is now show/hide menu, then the mark, then search. In the collapsed rail every item is the same centred 52px box, so the icons finally share one axis — the brand was a flex row with a gap and sat off-centre from the buttons beneath it. Settings, FAQ and Admin are no longer listed in the menu: they already have a place in the account card, and listing them twice only made the tab list longer. Their sections remain, and activateTab already tolerates a tab whose section exists without a sidebar button. The retry loops are named functions rather than IIFEs, which the module entrypoint rules forbid. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01GmpYHPSLGmXGZMyLpn2Lbe --- public/components/assistant.html | 2 +- public/css/styles.css | 12 ++-- public/index.html | 15 +---- public/js/app.js | 80 ++++++++++++++++++++++--- test/assistant-workspace-layout.test.js | 39 ++++++++++++ 5 files changed, 121 insertions(+), 27 deletions(-) diff --git a/public/components/assistant.html b/public/components/assistant.html index 8e978e32..a72cffe8 100644 --- a/public/components/assistant.html +++ b/public/components/assistant.html @@ -7,12 +7,12 @@
diff --git a/public/css/styles.css b/public/css/styles.css index 51729054..fc81392e 100644 --- a/public/css/styles.css +++ b/public/css/styles.css @@ -49,7 +49,8 @@ body{font-family:'Inter',system-ui,sans-serif;background:var(--g50);color:var(-- the account card at its foot, and the content gets the full height. */ /* Icon, search, collapse — nothing else earns a place in the head row. */ .menu-head { display:flex; align-items:center; gap:4px; padding:10px 8px 8px 12px; } -.menu-head .menu-icon-btn:first-of-type { margin-left:auto; } +/* Toggle leads, the mark takes the slack, search closes the row. */ +.menu-brand { margin-right:auto; } .menu-brand { display:flex; align-items:center; gap:8px; flex:0 0 auto; min-width:0; } .menu-brand h1 { font-size:15px; font-weight:700; color:var(--g900); margin:0; line-height:1; letter-spacing:-.01em; } .menu-brand i { font-size:16px; color:var(--blue); flex:0 0 auto; } @@ -1277,9 +1278,12 @@ body.menu-hidden .sidebar-section-label, body.menu-hidden .menu-brand h1, body.menu-hidden .account-id, body.menu-hidden .account-chevron { display:none; } -body.menu-hidden .menu-head { flex-direction:column; gap:6px; padding:10px 0 8px; align-items:center; } -body.menu-hidden .menu-brand { flex:0 0 auto; justify-content:center; } -body.menu-hidden .menu-brand i { font-size:19px; } +body.menu-hidden .menu-head { flex-direction:column; gap:4px; padding:10px 0 8px; align-items:stretch; } +/* Every item is the same 52px-wide centred box, so the icons share one axis. */ +body.menu-hidden .menu-head > * { width:100%; margin:0; justify-content:center; } +body.menu-hidden .menu-brand { display:flex; align-items:center; justify-content:center; height:32px; gap:0; } +body.menu-hidden .menu-brand i { font-size:19px; width:auto; } +body.menu-hidden .menu-icon-btn { width:32px; height:32px; margin:0 auto; } body.menu-hidden .account-card { padding:8px 0; } body.menu-hidden .account-card-btn { justify-content:center; padding:6px 0; } body.menu-hidden .account-menu { left:8px; right:auto; width:210px; } diff --git a/public/index.html b/public/index.html index c7470a4b..12823b15 100644 --- a/public/index.html +++ b/public/index.html @@ -178,12 +178,12 @@