Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions scripts/web-layout.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -545,3 +545,45 @@ test('every face of the chats panel scrolls to its last row, and the phone drawe
served.close()
}
})

// The tab over the composer's top edge holds the linked task and the queued
// messages. It sits on the box and is one tab: the queue used to be a second tab
// tucked 22px under the box, which is see-through, so the tucked lip showed
// through the top of the box as a dark band. This draws the real Composer,
// TaskBar and QueuedMessages (web/src/chat/ComposerTab.harness.tsx).
test('the task and the queue share one tab that sits on the composer, never under it', { skip: !executablePath || !esbuild }, async () => {
const todo = { id: 'k1', title: 'Fictional task to install a connector', description: '', area: 'Personal', ventureTag: null, status: 'todo', priority: 1, dueDate: new Date().toISOString().slice(0, 10), recurrence: null,
snoozedUntil: null, position: 0, createdAt: ago(48), updatedAt: ago(1), completedAt: null, outcome: null, archivedAt: null, deletedAt: null,
tags: [], notes: [], relations: [], lists: [], externalLinks: [], issueLink: null, folderId: null }
const api = (url) => url.split('?')[0] === '/api/todos/board' ? { counts: { archived: 0, snoozed: 0, deleted: 0 }, todos: [todo] } : null
const served = await serveHarness({ entry: 'chat/ComposerTab.harness.tsx', styles: ['styles.css', 'shell.css', 'chat/chat.css', 'work/work.css'], api })
const browser = await chromium.launch({ executablePath })
try {
for (const v of ['both', 'task', 'queue', 'many']) {
for (const width of [1100, 390]) {
const where = `${v}, ${width}px`
const page = await browser.newPage({ viewport: { width, height: 500 } })
await page.goto(`${served.url}?v=${v}`)
if (v !== 'queue') await page.waitForFunction(() => document.querySelector('.wk-taskbar-title')?.textContent?.startsWith('Fictional'), null, { timeout: 10000 })
const got = await page.evaluate(() => {
const r = (e) => e && e.getBoundingClientRect()
const tab = document.querySelector('.vc-above')
const kids = [...tab.children].map((e) => { const b = r(e); const s = getComputedStyle(e); return { left: b.left, right: b.right, top: b.top, bottom: b.bottom, radius: s.borderTopLeftRadius, side: s.borderLeftWidth } })
return { tab: r(tab), box: r(document.querySelector('.vc-box')), kids }
})
assert.equal(got.kids.length, v === 'both' || v === 'many' ? 2 : 1, `${where}: one row per part`)
assert.ok(Math.abs(got.tab.bottom - got.box.top) <= 1, `${where}: the tab sits on the box (tab ends ${got.tab.bottom}, box starts ${got.box.top})`)
assert.ok(got.tab.left > got.box.left && got.tab.right < got.box.right, `${where}: the tab is inset from the box's corners`)
for (const k of got.kids) {
assert.ok(k.left >= got.tab.left && k.right <= got.tab.right, `${where}: a part runs the tab's width`)
assert.equal(k.side, '0px', `${where}: a part draws no tab of its own`)
}
for (let i = 1; i < got.kids.length; i++) assert.ok(Math.abs(got.kids[i].top - got.kids[i - 1].bottom) <= 1, `${where}: the parts stack with no gap`)
await page.close()
}
}
} finally {
await browser.close()
served.close()
}
})
46 changes: 46 additions & 0 deletions web/src/chat/ComposerTab.harness.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import React from 'react'
import { createRoot } from 'react-dom/client'
import Composer from './Composer'
import ContextMeter from './ContextMeter'
import QueuedMessages from './QueuedMessages'
import TaskBar from '../work/TaskBar'
import { loadWork } from '../work/state'
import type { ChatThread, QueuedMessage } from './types'

// Not part of the app: scripts/web-layout.test.mjs bundles this page and draws the
// real composer with the tab over its top edge (the linked task and the queued
// messages), with the real CSS, in each combination: `?v=both|task|queue|many`.
// The test feeds the task through a fictional /api/todos/board.

const noop = () => {}
const at = Date.now()
const queued = (n: number): QueuedMessage[] =>
['Fictional-errors.csv', 'Then check the second share too', 'And write up what changed'].slice(0, n).map((text, i) => ({ id: `q${i}`, text, createdAt: at + i }))
const v = new URLSearchParams(location.search).get('v') || 'both'
const task = v !== 'queue'
const queue = v === 'task' ? [] : queued(v === 'many' ? 3 : 1)
const thread = { id: 'fixture', taskId: task ? 'k1' : undefined } as unknown as ChatThread

function Harness() {
return (
<div className="vc" style={{ minHeight: '100vh', display: 'flex', flexDirection: 'column', justifyContent: 'flex-end' }}>
<div className="vc-dock">
<Composer
value="" onChange={noop} onSend={noop} onStop={noop} onSteer={() => true} onQueue={() => true} busy
placeholder="Steer this reply: add context or change course"
leftSlot={<ContextMeter s={{ used: 401_000, max: 1_000_000, percent: 40, autoCompactAt: null, tone: null, at }} />}
rightSlot={<span className="vc-model-group" style={{ color: 'var(--text)', fontSize: 14 }}>Fictional model · Medium</span>}
above={
<div className="vc-above">
<TaskBar thread={thread} draftTaskId={null} projectId={null} />
{queue.length > 0 && <QueuedMessages queue={queue} canSteer editingId={null} onEdit={noop} onCancelEdit={noop} onSteer={noop} onRemove={noop} onMove={noop} />}
</div>
}
/>
</div>
</div>
)
}

