A team of long-lived bots for DeepSeek Harness, with main bots, bot-to-bot messages and group chats.
Blend the left column into the window frame and own the Windows switch
Fei24116c4837a63670
diff --git a/app/src/mica.css b/app/src/mica.cssindex 822cbfc4..e766e2e7 100644--- a/app/src/mica.css+++ b/app/src/mica.css@@ -22,6 +22,11 @@ div[class*="_sidebarCol"] > div[class*="_root"],div[class*="_sidebarCol"] > * > div[class*="_root"] {background: transparent !important;}+/* ds-bot's own collapsed column (.bt-leftcol) reaches the window's top edge and+ takes the same coat as the shell's sidebar under it. */+body {+ --bt-leftcol-fill: color-mix(in srgb, var(--dsw-specific-sidebar-fill) 45%, transparent);+}div[class*="_centerCol"] {padding-top: var(--dsh-windows-titlebar-height) !important;}diff --git a/ds-bot/client.js b/ds-bot/client.jsindex e821704c..ab9cf4a3 100644--- a/ds-bot/client.js+++ b/ds-bot/client.js@@ -2468,12 +2468,14 @@ body[data-bt-motion=quiet] .bt-mark[data-poke]{cursor:default}.bt-row-preview{font-size:13px;line-height:18px;color:var(--bt-ink-2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bt-unread{width:8px;height:8px;border-radius:50%;background:var(--bt-accent);flex:none;margin-right:2px;animation:bt-fade .13s cubic-bezier(.22,1,.36,1)}.bt-unread-wait{background:var(--bt-star)}-/* Our own left column, portalled over the shell's collapsed sidebar: it starts- below the window's title strip and stays under the shell's title-bar switch- (z 30) and the popovers (z 60). */-.bt-leftcol{position:fixed;left:0;top:var(--dsh-frame-top-clearance,0px);bottom:0;z-index:25;display:flex;background:var(--bt-sidebar);border-right:.5px solid var(--bt-line);box-sizing:border-box;padding:6px 12px;color:var(--bt-ink);font-family:var(--bt-font)}+/* Our own left column, portalled over the shell's collapsed sidebar. It reaches+ the window's top edge so the title band and the column share one fill (under+ Mica the app styles DSH's sidebar the same way, via --bt-leftcol-fill there);+ it stays under the shell's title-bar switch (z 30) and the popovers (z 60),+ and the floating drawer keeps the opaque fill over the conversation. */+.bt-leftcol{position:fixed;left:0;top:0;bottom:0;z-index:25;display:flex;--bt-lc-clear:var(--dsh-frame-top-clearance,var(--dsh-windows-titlebar-height,0px));background:var(--bt-leftcol-fill,var(--dsw-specific-sidebar-fill));border-right:.5px solid var(--bt-line);box-sizing:border-box;padding:calc(var(--bt-lc-clear) + 6px) 12px 6px;color:var(--bt-ink);font-family:var(--bt-font)}html[data-windows-titlebar] .bt-leftcol,html[data-platform=darwin] .bt-leftcol{border-right:none}-.bt-leftcol[data-left=drawer]{box-shadow:8px 0 24px rgba(0,0,0,.14)}+.bt-leftcol[data-left=drawer]{background:var(--dsw-specific-sidebar-fill);box-shadow:8px 0 24px rgba(0,0,0,.14)}.bt-leftcol>.bt-side{width:100%}.bt-leftcol-foot{display:flex;align-items:center;gap:9px;padding-top:8px;flex:none}.bt-rail{align-items:center;padding:0}@@ -2482,7 +2484,7 @@ html[data-windows-titlebar] .bt-leftcol,html[data-platform=darwin] .bt-leftcol{b.bt-rail-sep{width:24px;height:1px;flex:none;background:var(--bt-line)}.bt-rail .bt-agent-ava{width:44px;height:44px}.bt-rail .bt-list{align-items:center;gap:4px}-.bt-leftcol[data-left=rail]{padding:8px 16px}+.bt-leftcol[data-left=rail]{padding:calc(var(--bt-lc-clear) + 8px) 16px 8px}.bt-leftcol-foot-rail{flex-direction:column;gap:6px}.bt-dot{position:absolute;top:4px;right:8px;width:8px;height:8px;border-radius:50%;background:var(--bt-accent);box-shadow:0 0 0 1.5px var(--bt-sidebar)}.bt-dot-wait{background:var(--bt-star)}@@ -2891,6 +2893,13 @@ button.bt-set-row:hover{background:var(--bt-hover)}html:not([data-windows-titlebar]) :not([class*="_collapsed"])>[class*="_logoRow"]{display:none!important}html[data-windows-titlebar] :not([class*="_collapsed"])>[class*="_logoRow"]{height:0!important;margin:0!important}html[data-windows-titlebar] :is(.bt-side-collapse,.bt-rail-expand),html[data-platform=darwin] :is(.bt-side-collapse,.bt-rail-expand){display:none}+/* Under a Windows title bar our own switch replaces the shell's: the shell's+ toggle expands the shell sidebar first, and pulling it back afterwards is a+ visible flash of the shell's column. */+html[data-windows-titlebar] [class*="_logoRow"]>[class*="_toggle"]{display:none!important}+.bt-title-toggle{display:none;position:fixed;left:12px;top:calc((var(--dsh-windows-titlebar-height,0px) - 28px) / 2);width:28px;height:28px;z-index:30;-webkit-app-region:no-drag;align-items:center;justify-content:center;border:0;border-radius:6px;padding:0;background:transparent;color:var(--bt-ink);cursor:pointer;font-family:var(--bt-font)}+html[data-windows-titlebar] .bt-title-toggle{display:inline-flex}+.bt-title-toggle:hover{background:var(--bt-hover)}/* The footer ends in the Bot row: the whale's settings seat, then Connect plugins. Everyother plugin's entry takes a whole row above it, in the shell's order, so none of themsqueezes the Bot row. */@@ -8916,6 +8925,17 @@ function useListGlide(listRef, layout, key) {function LeftColumn({ mode, width, children }) {return (0, import_react_dom3.createPortal)((0, import_react15.createElement)("div", { className: "bt-leftcol", "data-left": mode, style: { width: `${width}px` } }, children), document.body);}+function TitleToggle({ left, onToggle }) {+ if (typeof document === "undefined" || !document.documentElement.hasAttribute("data-windows-titlebar")) return null;+ const collapse = left === "open" || left === "drawer";+ return (0, import_react_dom3.createPortal)((0, import_react15.createElement)("button", {+ type: "button",+ className: "bt-title-toggle",+ "aria-label": t(collapse ? "Collapse sidebar" : "Expand sidebar"),+ title: t(collapse ? "Collapse sidebar" : "Expand sidebar"),+ onClick: onToggle+ }, (0, import_react15.createElement)(SidebarIcon)), document.body);+}function TeamSidebar(props) {const { wide, useRoster, useUi, useSessions, actions } = props;const listRef = (0, import_react15.useRef)(null);@@ -9034,6 +9054,13 @@ function TeamSidebar(props) {actions.setSidebarPref?.("open");if (frameSnap.viewport < frameSnap.sidebarWidth + MIN_CHAT) actions.setLeftDrawer?.(true);};+ const onTitleToggle = () => {+ if (layout.left === "open") {+ actions.setLeftDrawer?.(false);+ actions.setSidebarPref?.("rail");+ } else if (layout.left === "drawer") actions.setLeftDrawer?.(false);+ else expandLeft();+ };const top = wideContent ? (0, import_react15.createElement)("div",{ className: "bt-side-top" },@@ -9073,8 +9100,12 @@ function TeamSidebar(props) {),foot);- if (mode === "inline") return content;- return (0, import_react15.createElement)(LeftColumn, { mode, width: ourWidth }, content);+ return (0, import_react15.createElement)(+ import_react15.Fragment,+ null,+ (0, import_react15.createElement)(TitleToggle, { left: layout.left, onToggle: onTitleToggle }),+ mode === "inline" ? content : (0, import_react15.createElement)(LeftColumn, { mode, width: ourWidth }, content)+ );}function UpdateButton({ useUpdate, actions }) {const update = useUpdate((value) => value);diff --git a/ds-bot/src/client/sidebar.js b/ds-bot/src/client/sidebar.jsindex 620bde74..6d08e9cc 100644--- a/ds-bot/src/client/sidebar.js+++ b/ds-bot/src/client/sidebar.js@@ -260,6 +260,19 @@ function LeftColumn({ mode, width, children }) {return createPortal(h('div', { className: 'bt-leftcol', 'data-left': mode, style: { width: `${width}px` } }, children), document.body)}+// The shell's title-bar switch on Windows asks the shell to expand before our+// sync pulls it back, a visible flash. Under a Windows title bar our own switch+// replaces it and goes straight to the next state.+function TitleToggle({ left, onToggle }) {+ if (typeof document === 'undefined' || !document.documentElement.hasAttribute('data-windows-titlebar')) return null+ const collapse = left === 'open' || left === 'drawer'+ return createPortal(h('button', {+ type: 'button', className: 'bt-title-toggle',+ 'aria-label': t(collapse ? 'Collapse sidebar' : 'Expand sidebar'),+ title: t(collapse ? 'Collapse sidebar' : 'Expand sidebar'), onClick: onToggle,+ }, h(SidebarIcon)), document.body)+}+export function TeamSidebar(props) {const { wide, useRoster, useUi, useSessions, actions } = propsconst listRef = useRef(null)@@ -379,6 +392,11 @@ export function TeamSidebar(props) {actions.setSidebarPref?.('open')if (frameSnap.viewport < frameSnap.sidebarWidth + MIN_CHAT) actions.setLeftDrawer?.(true)}+ const onTitleToggle = () => {+ if (layout.left === 'open') { actions.setLeftDrawer?.(false); actions.setSidebarPref?.('rail') }+ else if (layout.left === 'drawer') actions.setLeftDrawer?.(false)+ else expandLeft()+ }const top = wideContent? h('div', { className: 'bt-side-top' },h('span', { className: 'bt-brand' }, h(BrandMark, { size: 22 }), h(BrandName)),@@ -410,8 +428,9 @@ export function TeamSidebar(props) {? h(RoomRow, { key: entry.item.id, ...rowProps, room: entry.item, marked: markedUnread[entry.item.id] === true }): h(AgentRow, { key: entry.item.id, ...rowProps, agent: entry.item, marked: markedUnread[entry.item.id] === true })))),foot)- if (mode === 'inline') return content- return h(LeftColumn, { mode, width: ourWidth }, content)+ return h(Fragment, null,+ h(TitleToggle, { left: layout.left, onToggle: onTitleToggle }),+ mode === 'inline' ? content : h(LeftColumn, { mode, width: ourWidth }, content))}// The update button at the sidebar's top right: a cloud while a newer DS Bot —diff --git a/ds-bot/src/client/styles.js b/ds-bot/src/client/styles.jsindex 27a3b323..6880591b 100644--- a/ds-bot/src/client/styles.js+++ b/ds-bot/src/client/styles.js@@ -144,12 +144,14 @@ body[data-bt-motion=quiet] .bt-mark[data-poke]{cursor:default}.bt-row-preview{font-size:13px;line-height:18px;color:var(--bt-ink-2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bt-unread{width:8px;height:8px;border-radius:50%;background:var(--bt-accent);flex:none;margin-right:2px;animation:bt-fade .13s cubic-bezier(.22,1,.36,1)}.bt-unread-wait{background:var(--bt-star)}-/* Our own left column, portalled over the shell's collapsed sidebar: it starts- below the window's title strip and stays under the shell's title-bar switch- (z 30) and the popovers (z 60). */-.bt-leftcol{position:fixed;left:0;top:var(--dsh-frame-top-clearance,0px);bottom:0;z-index:25;display:flex;background:var(--bt-sidebar);border-right:.5px solid var(--bt-line);box-sizing:border-box;padding:6px 12px;color:var(--bt-ink);font-family:var(--bt-font)}+/* Our own left column, portalled over the shell's collapsed sidebar. It reaches+ the window's top edge so the title band and the column share one fill (under+ Mica the app styles DSH's sidebar the same way, via --bt-leftcol-fill there);+ it stays under the shell's title-bar switch (z 30) and the popovers (z 60),+ and the floating drawer keeps the opaque fill over the conversation. */+.bt-leftcol{position:fixed;left:0;top:0;bottom:0;z-index:25;display:flex;--bt-lc-clear:var(--dsh-frame-top-clearance,var(--dsh-windows-titlebar-height,0px));background:var(--bt-leftcol-fill,var(--dsw-specific-sidebar-fill));border-right:.5px solid var(--bt-line);box-sizing:border-box;padding:calc(var(--bt-lc-clear) + 6px) 12px 6px;color:var(--bt-ink);font-family:var(--bt-font)}html[data-windows-titlebar] .bt-leftcol,html[data-platform=darwin] .bt-leftcol{border-right:none}-.bt-leftcol[data-left=drawer]{box-shadow:8px 0 24px rgba(0,0,0,.14)}+.bt-leftcol[data-left=drawer]{background:var(--dsw-specific-sidebar-fill);box-shadow:8px 0 24px rgba(0,0,0,.14)}.bt-leftcol>.bt-side{width:100%}.bt-leftcol-foot{display:flex;align-items:center;gap:9px;padding-top:8px;flex:none}.bt-rail{align-items:center;padding:0}@@ -158,7 +160,7 @@ html[data-windows-titlebar] .bt-leftcol,html[data-platform=darwin] .bt-leftcol{b.bt-rail-sep{width:24px;height:1px;flex:none;background:var(--bt-line)}.bt-rail .bt-agent-ava{width:44px;height:44px}.bt-rail .bt-list{align-items:center;gap:4px}-.bt-leftcol[data-left=rail]{padding:8px 16px}+.bt-leftcol[data-left=rail]{padding:calc(var(--bt-lc-clear) + 8px) 16px 8px}.bt-leftcol-foot-rail{flex-direction:column;gap:6px}.bt-dot{position:absolute;top:4px;right:8px;width:8px;height:8px;border-radius:50%;background:var(--bt-accent);box-shadow:0 0 0 1.5px var(--bt-sidebar)}.bt-dot-wait{background:var(--bt-star)}@@ -567,6 +569,13 @@ button.bt-set-row:hover{background:var(--bt-hover)}html:not([data-windows-titlebar]) :not([class*="_collapsed"])>[class*="_logoRow"]{display:none!important}html[data-windows-titlebar] :not([class*="_collapsed"])>[class*="_logoRow"]{height:0!important;margin:0!important}html[data-windows-titlebar] :is(.bt-side-collapse,.bt-rail-expand),html[data-platform=darwin] :is(.bt-side-collapse,.bt-rail-expand){display:none}+/* Under a Windows title bar our own switch replaces the shell's: the shell's+ toggle expands the shell sidebar first, and pulling it back afterwards is a+ visible flash of the shell's column. */+html[data-windows-titlebar] [class*="_logoRow"]>[class*="_toggle"]{display:none!important}+.bt-title-toggle{display:none;position:fixed;left:12px;top:calc((var(--dsh-windows-titlebar-height,0px) - 28px) / 2);width:28px;height:28px;z-index:30;-webkit-app-region:no-drag;align-items:center;justify-content:center;border:0;border-radius:6px;padding:0;background:transparent;color:var(--bt-ink);cursor:pointer;font-family:var(--bt-font)}+html[data-windows-titlebar] .bt-title-toggle{display:inline-flex}+.bt-title-toggle:hover{background:var(--bt-hover)}/* The footer ends in the Bot row: the whale's settings seat, then Connect plugins. Everyother plugin's entry takes a whole row above it, in the shell's order, so none of themsqueezes the Bot row. */diff --git a/ds-bot/test/sidebar-switch.test.js b/ds-bot/test/sidebar-switch.test.jsindex f787586c..042e1b9b 100644--- a/ds-bot/test/sidebar-switch.test.js+++ b/ds-bot/test/sidebar-switch.test.js@@ -221,9 +221,10 @@ function rulesOf(css) {at = end}}-const SHELL_PARTS = /_logoRow|_brand|_toggle|_newSession|_footArea|_collapsed|_topStrip|bt-side-collapse/+const SHELL_PARTS = /_logoRow|_brand|_toggle|_newSession|_footArea|_collapsed|_topStrip|bt-side-collapse|bt-title-toggle/const rules = [...rulesOf(SHELL_CSS), ...rulesOf(SIDEBAR_CSS)].filter(rule => SHELL_PARTS.test(rule.selector))const hiding = rules.filter(rule => /display:none/.test(rule.body))+const showing = rules.filter(rule => /display:inline-flex/.test(rule.body))// The shell sidebar's own markup (dsh-client-ui-sidebar SidebarRoot), reduced to what the// team view reshapes: the switch is in the logo row, except in a macOS desktop window,@@ -236,6 +237,7 @@ function shell({ platform, collapsed }) {<div class="x_root${collapsed ? ' x_collapsed' : ''}">${darwin ? `<div class="x_topStrip">${toggle}</div>` : ''}<div class="x_logoRow">${collapsed ? '' : '<button class="x_brand x_wide"></button>'}${darwin ? '' : toggle}</div>+ <button class="bt-title-toggle"></button><div class="x_newSession"></div><div class="team">${collapsed ? '' : '<div class="bt-side-top"><button class="bt-round bt-side-collapse"></button></div>'}</div><div class="x_footArea"><span class="bt-foot-account"></span></div>@@ -244,11 +246,11 @@ function shell({ platform, collapsed }) {const { document } = new JSDOM(html).windowconst hidden = (node) => {for (let at = node; at && at.nodeType === 1; at = at.parentElement) {- if (hiding.some(rule => at.matches(rule.selector))) return true+ if (hiding.some(rule => at.matches(rule.selector)) && !showing.some(rule => at.matches(rule.selector))) return true}return false}- const switches = [...document.querySelectorAll('.x_toggle, .bt-side-collapse')].filter(node => !hidden(node))+ const switches = [...document.querySelectorAll('.x_toggle, .bt-side-collapse, .bt-title-toggle')].filter(node => !hidden(node))return { document, hidden, switches }}@@ -258,9 +260,11 @@ for (const platform of ['web', 'windows', 'mac']) {const { document, hidden, switches } = shell({ platform, collapsed })assert.equal(switches.length, 1, `switches shown: ${switches.map(node => node.className).join(' | ') || 'none'}`)const [shown] = switches- // An open sidebar on the web has the team's own button; everywhere else the shell's- // switch stays where the shell puts it.+ // An open sidebar on the web has the team's own button; under a Windows+ // title bar our own switch replaces the shell's (which would flash the+ // shell's column before we pull it back); elsewhere the shell's stays.assert.equal(shown.classList.contains('bt-side-collapse'), platform === 'web' && !collapsed)+ assert.equal(shown.classList.contains('bt-title-toggle'), platform === 'windows')// What the team view replaces stays out of sight.assert.equal(hidden(document.querySelector('.x_newSession')), true)const brand = document.querySelector('.x_brand')