From 750efc41067842a7a5b6a93ac8e79021e3ae0731 Mon Sep 17 00:00:00 2001 From: Daniel Date: Wed, 9 Sep 2026 23:47:41 +0200 Subject: [PATCH] feat: Assistant / Workspace mode switch in the rail, the way Home and Code swap the page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The rail's Workspace section was a collapsible extra sitting under the chats. It is now the second of two modes, selected by a segmented switch at the top of the rail: - Assistant keeps the chat column, the saved-chat list, New chat and Create image. - Workspace REPLACES the chat column and the Sources panel with the app's own menu — a card grid in the main column and the same list in the rail — so nothing from the assistant is left half-visible beside it. Both the rail list and the cards are built from the app's real .tab-btn elements, so a tab added, renamed or hidden in index.html follows automatically. Learning Hub moved down from second place to sit immediately before Content Manager, with the other content tools rather than above the clinical ones. Also removed dead CSS for .assistant-view-switch, .assistant-learning-view and #assistant-learning-root: that markup no longer exists anywhere in the app. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01BkfrkQwA4YGrGw9LZSpeAq --- public/components/assistant.html | 22 ++++++---- public/css/assistant.css | 25 +++++++---- public/index.html | 8 ++-- public/js/clinicalAssistant.js | 55 +++++++++++++++++++------ test/assistant-workspace-layout.test.js | 30 +++++++++++++- 5 files changed, 107 insertions(+), 33 deletions(-) diff --git a/public/components/assistant.html b/public/components/assistant.html index 8c1dd7b8..8efbe0dd 100644 --- a/public/components/assistant.html +++ b/public/components/assistant.html @@ -15,6 +15,10 @@
+
diff --git a/public/css/assistant.css b/public/css/assistant.css index 22fff9c5..70445771 100644 --- a/public/css/assistant.css +++ b/public/css/assistant.css @@ -17,14 +17,9 @@ body.assistant-workspace .assistant-topbar-title h2 { position:absolute; width:1 .assistant-history { display:grid; gap:10px; align-content:start; position:sticky; top:52px; } .assistant-new-chat { display:flex; align-items:center; justify-content:center; gap:8px; width:100%; border:1px solid var(--purple-light); background:#faf5ff; color:var(--purple); border-radius:10px; padding:10px 12px; font-size:13px; font-weight:700; cursor:pointer; } .assistant-new-chat:hover { border-color:var(--purple); background:var(--purple-light); } -.assistant-view-switch { display:grid; grid-template-columns:1fr 1fr; gap:4px; background:var(--g100); border:1px solid var(--g200); border-radius:10px; padding:4px; } -.assistant-view-switch button { border:0; border-radius:7px; padding:7px 6px; font-size:12px; font-weight:600; color:var(--g500); background:transparent; cursor:pointer; } -.assistant-view-switch button.active { background:white; color:var(--purple); box-shadow:var(--shadow); } .assistant-main { display:flex; flex-direction:column; min-height:calc(100vh - 200px); min-width:0; } #assistant-chat-view { display:grid; grid-template-rows:auto minmax(420px,1fr) auto; min-height:calc(100vh - 200px); min-width:0; } -#assistant-chat-view[hidden], .assistant-learning-view[hidden] { display:none; } -.assistant-learning-view { min-height:calc(100vh - 200px); } -#assistant-learning-root { padding:4px 2px; } +#assistant-chat-view[hidden], .assistant-workspace-view[hidden] { display:none; } .assistant-toolbar { display:flex; justify-content:space-between; align-items:center; gap:10px; padding:10px 14px; border-bottom:1px solid var(--g200); background:var(--g50); } .assistant-toolbar-actions { display:flex; gap:6px; flex-wrap:wrap; } .assistant-messages { padding:16px; max-height:65vh; overflow-y:auto; overflow-x:hidden; background:linear-gradient(180deg,#fff,var(--g50)); min-width:0; } @@ -139,6 +134,23 @@ body.assistant-workspace .assistant-topbar-title h2 { position:absolute; width:1 .assistant-sources { padding:10px 12px; display:grid; gap:8px; flex:1 1 auto; min-height:0; overflow-y:auto; } .assistant-saved-chats { flex:1 1 auto; overflow-y:auto; min-height:0; padding:10px 12px; display:flex; flex-direction:column; gap:8px; } /* Open WebUI-style recency headings above each run of chats. */ +/* Two-mode switch at the top of the rail, the way Home and Code swap the page. */ +.assistant-mode-switch { display:grid; grid-template-columns:1fr 1fr; gap:4px; background:var(--g100); border:1px solid var(--g200); border-radius:10px; padding:4px; margin-bottom:8px; } +.assistant-mode-switch button { display:flex; align-items:center; justify-content:center; gap:6px; border:0; border-radius:7px; padding:7px 6px; font-size:12px; font-weight:600; color:var(--g500); background:transparent; cursor:pointer; } +.assistant-mode-switch button i { font-size:11px; } +.assistant-mode-switch button.active { background:white; color:var(--purple); box-shadow:var(--shadow); } + +/* Workspace mode fills the chat column with the app's own menu. */ +.assistant-workspace-view { padding:22px; overflow-y:auto; min-height:0; } +.assistant-workspace-head h2 { margin:0 0 4px; font-size:18px; color:var(--g900); } +.assistant-workspace-head p { margin:0 0 18px; font-size:13px; color:var(--g500); } +.assistant-workspace-cards { display:grid; grid-template-columns:repeat(auto-fill,minmax(190px,1fr)); gap:10px; } +.assistant-workspace-card { display:flex; align-items:center; gap:10px; border:1px solid var(--g200); background:white; border-radius:12px; padding:14px; font-size:13px; color:var(--g800); text-align:left; cursor:pointer; } +.assistant-workspace-card:hover { border-color:var(--purple-light); background:#faf5ff; color:var(--purple); } +.assistant-workspace-card i { width:18px; text-align:center; color:var(--g400); font-size:14px; } +.assistant-workspace-card:hover i { color:var(--purple); } +@media (max-width:640px) { .assistant-workspace-view { padding:14px; } .assistant-workspace-cards { grid-template-columns:1fr 1fr; } } + /* Workspace section in the rail: the app's own menu, one level down, the way Claude's sidebar carries both its chats and its top-level navigation. */ .assistant-rail-workspace { display:flex; flex-direction:column; gap:1px; margin-top:8px; padding-top:8px; border-top:1px solid var(--g100); } @@ -319,7 +331,6 @@ body.assistant-workspace .assistant-side { height: 100%; overflow: hidden; } body.assistant-workspace .assistant-side .card { min-height: 0; } body.assistant-workspace .assistant-main { min-height: 0; } body.assistant-workspace #assistant-chat-view { min-height: 0; } -body.assistant-workspace .assistant-learning-view { min-height: 0; height: 100vh; overflow-y: auto; } .assistant-saved-chat { position:relative; } .assistant-saved-chat-delete { position:absolute; top:6px; right:8px; display:flex; align-items:center; justify-content:center; width:24px; height:24px; border-radius:6px; color:var(--g500, #6b7280); opacity:0; transition:opacity .12s ease; pointer-events:none; } .assistant-saved-chat:hover .assistant-saved-chat-delete, .assistant-saved-chat:focus-within .assistant-saved-chat-delete { opacity:1; pointer-events:auto; } diff --git a/public/index.html b/public/index.html index f9d58076..eab1f51a 100644 --- a/public/index.html +++ b/public/index.html @@ -201,10 +201,6 @@ AI Assistant - +