Skip to content

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

Merge dev into feat/593-group-row-title

AdamPlatin123f40fdd9ee9e1
diff --cc ds-bot/client.js
index da7f87b4,8b9d72bb..190d765d
--- a/ds-bot/client.js
+++ b/ds-bot/client.js
@@@ -8409,13 -9191,7 +9191,13 @@@ function useMarkedUnread(id, active, ma
if (active && marked) actions.clearUnread(id);
}, [active, marked]);
}
- var PinMark = () => (0, import_react15.createElement)("span", { className: "bt-pin", "aria-hidden": true }, (0, import_react15.createElement)(PinMarkIcon));
+ var PinMark = () => (0, import_react18.createElement)("span", { className: "bt-pin", "aria-hidden": true }, (0, import_react18.createElement)(PinMarkIcon));
+var nameIfCut = (event) => {
+ const row = event.currentTarget;
+ const name = row.querySelector(".bt-row-title");
+ if (name && name.scrollWidth > name.clientWidth) row.title = name.textContent;
+ else row.removeAttribute("title");
+};
var useApproval = (useWork, match) => useWork ? useWork((work) => (work.approvals ?? []).some(match)) : false;
var useGroupWork = (useWork, pick2) => useWork ? useWork((work) => JSON.stringify(pick2(work.rooms ?? {}))) : "[]";
var workKeys = (text) => JSON.parse(text);
diff --cc ds-bot/src/client/sidebar.js
index 0eb9df73,ba696ac9..b8f0a61e
--- a/ds-bot/src/client/sidebar.js
+++ b/ds-bot/src/client/sidebar.js
@@@ -92,9 -85,9 +94,9 @@@ function BotRow({ bot, roster, actions
}
return h('button', {
type: 'button', className: 'bt-row', 'aria-label': label, 'aria-current': active ? 'page' : undefined,
- 'data-bot-id': id, title: wide ? undefined : bot.name, onClick: () => actions.openSession(id), onContextMenu,
+ 'data-bot-id': id, title: wide ? undefined : bot.name, onMouseEnter: wide ? nameIfCut : undefined, onClick: () => actions.openSession(id), onContextMenu,
},
- h(BotAvatar, { bot, size: 36, state, main }),
+ h(BotAvatar, { bot, size: wide ? 36 : 44, state, main }),
pinned && !wide ? h(PinMark) : null,
wide ? h('span', { className: 'bt-row-body' },
h('span', { className: 'bt-row-name' }, h('span', { className: 'bt-row-title' }, bot.name), pinned ? h(PinMark) : null),
@@@ -121,10 -115,10 +124,10 @@@ function RoomRow({ room, roster, action
const label = [room.name, pinned ? t('Pinned') : '', members.length > 0 ? t('Working') : '', approval ? t('Waiting for your approval') : ''].filter(Boolean).join(', ')
return h('button', {
type: 'button', className: 'bt-row', 'aria-label': label, 'aria-current': active ? 'page' : undefined,
- 'data-room-id': id, onClick: () => actions.openSession(id),
+ 'data-room-id': id, title: wide ? undefined : room.name, onMouseEnter: wide ? nameIfCut : undefined, onClick: () => actions.openSession(id),
onContextMenu: (event) => { event.preventDefault(); actions.openMenu({ kind: 'room', id, x: event.clientX, y: event.clientY }) },
},
- h(RoomAvatar, { room, roster, size: 36 }),
+ h(RoomAvatar, { room, roster, size: wide ? 36 : 44 }),
pinned && !wide ? h(PinMark) : null,
wide ? h('span', { className: 'bt-row-body' },
h('span', { className: 'bt-row-name' }, h('span', { className: 'bt-row-title' }, room.name), pinned ? h(PinMark) : null),
diff --cc ds-bot/test/sidebar-switch.test.js
index fdea9121,b483d1b6..59109a99
--- a/ds-bot/test/sidebar-switch.test.js
+++ b/ds-bot/test/sidebar-switch.test.js
@@@ -256,50 -205,6 +205,50 @@@ test('an idle Bot\'s sidebar row keeps
assert.equal(previews.length, 0)
})
+// The rail shows avatars only, and a group's name can be 60 characters long: a row whose
+// name is not on screen in full shows it on hover.
+test('a sidebar row shows its name on hover when the name is hidden or cut', () => {
+ viewport.innerWidth = 1280
+ const bot = { id: 'writer', name: 'Writer', createdAt: 1 }
+ const room = { id: 'room', name: 'Launch plan for the spring release', members: ['writer'], createdAt: 2 }
+ const roster = { bots: [bot], rooms: [room], agents: [], byId: { writer: bot }, roomsById: { room }, ready: true, exchangeTurns: {} }
- const rowsOf = (wide) => {
++ const rowsOf = (pref) => {
+ const rows = []
+ const walk = (node) => {
+ if (Array.isArray(node)) { node.forEach(walk); return }
+ if (!node || typeof node !== 'object') return
+ if (['BotRow', 'RoomRow'].includes(node.type?.name)) rows.push(node)
+ walk(node.props?.children)
+ }
+ walk(TeamSidebar({
- wide,
++ useSidebarPref: pick => pick(pref),
+ actions: Object.fromEntries(['openSession', 'openMenu', 'openPalette', 'openNewChat', 'toggleSidebar', 'clearUnread'].map(name => [name, () => {}])),
+ useRoster: pick => pick(roster), useUi: pick => pick({ unread: {} }), useRegistry: pick => pick({}),
+ useSessions: pick => pick({ ids: [], byId: {} }), useUpdate: () => ({}),
+ useSessionStatus: pick => pick(new Map()), useSessionRetainInfo: () => null,
+ useActivity: pick => pick({}), useWork: pick => pick({ waiting: {}, rooms: {}, approvals: [] }),
+ }))
+ return Object.fromEntries(rows.map(row => [row.type.name, row.type(row.props)]))
+ }
- const rail = rowsOf(false)
++ const rail = rowsOf('rail')
+ assert.equal(rail.BotRow.props.title, 'Writer')
+ assert.equal(rail.RoomRow.props.title, 'Launch plan for the spring release')
- const wide = rowsOf(true)
++ const wide = rowsOf('open')
+ assert.equal(wide.RoomRow.props.title, undefined)
+ // jsdom lays nothing out, so the name's widths are set by hand.
+ const { document } = new JSDOM('<button title="stale"><span class="bt-row-title">Launch plan for the spring release</span></button>').window
+ const button = document.querySelector('button')
+ const name = button.firstChild
+ Object.defineProperty(name, 'clientWidth', { value: 120 })
+ Object.defineProperty(name, 'scrollWidth', { value: 120, configurable: true })
+ wide.RoomRow.props.onMouseEnter({ currentTarget: button })
+ assert.equal(button.hasAttribute('title'), false)
+ Object.defineProperty(name, 'scrollWidth', { value: 260 })
+ wide.RoomRow.props.onMouseEnter({ currentTarget: button })
+ assert.equal(button.title, 'Launch plan for the spring release')
+ assert.equal(wide.BotRow.props.onMouseEnter, wide.RoomRow.props.onMouseEnter)
+})
+
test('preparing sidebar navigation leaves actions elsewhere unchanged', () => {
viewport.innerWidth = 390
const { actions, calls } = navigationSidebar(true)