Skip to content

armgit / kwant

Public Imported from GitHub
0

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.

0.8.0: desktop working strip as the composer's status line (#464)

Oleksandr Ivanchenkoda0325910f39
diff --git a/frontend/src/components/ChatView.tsx b/frontend/src/components/ChatView.tsx
index d0223304..5031f0e6 100644
--- a/frontend/src/components/ChatView.tsx
+++ b/frontend/src/components/ChatView.tsx
@@ -706,6 +706,22 @@ export const ChatView: React.FC<ChatViewProps> = ({
card.scrollIntoView({ block: 'end', behavior: reduce ? 'auto' : 'smooth' });
setApprovalOffscreen(false);
};
+ // The running turn's summary line (WorkingStrip): above the composer section on a phone, inside it on desktop.
+ const workingStrip = (
+ <WorkingStrip
+ active={isStreaming}
+ name={discussionState?.inProgress && discussionState.currentSpeaker ? discussionState.currentSpeaker : streamingSpeakerName || title}
+ title={title}
+ live={liveActivity}
+ queued={!!queued}
+ awaitingAnswer={!!awaitingAnswer}
+ awaitingBrowser={!!awaitingBrowser}
+ writing={!!streamingText}
+ onAnswer={showWaitingCard}
+ onWatch={onWatchBrowser && !vmOpen ? onWatchBrowser : undefined}
+ phone={phone}
+ />
+ );
// Cards are last in the stream. While the person follows the chat, keep the bottom pinned when a
// card grows after it appears (its details arrive from the server) or the composer grows and
// shrinks the stream, so Deny / Allow never sit below the composer.
@@ -1858,18 +1874,8 @@ export const ChatView: React.FC<ChatViewProps> = ({
</ScrollRow>
)}
- <WorkingStrip
- active={isStreaming}
- name={discussionState?.inProgress && discussionState.currentSpeaker ? discussionState.currentSpeaker : streamingSpeakerName || title}
- title={title}
- live={liveActivity}
- queued={!!queued}
- awaitingAnswer={!!awaitingAnswer}
- awaitingBrowser={!!awaitingBrowser}
- writing={!!streamingText}
- onAnswer={showWaitingCard}
- onWatch={onWatchBrowser && !vmOpen ? onWatchBrowser : undefined}
- />
+ {/* Phone: its quiet line sits above the composer section. Desktop: inside it, right above the box. */}
+ {phone && workingStrip}
{/* Modern Composer Input Bar */}
<div
@@ -1958,6 +1964,8 @@ export const ChatView: React.FC<ChatViewProps> = ({
</div>
)}
+ {!phone && workingStrip}
+
<form
onSubmit={handleSubmit}
{...dropHandlers}
diff --git a/frontend/src/components/WatchLive.tsx b/frontend/src/components/WatchLive.tsx
index ef67b747..23aebb2e 100644
--- a/frontend/src/components/WatchLive.tsx
+++ b/frontend/src/components/WatchLive.tsx
@@ -101,7 +101,9 @@ export const GlobeSlot: React.FC<{ browsing?: Browsing | null; name: string; pho
};
/** W1: "Watch" on the working strip while this chat's browser is active and the panel is closed. */
-export const WatchButton: React.FC<{ name: string; phone?: boolean; onWatch: () => void }> = ({ name, phone, onWatch }) => (
+/** phone: the phone strip's muted 28 px button. line: the desktop status line's (28 px, -mr-2 so the word
+ * ends where the composer's Stop square does). Otherwise the 32 px desktop button. */
+export const WatchButton: React.FC<{ name: string; phone?: boolean; line?: boolean; onWatch: () => void }> = ({ name, phone, line, onWatch }) => (
<button
type="button"
data-watch-button=""
@@ -111,7 +113,9 @@ export const WatchButton: React.FC<{ name: string; phone?: boolean; onWatch: ()
className={
phone
? `textbtn kws-hit -mr-2 shrink-0 inline-flex h-7 items-center gap-1 rounded-md px-2 text-xs font-medium text-zinc-400 hover:bg-zinc-800 hover:text-zinc-200 ${FOCUS}`
- : `textbtn shrink-0 inline-flex items-center gap-1 rounded-lg px-2 font-medium text-[#b8adff] hover:bg-[rgb(157_143_255/.10)] min-h-8 text-xs ${FOCUS}`
+ : line
+ ? `textbtn -mr-2 shrink-0 inline-flex h-7 items-center gap-1 rounded-md px-2 font-medium text-[#b8adff] hover:bg-[rgb(157_143_255/.10)] text-xs ${FOCUS}`
+ : `textbtn shrink-0 inline-flex items-center gap-1 rounded-lg px-2 font-medium text-[#b8adff] hover:bg-[rgb(157_143_255/.10)] min-h-8 text-xs ${FOCUS}`
}
>
<Eye size={phone ? 12 : 13} aria-hidden="true" />
diff --git a/frontend/src/components/WorkingStrip.tsx b/frontend/src/components/WorkingStrip.tsx
index 722d9141..688f26c7 100644
--- a/frontend/src/components/WorkingStrip.tsx
+++ b/frontend/src/components/WorkingStrip.tsx
@@ -18,8 +18,8 @@ interface WorkingStripProps {
writing?: boolean;
onStop?: () => void;
/**
- * Phone only: brings the card the bot waits on (its question, or an approval) into view. With it,
- * a waiting strip shows "Answer ↑", which stands in for the separate "Approval waiting" pill.
+ * Brings the card the bot waits on into view. With it, a waiting strip shows "Answer ↑": on a phone for a
+ * question or an approval (standing in for the "Approval waiting" pill), on desktop for a question only.
*/
onAnswer?: (on: 'question' | 'approval') => void;
/** W1: this chat's browser is active and the panel is closed: "Watch" opens it. */
@@ -34,6 +34,8 @@ interface WorkingStripProps {
* line (0.6.13 spec A3), kept quiet (0.7.5): a plain ~28 px line, no card, 12 px text and a 16 px avatar,
* with space below it so it never touches the composer. "Answer ↑" is the one thing with emphasis while
* the bot waits on the person. Its buttons stay 28 px tall but tap like 44 px (kws-hit in modern.css).
+ * On desktop (0.8.0) it is the same kind of quiet line at desktop size, placed inside the composer section
+ * (ChatView renders it there), lined up with the composer box below it.
*/
export const WorkingStrip: React.FC<WorkingStripProps> = ({ active, name, title, live, queued, awaitingAnswer, awaitingBrowser, writing, onStop, onAnswer, onWatch, phone: forcePhone }) => {
const mountedAt = useRef(Date.now());
@@ -54,7 +56,8 @@ export const WorkingStrip: React.FC<WorkingStripProps> = ({ active, name, title,
const elapsed = formatElapsed(now - turnStart(live, mountedAt.current));
const on = waitingOn(state);
const waiting = !!queued || !!awaitingAnswer || on !== null;
- const answer = phone && on && onAnswer ? on : null;
+ // Desktop shows Answer only for a question: approvals already have the "Approval waiting" pill there.
+ const answer = on && onAnswer && (phone || on === 'question') ? on : null;
if (phone) {
return (
<div className="kws-strip kws-strip-phone px-3 pt-1 pb-1.5" data-working-strip="" data-waiting-on={on ?? undefined}>
@@ -105,32 +108,52 @@ export const WorkingStrip: React.FC<WorkingStripProps> = ({ active, name, title,
</div>
);
}
+ // Desktop (0.8.0, Oleks 2026-11-09): the composer's status line, inside the composer section right
+ // above its box, in the same max-w-4xl column. No card: one quiet 28 px line like the phone's. Its
+ // edges follow the box below: 21 px in (the box's 1 px border + 8 px padding + the field's 12 px
+ // inset), so the avatar starts where the placeholder text does, and 9 px in on the right, so the
+ // last item ends where the Stop square does. mb-2 keeps 8 px to the box.
return (
- <div className="kws-strip px-3 sm:px-6 pt-2" data-working-strip="" data-waiting-on={on ?? undefined}>
- <div className="mx-auto flex max-w-4xl items-center rounded-xl border border-zinc-700/60 bg-zinc-900/80 shadow-[var(--kws-shadow)] gap-3 px-3 py-1.5">
- <span className={`shrink-0 inline-flex ${waiting ? '' : 'kw-avatar-working'}`}>
- <ModernAvatar role={title} name={name} size={24} />
- </span>
- <p className="min-w-0 flex-1 truncate text-xs text-zinc-300" role="status" aria-live="polite">
- <span className="font-semibold text-zinc-100">{name}</span> is {label}
- </p>
- {/* Own box, so a long step name never cuts the time off. */}
- <span className="shrink-0 tabular-nums text-meta text-zinc-400" aria-hidden="true" data-working-elapsed="">
+ <div
+ className="kws-strip kws-strip-line mx-auto mb-2 flex h-7 max-w-4xl items-center gap-2 pl-[21px] pr-[9px]"
+ data-working-strip=""
+ data-waiting-on={on ?? undefined}
+ >
+ <span className={`shrink-0 inline-flex ${waiting ? '' : 'kw-avatar-working'}`}>
+ <ModernAvatar role={title} name={name} size={20} />
+ </span>
+ <p className="min-w-0 flex-1 truncate text-xs leading-4 text-zinc-400" role="status" aria-live="polite">
+ <span className="font-medium text-zinc-200">{name}</span> is {label}
+ </p>
+ {/* Own box, so a long step name never cuts the time off. Hidden behind Answer, as on the phone. */}
+ {!answer && (
+ <span className="shrink-0 tabular-nums text-xs leading-4 text-zinc-500" aria-hidden="true" data-working-elapsed="">
{elapsed}
</span>
- {onWatch && <WatchButton name={name} onWatch={onWatch} />}
- {onStop && (
- <button
- type="button"
- onClick={onStop}
- title="Stop"
- className="shrink-0 inline-flex items-center gap-1.5 min-h-8 rounded-lg border border-zinc-600/70 px-2.5 text-xs font-medium text-zinc-200 hover:bg-zinc-800 hover:text-zinc-50 active:scale-[0.97] motion-reduce:active:scale-100 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sky-400"
- >
- <Square size={12} className="fill-current" aria-hidden="true" />
- Stop
- </button>
- )}
- </div>
+ )}
+ {onWatch && !answer && <WatchButton name={name} line onWatch={onWatch} />}
+ {answer && (
+ <button
+ type="button"
+ onClick={() => onAnswer?.(answer)}
+ data-strip-answer=""
+ className="-mr-2 shrink-0 inline-flex h-7 items-center gap-1 rounded-md px-2 text-xs font-semibold text-amber-200 hover:bg-amber-500/10 active:bg-amber-500/15 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[#b8adff]"
+ >
+ Answer
+ <ArrowUp size={12} aria-hidden="true" />
+ </button>
+ )}
+ {onStop && (
+ <button
+ type="button"
+ onClick={onStop}
+ title="Stop"
+ className="-mr-2 shrink-0 inline-flex h-7 items-center gap-1 rounded-md px-2 text-xs font-medium text-zinc-400 hover:bg-zinc-800 hover:text-zinc-200 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sky-400"
+ >
+ <Square size={10} className="fill-current" aria-hidden="true" />
+ Stop
+ </button>
+ )}
</div>
);
};
diff --git a/frontend/src/styles/modern.css b/frontend/src/styles/modern.css
index 016df687..3b53dd97 100644
--- a/frontend/src/styles/modern.css
+++ b/frontend/src/styles/modern.css
@@ -155,8 +155,9 @@
width: 100%;
}
-/* The phone strip's working avatar: a softer, slower bob than in the stream. */
-.kws-strip-phone .kw-avatar-working .kw-avatar-body {
+/* The phone strip's and desktop status line's working avatar: a softer, slower bob than in the stream. */
+.kws-strip-phone .kw-avatar-working .kw-avatar-body,
+.kws-strip-line .kw-avatar-working .kw-avatar-body {
animation-duration: 1.6s;
}
diff --git a/frontend/tests/mobileCards.test.mjs b/frontend/tests/mobileCards.test.mjs
index 6908b6e8..48984247 100644
--- a/frontend/tests/mobileCards.test.mjs
+++ b/frontend/tests/mobileCards.test.mjs
@@ -197,16 +197,44 @@ test('waiting on a question, the strip says so and offers Answer, which goes to
assert.match(answer.attrs, /text-xs font-semibold text-amber-200/);
assert.match(answer.attrs, /data-strip-answer/);
assert.doesNotMatch(html, /data-working-elapsed/, 'the time hides behind Answer');
- // Desktop keeps its old strip: no Answer button there.
- assert.ok(!buttons(m.strip({ active: true, name: 'QA', title: 'QA', awaitingAnswer: true, phone: false, onAnswer: noop })).some((b) => b.label === 'Answer'));
+ // Desktop (Mira, 0.8.0): Answer for a question only, in place of the time; no kws-hit there.
+ const desk = m.strip({ active: true, name: 'QA', title: 'QA', awaitingAnswer: true, phone: false, onAnswer: noop });
+ const dAnswer = buttons(desk).find((b) => b.label === 'Answer');
+ assert.ok(dAnswer, 'desktop Answer for a question');
+ for (const c of ['-mr-2', 'h-7', 'font-semibold', 'text-amber-200', 'outline-[#b8adff]']) assert.ok(dAnswer.attrs.includes(c), c);
+ assert.doesNotMatch(desk, /kws-hit|data-working-elapsed/);
+ const approval = m.strip({ active: true, name: 'QA', title: 'QA', live: live([step({ kind: 'approval', status: 'waiting', title: 'Approve' })]), phone: false, onAnswer: noop });
+ assert.ok(!buttons(approval).some((b) => b.label === 'Answer'), 'approvals keep the pill on desktop');
});
-test('desktop strip is unchanged: the bordered card, 24 px avatar, no hit-area classes', () => {
- const html = m.strip({ active: true, name: 'Architect', title: 'Architect', live: live([step()]), onStop: noop, phone: false });
- assert.match(html, /<div class="kws-strip px-3 sm:px-6 pt-2" data-working-strip="">/);
- assert.match(html, /rounded-xl border border-zinc-700\/60 bg-zinc-900\/80 shadow-\[var\(--kws-shadow\)\] gap-3 px-3 py-1\.5/);
- assert.match(html, /style="width:24px;height:24px"/);
- assert.doesNotMatch(html, /kws-hit|data-compact|kws-strip-phone|-mr-2/);
+test('desktop strip is the composer status line: no card, 28 px, 20 px avatar, edges on the box below (0.8.0)', () => {
+ const html = m.strip({ active: true, name: 'Architect', title: 'Architect', live: live([step()]), onWatch: noop, phone: false });
+ const wrap = /<div class="(kws-strip[^"]*)" data-working-strip="">/.exec(html)[1].split(' ');
+ // Same column as the composer box; 21 px = its 1 px border + 8 px padding + the field's 12 px inset,
+ // 9 px = border + padding up to the Stop square; 8 px to the box below.
+ for (const c of ['kws-strip-line', 'mx-auto', 'max-w-4xl', 'h-7', 'gap-2', 'pl-[21px]', 'pr-[9px]', 'mb-2']) assert.ok(wrap.includes(c), c);
+ assert.doesNotMatch(html, /rounded-xl|border-zinc-700|bg-zinc-900|kws-shadow|kws-strip-phone|kws-hit|data-compact/);
+ assert.match(html, /style="width:20px;height:20px"/);
+ assert.match(html, /role="status" aria-live="polite"/);
+ assert.match(html, /<span class="font-medium text-zinc-200">Architect<\/span> is/);
+ assert.match(html, /class="shrink-0 tabular-nums text-xs leading-4 text-zinc-500"[^>]*data-working-elapsed=""/);
+ // Watch is the right-most item: 28 px, and its word ends where the Stop square does.
+ const watch = /<button[^>]*data-watch-button=""[^>]*>/.exec(html)[0];
+ for (const c of ['h-7', ' -mr-2 ', 'text-xs', 'text-[#b8adff]']) assert.ok(watch.includes(c), c);
+ assert.doesNotMatch(watch, /min-h-8/);
+});
+
+test('ChatView puts the desktop strip inside the composer section, right above the box; the phone keeps its place', () => {
+ const src = readFileSync(new URL('../src/components/ChatView.tsx', import.meta.url), 'utf8');
+ const phoneAt = src.indexOf('{phone && workingStrip}');
+ const sectionAt = src.indexOf('{/* Modern Composer Input Bar */}');
+ const deskAt = src.indexOf('{!phone && workingStrip}');
+ const formAt = src.indexOf('<form', deskAt);
+ assert.ok(phoneAt > 0 && phoneAt < sectionAt, 'phone line above the composer section');
+ assert.ok(deskAt > sectionAt, 'desktop line inside the composer section');
+ assert.ok(src.indexOf('aria-label="Ask a member"', sectionAt) < deskAt, 'below the Ask chips');
+ assert.equal(src.slice(deskAt + '{!phone && workingStrip}'.length, formAt).trim(), '', 'directly above the box');
+ assert.equal(src.match(/<WorkingStrip\b/g).length, 1, 'one element, placed by layout');
});
test('on a phone the steps panel is one 44 px row, the engine note behind an info button', () => {