diff --git a/public/css/assistant.css b/public/css/assistant.css index 3cbae761..7baf10b8 100644 --- a/public/css/assistant.css +++ b/public/css/assistant.css @@ -472,7 +472,10 @@ body.assistant-mode-workspace .assistant-history .card, body.assistant-mode-workspace .assistant-rail-actions, body.assistant-mode-workspace .assistant-side { display:none; } body.assistant-mode-workspace .assistant-layout { grid-template-columns:210px minmax(0,1fr); } -body.assistant-mode-workspace.menu-hidden .assistant-layout { grid-template-columns:0 minmax(0,1fr); } +/* Collapsed is the 52px strip in workspace mode too. This said 0, and loading + after styles.css it beat the 52px rule there, so the collapsed menu (name + card included) vanished whenever the workspace launcher was showing. */ +body.assistant-mode-workspace.menu-hidden .assistant-layout { grid-template-columns:52px minmax(0,1fr); } /* Workspace mode works on a phone too: the launcher is the same grid of cards, one per column. Suppressing it here is what made the Workspace pill do nothing at all on mobile. */ diff --git a/public/css/styles.css b/public/css/styles.css index 15b02d97..db3f4620 100644 --- a/public/css/styles.css +++ b/public/css/styles.css @@ -1311,6 +1311,12 @@ button, a, .btn-sm, .btn-generate, .btn-send, .tab-btn, input, textarea, select, The phone sheet has nothing to collapse — the same control closes it — so none of this may leak past the breakpoint. */ body.menu-hidden .sidebar { width:52px; } + /* Collapsed, the strip is a column of its own: plain white against the tiled + ground, no drawn border — the white is the edge. Flat on the tiles, the 52px + column had no edge and read as icons pressed against the page card. The + full-width menu stays flat. Same strip in both views. */ + body.menu-hidden .sidebar, + body.assistant-workspace.menu-hidden .assistant-history { background:white; } body.menu-hidden .sidebar-tabs, body.menu-hidden .assistant-mode-switch, body.menu-hidden .sidebar-section-label, diff --git a/public/js/app.js b/public/js/app.js index 257dc9d2..408f18d6 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -314,8 +314,12 @@ document.addEventListener('DOMContentLoaded', function() { } function searchSources() { - // The assistant publishes its chats; anything else searches the menu. - if (window.location.pathname === '/assistant' && typeof window.assistantSearchableChats === 'function') { + // Search follows the view, not the address: the assistant's chat view + // searches chats, and Workspace — including the workspace launcher shown + // inside the assistant, which keeps the /assistant URL — searches the menu. + var inChats = document.body.classList.contains('assistant-workspace') + && !document.body.classList.contains('assistant-mode-workspace'); + if (inChats && typeof window.assistantSearchableChats === 'function') { return { kind: 'chats', items: window.assistantSearchableChats() }; } var items = []; diff --git a/public/js/clinicalAssistant.js b/public/js/clinicalAssistant.js index 0c200f38..6e97bea1 100644 --- a/public/js/clinicalAssistant.js +++ b/public/js/clinicalAssistant.js @@ -1350,6 +1350,7 @@ import { '

Loading your images…

' + ''; document.body.appendChild(modal); + fitSelectOptions(modal.querySelector('#create-image-chat')); modal.addEventListener('click', function (event) { if (event.target === modal || event.target.closest('[data-create-image-close]')) modal.remove(); }); @@ -2391,6 +2392,36 @@ import { return truncateOnWord(String(first && first.content || 'Clinical assistant chat').replace(/\s+/g, ' ').trim(), 160); } + // A native list is as wide as its longest option; full chat titles + // pushed it far past the dialog. + assert.match(js, /document\.body\.appendChild\(modal\);\s*\n\s*fitSelectOptions\(modal\.querySelector\('#create-image-chat'\)\);/, + 'labels are fitted once the dialog is laid out'); + const fn = js.slice(js.indexOf('function fitSelectOptions(select)'), js.indexOf("window.addEventListener('resize', function () { fitSelectOptions")); + assert.match(fn, /var room = select\.clientWidth - OPTION_CHROME;/, 'fitted to the select, not a fixed character count'); + assert.match(fn, /if \(room <= 0\) return;/, 'no layout, no change'); + assert.match(fn, /opt\.title = full;/, 'the full title stays on hover'); + assert.match(fn, /words\[i\]/, 'cuts on whole words'); + assert.match(js, /window\.addEventListener\('resize', function \(\) \{ fitSelectOptions\(document\.getElementById\('create-image-chat'\)\); \}\);/); +});