A team of long-lived bots for DeepSeek Harness, with main bots, bot-to-bot messages and group chats.
Keep the group stop button inside a narrow chat column
AdamPlatin123802fad0213b1
diff --git a/ds-bot/client.js b/ds-bot/client.jsindex af3f784b..2c958eb4 100644--- a/ds-bot/client.js+++ b/ds-bot/client.js@@ -16062,7 +16062,7 @@ function MemberDock({ sessionId, useRoster, useWork, actions }) {{ className: "bt-mw-dock", "data-leaving": leaving || void 0 },(0, import_react41.createElement)("span",- { className: "bt-mw-pair" },+ { className: "bt-mw-pair", "data-stop": model.stop ? true : void 0 },(0, import_react41.createElement)("button",{ type: "button", className: "bt-mw-pill", "aria-label": label, onClick: open, disabled: leaving, style: width ? { width } : void 0 },@@ -16144,6 +16144,7 @@ var MEMBER_CSS = `.bt-mw-pill:active{scale:.97}.bt-mw-dock[data-leaving] .bt-mw-pill,.bt-mw-dock[data-leaving] .bt-mw-stop{animation:bt-mw-out .16s cubic-bezier(.4,0,1,1) forwards;pointer-events:none}.bt-mw-pair{position:relative;display:inline-flex;min-width:0;max-width:100%}+.bt-mw-pair[data-stop]{max-width:calc(100% - 76px)}.bt-mw-stop{pointer-events:auto;position:absolute;top:0;left:calc(100% + 6px);display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;padding:0;border:0;border-radius:50%;background:var(--bt-main);box-shadow:0 0 0 .5px var(--bt-line-2),0 2px 8px -2px rgba(0,0,0,.12);color:var(--bt-ink-2);cursor:pointer;animation:bt-mw-in ${SPRING_SHAPE.duration}ms ${SPRING_SHAPE.easing} backwards,bt-veil-in .18s ease-out backwards;transition:background-color .12s ease,color .12s ease,${spring(SPRING_TAP, "scale")}}.bt-mw-stop:hover:not(:disabled){background:color-mix(in srgb,var(--bt-ink) 4%,var(--bt-main));color:var(--bt-ink)}.bt-mw-stop:active:not(:disabled){scale:.9}diff --git a/ds-bot/src/client/member-status.js b/ds-bot/src/client/member-status.jsindex b99a281c..7ec3b76b 100644--- a/ds-bot/src/client/member-status.js+++ b/ds-bot/src/client/member-status.js@@ -131,9 +131,10 @@ export function MemberDock({ sessionId, useRoster, useWork, actions }) {const faces = model.faces.map(face => ({ ...face, bot: roster.byId[face.id] })).filter(face => face.bot)const label = [model.waiting, model.doing].filter(Boolean).join(' · ')const open = () => (model.open.details ? actions.showDetails(model.open.details) : actions.openSession(model.open.session))- // The stop button hangs off the capsule's side, so the capsule stays centred.+ // The stop button hangs off the capsule's side, so the capsule stays centred; the+ // capsule keeps room for it on both sides, so it never leaves a narrow chat column.return h('div', { className: 'bt-mw-dock', 'data-leaving': leaving || undefined },- h('span', { className: 'bt-mw-pair' },+ h('span', { className: 'bt-mw-pair', 'data-stop': model.stop ? true : undefined },h('button', { type: 'button', className: 'bt-mw-pill', 'aria-label': label, onClick: open, disabled: leaving, style: width ? { width } : undefined },h('span', { ref: inner, className: 'bt-mw-pill-in' },h('span', { className: 'bt-mw-faces', 'aria-hidden': true }, faces.map(face => h(Face, { key: face.id, ...face }))),@@ -211,6 +212,7 @@ export const MEMBER_CSS = `.bt-mw-pill:active{scale:.97}.bt-mw-dock[data-leaving] .bt-mw-pill,.bt-mw-dock[data-leaving] .bt-mw-stop{animation:bt-mw-out .16s cubic-bezier(.4,0,1,1) forwards;pointer-events:none}.bt-mw-pair{position:relative;display:inline-flex;min-width:0;max-width:100%}+.bt-mw-pair[data-stop]{max-width:calc(100% - 76px)}.bt-mw-stop{pointer-events:auto;position:absolute;top:0;left:calc(100% + 6px);display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;padding:0;border:0;border-radius:50%;background:var(--bt-main);box-shadow:0 0 0 .5px var(--bt-line-2),0 2px 8px -2px rgba(0,0,0,.12);color:var(--bt-ink-2);cursor:pointer;animation:bt-mw-in ${SPRING_SHAPE.duration}ms ${SPRING_SHAPE.easing} backwards,bt-veil-in .18s ease-out backwards;transition:background-color .12s ease,color .12s ease,${spring(SPRING_TAP, 'scale')}}.bt-mw-stop:hover:not(:disabled){background:color-mix(in srgb,var(--bt-ink) 4%,var(--bt-main));color:var(--bt-ink)}.bt-mw-stop:active:not(:disabled){scale:.9}diff --git a/ds-bot/test/member-status.test.js b/ds-bot/test/member-status.test.jsindex aef235f7..51f5f555 100644--- a/ds-bot/test/member-status.test.js+++ b/ds-bot/test/member-status.test.js@@ -22,7 +22,7 @@ runInNewContext(bundle.outputFiles[0].text, {return platform[name]},})-const { busyMembers, summaryText, MemberDock, MemberState, StopMemberWork } = module.exports+const { busyMembers, summaryText, MemberDock, MemberState, StopMemberWork, MEMBER_CSS } = module.exports// Values from the bundle's realm compare by content only.const plain = value => JSON.parse(JSON.stringify(value))// The dock's capsule in an element tree.@@ -144,6 +144,14 @@ test('a stop button beside a group\'s capsule stops all work there, and only theassert.equal(stopOf('a', { bots: { a: { since: 1, roomId: 'r1' } }, rooms: { r1: [{ botId: 'a', since: 1 }] }, approvals: [] }), null)})+// The button hangs outside the capsule, so in a narrow chat column it would go past the edge.+test('a group\'s capsule keeps room on both sides for its stop button', () => {+ const pairOf = work => MemberDock({ sessionId: 'r1', useRoster: pick => pick(team), useWork: pick => pick(work), actions: {} }).children[0]+ assert.equal(pairOf({ bots: {}, rooms: { r1: [{ botId: 'a', since: 1 }] }, approvals: [] }).props['data-stop'], true)+ assert.equal(pairOf({ bots: { a: { since: 1, tool: 'pwsh' } }, rooms: {}, approvals: [] }).props['data-stop'], undefined)+ assert.match(MEMBER_CSS, /\.bt-mw-pair\[data-stop\]\{max-width:calc\(100% - 76px\)\}/)+})+test('a failed stop of a group\'s work is reported', async () => {const reported = []const button = stopOf('r1', { bots: {}, rooms: { r1: [{ botId: 'a', since: 1 }] }, approvals: [{ botId: 'a', roomId: 'r1', at: 1 }] }, {