void loadWork()
createRoot(document.getElementById('root')!).render(<Harness />)
21 changes: 14 additions & 7 deletions web/src/chat/chat.css
Original file line number Diff line number Diff line change
Expand Up @@ -1835,16 +1835,23 @@ button.vc-file-row:hover, .vc-file-row:hover { background: var(--vc-raise); }
color: var(--accent); background: color-mix(in srgb, var(--accent) 15%, transparent);
}

/* Queued messages (QueuedMessages.tsx), T3 Code's drawer: a strip tucked under
the composer's top edge, the box drawn over its lower lip. */
.vc-queue {
position: relative; margin: 0 30px -22px; padding: 4px 6px 26px;
border: 1px solid #ffffff17; border-bottom: 0; border-radius: 16px 16px 0 0;
/* Over the composer's top edge, one tab holds the linked task (TaskBar.tsx) and
the queued messages (QueuedMessages.tsx), divided by a hairline. It sits on the
box, never tucked under it: the box is see-through, so a tucked lip showed
through it as a dark band. */
.vc-above {
position: relative; margin: 0 30px -1px; overflow: hidden;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep tab controls reachable in narrow desktop columns

When a desktop side panel or terminal squeezes the chat column while the viewport remains wider than 720px, the mobile rules that hide .wk-taskbar-label and .wk-taskbar-folder do not apply, so the task row can exceed the tab width. The newly added overflow: hidden then clips trailing controls such as Done and Change/unlink, making them unreachable; use container-based folding for this row or avoid clipping its interactive overflow.

AGENTS.md reference: AGENTS.md:L427-L427

Useful? React with 👍 / 👎.

border: 1px solid #ffffff17; border-bottom: 0; border-radius: 14px 14px 0 0;
background: color-mix(in srgb, var(--vc-surface) 70%, transparent);
font-size: 12px; line-height: 16px;
}
.vc.no-glow .vc-queue { background: var(--vc-surface); }
.vc-above:empty { display: none; }
.vc.no-glow .vc-above { background: var(--vc-surface); }
.vc-above > * + * { border-top: 1px solid #ffffff0f; }
.vc-composer > .vc-box { position: relative; z-index: 1; }
@media (max-width: 720px) { .vc-above { margin: 0 14px -1px; } }

/* Queued messages, T3 Code's drawer. */
.vc-queue { padding: 2px 6px 6px; font-size: 12px; line-height: 16px; }
.vc-queue-head {
display: flex; align-items: center; gap: 6px; width: 100%; padding: 4px 6px;
background: none; border: 0; color: var(--vc-soft); font: inherit; cursor: pointer; text-align: left;
Expand Down
2 changes: 1 addition & 1 deletion web/src/components/ChatView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ export default function ChatView({ onAuthError, visible = true, onOpenMenu, pane
followUp={followUp}
queueEdit={queueEdit && queueEdit.threadId === activeId ? { onSave: saveQueueEdit } : undefined}
onResume={!busy && active?.queueHeld && queue.length && activeId ? () => { void updateQueue(activeId, { action: 'resume' }) } : undefined}
above={<><TaskBar thread={active && !empty ? active : null} draftTaskId={active ? null : draftTaskId} projectId={project?.id || null} onShowPanel={onShowPanel} />{queueEl}</>}
above={<div className="vc-above"><TaskBar thread={active && !empty ? active : null} draftTaskId={active ? null : draftTaskId} projectId={project?.id || null} onShowPanel={onShowPanel} />{queueEl}</div>}
onVoice={() => setVoice(true)}
busy={busy}
autoFocus={visible}
Expand Down
9 changes: 3 additions & 6 deletions web/src/work/work.css
Original file line number Diff line number Diff line change
Expand Up @@ -158,14 +158,12 @@ button.wk-check:hover .wk-check-on { opacity: 1; transform: none; }
.wk-combo-search input { font-size: 16px; }
}

/* --- the task strip over the composer (TaskBar.tsx): a tab sitting on the box's top edge --- */
/* --- the task strip over the composer (TaskBar.tsx): the first row of the tab on
the box's top edge (.vc-above in chat.css draws the tab) --- */
.wk-taskbar {
position: relative; display: flex; align-items: center; gap: 6px; margin: 0 30px -1px; padding: 4px 8px 5px 10px;
border: 1px solid #ffffff17; border-bottom: 0; border-radius: 14px 14px 0 0;
background: color-mix(in srgb, var(--vc-surface, var(--surface)) 70%, transparent);
position: relative; display: flex; align-items: center; gap: 6px; padding: 4px 8px 5px 12px;
font-size: 12.5px; line-height: 18px; color: var(--vc-soft, var(--muted));
}
.vc.no-glow .wk-taskbar { background: var(--vc-surface, var(--surface)); }
.wk-taskbar .ti { flex: none; }
.wk-taskbar-icon { color: var(--accent); }
.wk-taskbar-label { flex: none; color: var(--vc-faint, var(--muted)); }
Expand All @@ -182,7 +180,6 @@ button.wk-check:hover .wk-check-on { opacity: 1; transform: none; }
}
.wk-taskbar-btn:hover { background: var(--vc-raise, var(--raise)); color: var(--text); }
@media (max-width: 720px) {
.wk-taskbar { margin: 0 14px -1px; }
.wk-taskbar-label { display: none; }
.wk-taskbar-btn { height: 32px; min-width: 32px; }
}
Expand Down
Loading