Your own team of AI bots in one self-hosted binary: spaces, every account you have, handoffs, approvals and routines. Open-source, self-hosted alternative to Grok Bot, Claude Duet and OpenAI dots. Rust + React.
Rust ai-agentsai-assistantai-botautomationbotbots-teamchatbotclaude-duetgrokgrok-botgrok-bot-alternativeharnessllmmulti-agentopenai-dotsopenbotpersonal-agentrustself-hostedselfhosted-ai
{
"repo": "alexsergivan/kwant",
"kind": "landed",
"pr": 301,
"title": "Sidebar: a bot's name wraps only between words; Needs you is a compact hand",
"body": "Oleks's report, the part #290 didn't cover: \"Researcher\" next to the \"Needs you\" pill broke inside the word (\"Researche / r\"), hovered or not. At a narrower sidebar with the lead tag it went down to one letter per line.\n\n**Cause.** `data-bot-name` had `[overflow-wrap:anywhere]`. The `shrink-0` pill, lead tag and approvals badge squeezed it to about 100 px, so the browser broke inside words.\n\n**Change** (`frontend/src/components/Sidebar.tsx`)\n- The name wraps only between words or after a hyphen, on up to 2 lines (`[overflow-wrap:normal] [word-break:normal] line-clamp-2 text-ellipsis`). A word too long for the line ends in \"…\". The full name stays in the title tooltip.\n- On the name line, the \"Needs you\" pill is now compact: the amber hand, plus \"2\", \"3\"… past one. It keeps the amber pill look, with `aria-label`/`title` \"<name> needs you in the browser\".\n- The status line under the name says \"Needs you in the browser\" in amber while a step is open. If the line already says \"Needs you in the browser in <chat>\", that text is kept.\n- #290 N1: on desktop, a bot with no title keeps a one-line status line, so Edit and Remove never sit on a 2-line name.\n- Unchanged from #290: hovering or focusing never changes a row's height or moves the name line.\n\n**Tests**\n- New `frontend/tests/nameWrap.test.mjs` (6 tests, desktop and phone). It fails if any mid-word break class (`overflow-wrap:anywhere/break-word`, `break-all`, `break-words`, `hyphens-auto`) returns. It also covers the compact pill and its label, the status line, and the empty-title reserve. All 6 fail on main and pass here.\n- `ia.test.mjs` QA a now asserts the opposite of the old `overflow-wrap:anywhere`.\n- `npm test`: 1296 pass, 0 fail. `tsc --noEmit` is clean.\n\n**Real-browser check.** Production builds of main and this branch, against a throwaway kwnt (1b581a9 image binary), in Chromium. Widths 1440, 1024 and 768, sidebar at the default 256 px and narrowed to 230 px with CSS, plus a 390 px phone. Names: Researcher, \"Booktun.ing Marketer\", \"Low content book trending and low competetive idea finder\", a 30-letter word, and hyphenated versions. Cases: Needs you ×1 and ×2, lead plus Needs you, approvals badge plus Needs you, and an untitled bot, each hovered and focused. That is 28 cases and 210 rows:\n- main: 82 rows break mid-word, and the pencil covers the untitled bot's 2-line name in 3.\n- this branch: 0 and 0.\n\nScreenshots and note: `/home/maus/shared/ship-software-safely/row-wrap/`.\n\nNot checked: Safari/WebKit (Chromium only).\n\n🤖 Generated with [Claude Code](https://claude.com/claude-code)\n",
"head_sha": "fd51f46faf1d6e6cf79b39058c56ec39706346b7",
"pr_head_sha": "7623cf2d8015021879319f1967f072efc3ffd620",
"base_branch": "main",
"merged_at": "2026-11-04T23:37:23Z",
"merged_by": "Oleks",
"author": {
"login": null,
"name": "Pixel (kwant bot)",
"email": "[email protected]",
"bot": {
"id": "kw_demo_pixel",
"name": "Pixel",
"engine": "claude",
"model": "claude-opus-5-5"
}
},
"files": [
{
"path": "frontend/src/components/Sidebar.tsx",
"status": "modified",
"additions": 26,
"deletions": 12,
"patch": "@@ -365,6 +365,11 @@ export const Sidebar: React.FC<SidebarProps> = ({\n // Desktop: the one-line status under the name makes room for Edit and Remove on hover or focus.\n // It never wraps, so the room costs a few letters of the status, never the row's height.\n const actionRoom = !phone && hasRowActions ? ' group-hover/fleet:pr-9 group-focus-within/fleet:pr-9' : '';\n+ // An open browser step: the status line says so in words while it is open (the name line only has the hand)\n+ const needs = needsYou[k.id] ?? 0;\n+ const needsTip = `${k.name} needs you in the browser`;\n+ const warn = needs > 0 || status === 'needs_you';\n+ const busyLine = needs > 0 && !busyKwants[k.id]?.startsWith('Needs you in the browser') ? 'Needs you in the browser' : busyKwants[k.id];\n return (\n <div\n key={`${team?.id ?? 'none'}:${k.id}`}\n@@ -384,8 +389,10 @@ export const Sidebar: React.FC<SidebarProps> = ({\n <div className=\"flex-1 min-w-0\">\n {/* The name line never changes on hover: padding it here made the name wrap and the row jump */}\n <div data-bot-name-line className=\"flex items-start gap-1\">\n- {/* The full name, on up to two lines (QA a); what it runs on is in the tooltip */}\n- <span data-bot-name className=\"min-w-0 text-body font-semibold leading-5 text-zinc-100 line-clamp-2 [overflow-wrap:anywhere]\" title={`${k.name} · ${engineTip(k.preferred_model)}`}>\n+ {/* The full name, on up to two lines (QA a), wrapping only between words or after a hyphen:\n+ never inside a word (\"Researche / r\"). A word too long for the line ends in \"…\"; the\n+ whole name and what it runs on are in the tooltip */}\n+ <span data-bot-name className=\"min-w-0 text-body font-semibold leading-5 text-zinc-100 line-clamp-2 [overflow-wrap:normal] [word-break:normal] text-ellipsis\" title={`${k.name} · ${engineTip(k.preferred_model)}`}>\n {k.name}\n </span>\n {isLead && (\n@@ -394,13 +401,19 @@ export const Sidebar: React.FC<SidebarProps> = ({\n lead\n </span>\n )}\n- {needsYou[k.id] > 0 && (\n+ {/* Compact on the name line (the hand, and a count past one), so it never squeezes the name;\n+ the words \"Needs you in the browser\" are on the status line below */}\n+ {needs > 0 && (\n <span\n- className=\"shrink-0 inline-flex items-center gap-1 px-1.5 py-px rounded-full text-2xs font-medium bg-amber-300/10 text-warn border border-amber-300/30\"\n- title={`${k.name} needs you in the browser`}\n+ data-bot-needs-you={needs}\n+ role=\"img\"\n+ // Mira's compact pill: 20 px high, hand 14 px, count 12 px/600 in tabular figures; flat amber, never holographic\n+ className=\"shrink-0 inline-flex items-center gap-1 h-5 px-1.5 rounded-full text-[12px] font-semibold tabular-nums leading-none text-[#fbbf24] bg-[rgba(251,191,36,0.12)] border border-[rgba(251,191,36,0.35)]\"\n+ title={needsTip}\n+ aria-label={`Needs you (${needs})`}\n >\n- <Hand size={10} aria-hidden=\"true\" />\n- Needs you{needsYou[k.id] > 1 ? ` · ${needsYou[k.id]}` : ''}\n+ <Hand size={14} aria-hidden=\"true\" />\n+ <span aria-hidden=\"true\">{needs}</span>\n </span>\n )}\n {/* The space header already says when approvals are off for everyone: a bot only gets its own mark when it differs */}\n@@ -451,13 +464,14 @@ export const Sidebar: React.FC<SidebarProps> = ({\n </span>\n )}\n </div>\n- {busyKwants[k.id] ? (\n- <p className={`flex items-center gap-1.5 text-meta truncate${actionRoom} ${status === 'needs_you' ? 'text-warn' : status === 'queued' ? 'text-zinc-300' : 'text-[#b8adff]'}`} title={busyKwants[k.id]} data-bot-busy>\n- <span className={`kw-status-dot !h-1.5 !w-1.5 ${status === 'needs_you' ? 'kw-status-warn' : status === 'queued' ? 'kw-status-idle' : 'bg-[#9d8fff] kw-pulse'}`} aria-hidden=\"true\" />\n- <span className=\"truncate\">{busyKwants[k.id]}</span>\n+ {busyLine ? (\n+ <p className={`flex items-center gap-1.5 text-meta truncate${actionRoom} ${warn ? 'text-warn' : status === 'queued' ? 'text-zinc-300' : 'text-[#b8adff]'}`} title={busyLine} data-bot-busy>\n+ <span className={`kw-status-dot !h-1.5 !w-1.5 ${warn ? 'kw-status-warn' : status === 'queued' ? 'kw-status-idle' : 'bg-[#9d8fff] kw-pulse'}`} aria-hidden=\"true\" />\n+ <span className=\"truncate\">{busyLine}</span>\n </p>\n ) : (\n- <p className={`text-meta text-zinc-400 truncate${actionRoom}`}>{k.title}</p>\n+ // Keeps its one line even with no title, so Edit and Remove sit under the name, never on it (#290 N1)\n+ <p className={`text-meta text-zinc-400 truncate${actionRoom}${!phone && hasRowActions ? ' min-h-[1.125rem]' : ''}`}>{k.title}</p>\n )}\n </div>\n {/* Phones: one button at the row's end; in a team it opens the member's actions */}",
"previous_path": null
},
{
"path": "frontend/tests/ia.test.mjs",
"status": "modified",
"additions": 2,
"deletions": 1,
"patch": "@@ -249,7 +249,8 @@ test('QA a: a long bot name wraps to two lines instead of cutting off at ~20 cha\n assert.ok(names.length >= 4, `every bot row has a name (phone=${phone})`);\n for (const [, cls, name] of names) {\n assert.match(cls, /\\bline-clamp-2\\b/, name);\n- assert.match(cls, /overflow-wrap:anywhere/, `${name}: a name with no spaces still breaks`);\n+ assert.doesNotMatch(cls, /overflow-wrap:anywhere|break-all|break-words/, `${name}: wraps between words, never inside one`);\n+ assert.match(cls, /\\btext-ellipsis\\b/, `${name}: a word too long for the line ends in …`);\n assert.doesNotMatch(cls, /\\btruncate\\b/, name);\n }\n assert.ok(names.some(([, , n]) => n === long), 'the team member row shows the whole name');",
"previous_path": null
},
{
"path": "frontend/tests/nameWrap.test.mjs",
"status": "added",
"additions": 104,
"deletions": 0,
"patch": "@@ -0,0 +1,104 @@\n+// A bot's name in the sidebar wraps only between words (or after a hyphen), never inside a word:\n+// \"Researche / r\" next to the \"Needs you\" pill (Oleks, 0.6.11). The pill on the name line is the\n+// compact hand (plus a count past one); the words go on the status line. No row grows on hover, and\n+// a bot with no title keeps a status line so Edit and Remove never sit on a two-line name (#290 N1).\n+import assert from 'node:assert/strict';\n+import test from 'node:test';\n+import { readFileSync } from 'node:fs';\n+import { JSDOM } from 'jsdom';\n+import { loadBundled } from './bundle.mjs';\n+\n+const dom = new JSDOM('<!doctype html><html><body></body></html>', { url: 'http://localhost/', pretendToBeVisual: true });\n+for (const k of ['window', 'document', 'navigator', 'HTMLElement', 'Node', 'DOMParser', 'localStorage', 'sessionStorage', 'getComputedStyle']) {\n+ if (k in dom.window) Object.defineProperty(globalThis, k, { value: dom.window[k], configurable: true, writable: true });\n+}\n+\n+const m = await loadBundled(`\n+ export { default as React } from 'react';\n+ export { renderToStaticMarkup } from 'react-dom/server.browser';\n+ export { Sidebar } from './src/components/Sidebar';\n+`);\n+const { React } = m;\n+const noop = () => {};\n+const space = { id: 'spc_default', name: 'Default', icon: '💼', color: '#f59e0b', sort: 0, is_default: true, archived_at: null,\n+ created_at: '', general_channel_id: null, counts: { bots: 0, ready_accounts: 0, unread: 0 }, approvals: 'on' };\n+const bot = (id, name, title = 'Role', over = {}) => ({ id, name, title, persona_prompt: '', avatar_sprite: 'mouse', driver_type: 'claude', preferred_model: '', ...over });\n+const NAMES = ['Researcher', 'Booktun.ing Marketer', 'Low content book trending and low competetive idea finder', 'Abcdefghijklmnopqrstuvwxyzabcd'];\n+const kwants = [...NAMES.map((n, i) => bot(`k${i}`, n)), bot('k9', 'Untitled Researcher Bot', '')];\n+const team = { id: 't1', name: 'Ship', icon: '🚢', lead_kwant_id: 'k0', member_kwants: ['k0', 'k1', 'k9'] };\n+const render = (over = {}) => m.renderToStaticMarkup(React.createElement(m.Sidebar, {\n+ space, spaces: [space], onSwitchSpace: noop, onCreateSpace: noop, onOpenSpaceSettings: noop, onOpenArchived: noop, onOpenSearch: noop,\n+ kwants, channels: [], teams: [team], selectedId: '', isChannel: true, onSelectKwant: noop, onSelectChannel: noop, onSelectTeam: noop,\n+ onSummonKwant: noop, onCreateTeam: noop, onOpenInbox: noop, onOpenParallel: noop, onOpenMissions: noop, missionBoard: true,\n+ onEditKwant: noop, onUpdateTeamMembers: noop, needsYou: { k0: 1, k1: 2, k2: 1, k3: 3 }, ...over,\n+}));\n+const doc = (html) => new DOMParser().parseFromString(`<body>${html}</body>`, 'text/html');\n+// Every class that lets a browser break inside a word\n+const MID_WORD = /overflow-wrap:anywhere|overflow-wrap:break-word|word-break:break-all|word-break:break-word|\\bbreak-all\\b|\\bbreak-words\\b|\\bhyphens-auto\\b/;\n+\n+\n+for (const phone of [false, true]) {\n+ test(`a name never breaks inside a word, on up to two lines, ending in … if a word is too long (phone=${phone})`, () => {\n+ const d = doc(render({ phone }));\n+ const names = [...d.querySelectorAll('[data-bot-name]')];\n+ assert.ok(names.length >= kwants.length, 'every bot row has a name');\n+ for (const el of names) {\n+ const cls = el.getAttribute('class');\n+ assert.doesNotMatch(cls, MID_WORD, `${el.textContent}: no mid-word break class`);\n+ assert.match(cls, /\\[overflow-wrap:normal\\]/, el.textContent);\n+ assert.match(cls, /\\[word-break:normal\\]/, el.textContent);\n+ assert.match(cls, /\\bline-clamp-2\\b/, el.textContent);\n+ assert.match(cls, /\\btext-ellipsis\\b/, el.textContent);\n+ assert.doesNotMatch(cls, /\\btruncate\\b|whitespace-nowrap/, `${el.textContent}: still wraps between words`);\n+ assert.match(el.getAttribute('title'), new RegExp(`^${el.textContent.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&')} · `), 'the whole name is in the tooltip');\n+ }\n+ // Nothing on the name line lets the name's parents break words either\n+ for (const line of d.querySelectorAll('[data-bot-name-line]')) assert.doesNotMatch(line.getAttribute('class'), MID_WORD);\n+ });\n+\n+ test(`the Needs you pill on the name line is the hand and a count, and the status line says it in words (phone=${phone})`, () => {\n+ const d = doc(render({ phone }));\n+ const pills = [...d.querySelectorAll('[data-bot-needs-you]')];\n+ assert.ok(pills.length >= 4, 'every bot with an open step has the pill');\n+ for (const p of pills) {\n+ const row = p.closest('[data-bot-row]');\n+ const name = row.querySelector('[data-bot-name]').textContent;\n+ const n = Number(p.getAttribute('data-bot-needs-you'));\n+ assert.equal(p.getAttribute('aria-label'), `Needs you (${n})`);\n+ assert.equal(p.getAttribute('title'), `${name} needs you in the browser`);\n+ assert.doesNotMatch(p.textContent, /Needs you/, 'no words on the name line');\n+ assert.equal(p.textContent, String(n), 'the hand and its count');\n+ assert.match(p.getAttribute('class'), /\\bshrink-0\\b/);\n+ for (const c of ['h-5', 'px-1.5', 'gap-1', 'rounded-full', 'text-[12px]', 'font-semibold', 'tabular-nums', 'text-[#fbbf24]', 'bg-[rgba(251,191,36,0.12)]', 'border-[rgba(251,191,36,0.35)]'])\n+ assert.ok(p.getAttribute('class').split(' ').includes(c), `pill spec: ${c}`);\n+ assert.doesNotMatch(p.getAttribute('class'), /holo/, 'never holographic');\n+ assert.match(p.innerHTML, /width=\"14\"/, 'hand 14 px');\n+ const status = row.querySelector('[data-bot-busy]');\n+ assert.ok(status, `${name}: a status line`);\n+ assert.equal(status.textContent, 'Needs you in the browser');\n+ assert.match(status.getAttribute('class'), /\\btext-warn\\b/);\n+ }\n+ });\n+}\n+\n+test('a bot that needs you because its chat waits on the browser keeps where (no doubled words)', () => {\n+ const d = doc(render({ busyKwants: { k0: 'Needs you in the browser in Engineering Room', k1: 'Working here' } }));\n+ const line = (id) => d.querySelector(`[data-bot-row=\"${id}\"] [data-bot-busy]`).textContent;\n+ assert.equal(line('k0'), 'Needs you in the browser in Engineering Room');\n+ assert.equal(line('k1'), 'Needs you in the browser', 'an open step outranks \"Working\" while it is open');\n+ const free = doc(render({ needsYou: {}, busyKwants: { k1: 'Working here' } }));\n+ assert.equal(free.querySelector('[data-bot-row=\"k1\"] [data-bot-busy]').textContent, 'Working here', 'back to the normal status once done');\n+ assert.equal(free.querySelectorAll('[data-bot-needs-you]').length, 0);\n+});\n+\n+test('hover and focus never change the name line, and a bot with no title still reserves its status line (#290 N1)', () => {\n+ const d = doc(render({}));\n+ for (const line of d.querySelectorAll('[data-bot-name-line]')) assert.doesNotMatch(line.getAttribute('class'), /group-(hover|focus-within)\\//, 'the name line has no hover/focus classes');\n+ for (const el of d.querySelectorAll('[data-bot-name], [data-bot-needs-you]')) assert.doesNotMatch(el.getAttribute('class'), /group-(hover|focus-within)\\//);\n+ const row = d.querySelector('[data-bot-row=\"k9\"]');\n+ const status = row.querySelector('[data-bot-name-line] + p');\n+ assert.equal(status.textContent, '');\n+ assert.match(status.getAttribute('class'), /min-h-\\[1\\.125rem\\]/, 'one text-meta line high even with no title');\n+ const src = readFileSync(new URL('../tailwind.config.js', import.meta.url), 'utf8');\n+ assert.match(src, /meta: \\['0\\.75rem', \\{ lineHeight: '1\\.125rem' \\}\\]/, 'the reserved height is text-meta\\'s line height');\n+});",
"previous_path": null
}
],
"cut": null,
"checks": [
{
"name": "rust",
"status": "completed",
"conclusion": "success",
"url": "https://github.com/alexsergivan/kwant/actions/runs/41929248024/job/126922241066"
},
{
"name": "frontend",
"status": "completed",
"conclusion": "success",
"url": "https://github.com/alexsergivan/kwant/actions/runs/41929248024/job/126921631594"
},
{
"name": "site",
"status": "completed",
"conclusion": "success",
"url": "https://github.com/alexsergivan/kwant/actions/runs/41929248024/job/126921631150"
}
],
"ci": "green",
"task": null,
"first_edit_files": [],
"draft": false,
"head_branch": "pixel-name-wrap",
"links": {
"pr": "https://github.com/alexsergivan/kwant/pull/301",
"commit": "https://github.com/alexsergivan/kwant/commit/fd51f46faf1d6e6cf79b39058c56ec39706346b7",
"ci": "https://github.com/alexsergivan/kwant/actions/runs/41929248024/job/126922241066"
}
}