Skip to content

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

Anchor message tools at the bottom of long replies

klarkxyf973f51ee0ef
diff --git a/ds-bot/client.js b/ds-bot/client.js
index ec520f75..1c7170ec 100644
--- a/ds-bot/client.js
+++ b/ds-bot/client.js
@@ -3043,18 +3043,18 @@ html:not([data-windows-titlebar]) [class*="_footArea"],:not([class*="_collapsed"
.bt-msg-line>.bt-bubble{max-width:none;min-width:0}
/* The same bubble width as beside an avatar column: the share of (100% - 30px), plus the 30px. */
.bt-astack[data-lead]>.bt-msg{max-width:min(calc(var(--bt-msg-w) * (100% - 30px) + 30px),calc(100% - 52px))}
-.bt-tools{position:absolute;top:50%;left:100%;margin-left:6px;transform:translateY(-50%);display:flex;gap:2px;opacity:0;visibility:hidden;transition:opacity .12s ease,visibility .12s}
+.bt-tools{position:absolute;bottom:0;left:100%;margin-left:6px;display:flex;gap:2px;opacity:0;visibility:hidden;transition:opacity .12s ease,visibility .12s}
/* The hover bridge spans only the 6px gap (plus a little overlap) between the
bubble's edge and the toolbar: wider, it sits over the bubble's tail and
blocks text selection and link clicks there. */
.bt-tools::after{content:"";position:absolute;top:-8px;bottom:-8px;right:100%;width:10px;z-index:-1}
.bt-msg:hover>.bt-msg-line>.bt-tools,.bt-msg:focus-within>.bt-msg-line>.bt-tools,.bt-tools[data-open]{opacity:1;visibility:visible}
/* The flat layout: a Bot's text has no bubble and takes its own share of the column
- (the whole of it unless set). The toolbar floats over the message's top right. */
+ (the whole of it unless set). The toolbar floats over the message's bottom right. */
body[data-bt-layout=flat] .bt-astack{align-items:stretch;gap:10px}
body[data-bt-layout=flat] .bt-msg,body[data-bt-layout=flat] .bt-astack[data-lead]>.bt-msg{align-items:stretch;max-width:calc(var(--bt-flat-w) * 100%)}
body[data-bt-layout=flat] .bt-bubble{background:none;padding:0;border-radius:0}
-body[data-bt-layout=flat] .bt-tools{top:-14px;right:0;left:auto;margin-left:0;transform:none;padding:2px;border-radius:999px;background:var(--bt-card);box-shadow:inset 0 0 0 .5px var(--bt-line-2),0 4px 14px rgba(0,0,0,.14)}
+body[data-bt-layout=flat] .bt-tools{bottom:-14px;right:0;left:auto;margin-left:0;transform:none;padding:2px;border-radius:999px;background:var(--bt-card);box-shadow:inset 0 0 0 .5px var(--bt-line-2),0 4px 14px rgba(0,0,0,.14)}
body[data-bt-layout=flat] .bt-tools::after{display:none}
.bt-tool{width:24px;height:24px;border:0;padding:0;border-radius:6px;background:none;color:var(--bt-ink-2);display:inline-flex;align-items:center;justify-content:center;cursor:pointer;transition:background-color .12s ease,color .12s ease}
.bt-tool:hover,.bt-tool[aria-expanded=true]{background:var(--bt-hover);color:var(--bt-ink)}
diff --git a/ds-bot/src/client/styles.js b/ds-bot/src/client/styles.js
index 324919f8..7d5f360e 100644
--- a/ds-bot/src/client/styles.js
+++ b/ds-bot/src/client/styles.js
@@ -650,18 +650,18 @@ html:not([data-windows-titlebar]) [class*="_footArea"],:not([class*="_collapsed"
.bt-msg-line>.bt-bubble{max-width:none;min-width:0}
/* The same bubble width as beside an avatar column: the share of (100% - 30px), plus the 30px. */
.bt-astack[data-lead]>.bt-msg{max-width:min(calc(var(--bt-msg-w) * (100% - 30px) + 30px),calc(100% - 52px))}
-.bt-tools{position:absolute;top:50%;left:100%;margin-left:6px;transform:translateY(-50%);display:flex;gap:2px;opacity:0;visibility:hidden;transition:opacity .12s ease,visibility .12s}
+.bt-tools{position:absolute;bottom:0;left:100%;margin-left:6px;display:flex;gap:2px;opacity:0;visibility:hidden;transition:opacity .12s ease,visibility .12s}
/* The hover bridge spans only the 6px gap (plus a little overlap) between the
bubble's edge and the toolbar: wider, it sits over the bubble's tail and
blocks text selection and link clicks there. */
.bt-tools::after{content:"";position:absolute;top:-8px;bottom:-8px;right:100%;width:10px;z-index:-1}
.bt-msg:hover>.bt-msg-line>.bt-tools,.bt-msg:focus-within>.bt-msg-line>.bt-tools,.bt-tools[data-open]{opacity:1;visibility:visible}
/* The flat layout: a Bot's text has no bubble and takes its own share of the column
- (the whole of it unless set). The toolbar floats over the message's top right. */
+ (the whole of it unless set). The toolbar floats over the message's bottom right. */
body[data-bt-layout=flat] .bt-astack{align-items:stretch;gap:10px}
body[data-bt-layout=flat] .bt-msg,body[data-bt-layout=flat] .bt-astack[data-lead]>.bt-msg{align-items:stretch;max-width:calc(var(--bt-flat-w) * 100%)}
body[data-bt-layout=flat] .bt-bubble{background:none;padding:0;border-radius:0}
-body[data-bt-layout=flat] .bt-tools{top:-14px;right:0;left:auto;margin-left:0;transform:none;padding:2px;border-radius:999px;background:var(--bt-card);box-shadow:inset 0 0 0 .5px var(--bt-line-2),0 4px 14px rgba(0,0,0,.14)}
+body[data-bt-layout=flat] .bt-tools{bottom:-14px;right:0;left:auto;margin-left:0;transform:none;padding:2px;border-radius:999px;background:var(--bt-card);box-shadow:inset 0 0 0 .5px var(--bt-line-2),0 4px 14px rgba(0,0,0,.14)}
body[data-bt-layout=flat] .bt-tools::after{display:none}
.bt-tool{width:24px;height:24px;border:0;padding:0;border-radius:6px;background:none;color:var(--bt-ink-2);display:inline-flex;align-items:center;justify-content:center;cursor:pointer;transition:background-color .12s ease,color .12s ease}
.bt-tool:hover,.bt-tool[aria-expanded=true]{background:var(--bt-hover);color:var(--bt-ink)}
diff --git a/ds-bot/test/styles.test.js b/ds-bot/test/styles.test.js
index 121dc0fb..fb1c2ff8 100644
--- a/ds-bot/test/styles.test.js
+++ b/ds-bot/test/styles.test.js
@@ -169,3 +169,10 @@ test('the chat-room rule is installed through installStyles, so it is owned too'
assert.match(pane, /installStyles\(.*'chat-room'/)
assert.equal(pane.includes("dataset.dshBot = 'chat-room'"), false)
})
+
+test('message tools anchor to the bottom of a long reply in both layouts', () => {
+ const css = readFileSync(new URL('../src/client/styles.js', import.meta.url), 'utf8')
+ assert.match(css, /\.bt-tools\{position:absolute;bottom:0;/)
+ assert.match(css, /body\[data-bt-layout=flat\] \.bt-tools\{bottom:-14px;/)
+ assert.doesNotMatch(css, /\.bt-tools\{position:absolute;top:50%;/)
+})