Skip to content

A team of long-lived bots for DeepSeek Harness, with main bots, bot-to-bot messages and group chats.

Keep direct sidebar callers compatible

Chimneye8bc658e1738
diff --git a/ds-bot/client.js b/ds-bot/client.js
index 5d924028..b54868f6 100644
--- a/ds-bot/client.js
+++ b/ds-bot/client.js
@@ -5567,7 +5567,7 @@ function TeamSidebar(props) {
const result = open(id);
if (wide && window.innerWidth < 1024 && !closing.current) {
closing.current = true;
- expandSidebar();
+ expandSidebar?.();
actions.toggleSidebar();
}
return result;
diff --git a/ds-bot/src/client/sidebar.js b/ds-bot/src/client/sidebar.js
index f9c178c5..72271744 100644
--- a/ds-bot/src/client/sidebar.js
+++ b/ds-bot/src/client/sidebar.js
@@ -276,7 +276,7 @@ export function TeamSidebar(props) {
const result = open(id)
if (wide && window.innerWidth < 1024 && !closing.current) {
closing.current = true
- expandSidebar()
+ expandSidebar?.()
actions.toggleSidebar()
}
return result
diff --git a/ds-bot/test/sidebar-switch.test.js b/ds-bot/test/sidebar-switch.test.js
index d08bd40b..2c16f037 100644
--- a/ds-bot/test/sidebar-switch.test.js
+++ b/ds-bot/test/sidebar-switch.test.js
@@ -38,7 +38,7 @@ runInNewContext(outputFiles[0].text, {
})
const { SHELL_CSS, SIDEBAR_CSS, TeamSidebar } = module.exports
-function navigationSidebar(wide) {
+function navigationSidebar(wide, { shell = true } = {}) {
const calls = []
const refs = []
let collapsed = !wide
@@ -55,7 +55,7 @@ function navigationSidebar(wide) {
if (['BotRow', 'RoomRow', 'AgentRow'].includes(node.type?.name)) rows.push(node)
walk(node.props?.children)
}
- const render = (nextWide = wide) => {
+ const render = (nextWide = shell ? wide : !collapsed) => {
wide = nextWide
// The public owner action closes over the shell's committed collapsed state;
// wide may still be true during the shell's 150ms content fade-out.
@@ -64,7 +64,8 @@ function navigationSidebar(wide) {
refIndex = 0
layoutEffects = []
const tree = TeamSidebar({
- wide, actions, expandSidebar: () => { if (committedCollapsed) actions.toggleSidebar() },
+ wide, actions,
+ ...(shell ? { expandSidebar: () => { if (committedCollapsed) actions.toggleSidebar() } } : {}),
useRoster: pick => pick(roster), useUi: pick => pick({ unread: {} }), useRegistry: pick => pick({}),
useSessions: pick => pick({ ids: [], byId: {} }), useUpdate: () => ({}),
})
@@ -106,6 +107,24 @@ test('repeated sidebar navigation before another commit closes only once', () =>
assert.deepEqual(side.calls, [['openAgent', 'first'], ['toggleSidebar'], ['openSession', 'second']])
})
+test('the standalone UI can navigate without a shell expansion action', () => {
+ viewport.innerWidth = 390
+ // app/ui passes its actual wide state directly, without the DSH owner action.
+ const side = navigationSidebar(true, { shell: false })
+ side.rows[1].props.actions.openSession('first')
+ side.rows[2].props.actions.openSession('second')
+ assert.equal(side.collapsed, true)
+ assert.deepEqual(side.calls, [['openSession', 'first'], ['toggleSidebar'], ['openSession', 'second']])
+ side.render()
+ side.calls.length = 0
+ side.rows[1].props.actions.openSession('from-rail')
+ assert.deepEqual(side.calls, [['openSession', 'from-rail']])
+ side.actions.toggleSidebar()
+ side.render()
+ side.rows[2].props.actions.openSession('after-expansion')
+ assert.equal(side.collapsed, true)
+})
+
test('navigation during the shell fade-out keeps the already collapsed sidebar closed', () => {
viewport.innerWidth = 390
const side = navigationSidebar(true)