From 3b7a637ea3e01644ddc990422983960b03de7388 Mon Sep 17 00:00:00 2001 From: Jamie Asefa <13409617+j-asefa@users.noreply.github.com> Date: Sat, 21 Nov 2026 10:18:18 +0000 Subject: [PATCH 1/4] v0.3.0 2/3: Mobile-first Feed polish, one-tap Done closure, and composer agent pills --- .../profile-photos-recipient-smoke.mjs | 13 +- scripts/helpers/workspace-project-smoke.mjs | 25 +++ src/client/Feed.tsx | 25 +++ src/client/app/Composer.tsx | 161 ++++++++++++------ src/client/design.css | 108 +++++++++++- 5 files changed, 275 insertions(+), 57 deletions(-) diff --git a/scripts/helpers/profile-photos-recipient-smoke.mjs b/scripts/helpers/profile-photos-recipient-smoke.mjs index e4004463..8621a6cb 100644 --- a/scripts/helpers/profile-photos-recipient-smoke.mjs +++ b/scripts/helpers/profile-photos-recipient-smoke.mjs @@ -32,7 +32,18 @@ export async function profilePhotosRecipientSmoke(page, fixture) { await page .getByRole("button", { name: "Compose a message", exact: true }) .click(); - await page.getByLabel("Agent recipient").selectOption(second.id); + // Quick recipient pills mirror the recipient picker with one tap. + const pills = page.getByRole("group", { + name: "Quick recipient", + exact: true, + }); + await pills + .getByRole("button", { name: `@${second.name}`, exact: true }) + .click(); + await expect(page.getByLabel("Agent recipient")).toHaveValue(second.id); + await expect( + pills.getByRole("button", { name: `@${second.name}`, exact: true }), + ).toHaveAttribute("aria-pressed", "true"); await page .getByLabel("Message your agent", { exact: true }) .fill("Remember this recipient"); diff --git a/scripts/helpers/workspace-project-smoke.mjs b/scripts/helpers/workspace-project-smoke.mjs index 01697d59..72b8b0a2 100644 --- a/scripts/helpers/workspace-project-smoke.mjs +++ b/scripts/helpers/workspace-project-smoke.mjs @@ -89,6 +89,31 @@ export async function workspaceProjectSmoke(page, fixture, _engine, capture) { await expect(reading).toContainText("Workspace notes are ready."); await reading.getByRole("button", { name: "Close", exact: true }).click(); await expect(reading).toHaveCount(0); + // One-tap Done clears a sealed result from Done (both on the card and from + // the reading sheet) and restores it cleanly via Undo. + const doneCard = page + .locator(".feed-results .feed-item-card") + .filter({ hasText: title }); + const dismissedToast = page + .getByRole("status") + .filter({ hasText: "Removed from Done" }); + await doneCard.getByRole("button", { name: "Done", exact: true }).click(); + await expect(doneCard).toHaveCount(0); + await expect(dismissedToast).toBeVisible(); + await dismissedToast + .getByRole("button", { name: "Undo", exact: true }) + .click(); + await expect(doneCard).toHaveCount(1); + await doneCard.getByRole("button", { name: title }).click(); + await expect(reading).toBeVisible(); + await reading.getByRole("button", { name: "Done", exact: true }).click(); + await expect(reading).toHaveCount(0); + await expect(doneCard).toHaveCount(0); + await expect(dismissedToast).toBeVisible(); + await dismissedToast + .getByRole("button", { name: "Undo", exact: true }) + .click(); + await expect(doneCard).toHaveCount(1); await page.evaluate((project) => { sessionStorage.setItem("loop-project-tab", "brief"); sessionStorage.setItem("loop-project-tab:" + project, "brief"); diff --git a/src/client/Feed.tsx b/src/client/Feed.tsx index 059087e2..548f94d7 100644 --- a/src/client/Feed.tsx +++ b/src/client/Feed.tsx @@ -96,6 +96,7 @@ import { Bookmark, BookmarkCheck, ArrowUpRight, + Check, MoreHorizontal, ArrowUp, FileText, @@ -312,6 +313,8 @@ function FeedCard({ ? item.run.error : ""; const name = item.agent_name || agent?.name; + const canQuickDone = + !!onDismiss && !groupCount && dismissLabel !== "Dismiss from Needs you"; const awaitingUpdate = item.run && WORKING_RUN_DISPLAY_STATES.includes(item.run.state) && @@ -631,6 +634,17 @@ function FeedCard({ {next.label} )} + {canQuickDone && ( + + )} {next?.kind !== "draft" && ( + )} + + {availableAgents.length > 0 && ( +
- {!availableAgents.length && ( - - )} {(composerOptions || selected === "__route__") && ( - - )} - {activeAgent?.retired_at && ( - + )} - {availableAgents.map((a) => ( - - ))} - - - -
+ {availableAgents.map((a) => { + const active = + selected !== "__route__" && activeAgent?.id === a.id; + return ( + + ); + })} + + )} + )} {!threadMode && activeAgent && diff --git a/src/client/design.css b/src/client/design.css index 5f5e656d..c425d626 100644 --- a/src/client/design.css +++ b/src/client/design.css @@ -443,6 +443,16 @@ a:focus-visible { background: transparent; color: var(--brass-text); } +.workspace-content .feed-card .card-actions .card-action-done { + margin-left: auto; + color: var(--green); + font-weight: 600; +} +.result-edit-actions .card-action-done { + display: inline-flex; + align-items: center; + gap: 6px; +} .workspace-content .feed-card .preview-open { font-size: 12px; font-weight: 500; @@ -863,6 +873,53 @@ label.catalog-search { .composer-launch:hover { filter: brightness(1.05); } +.composer-agent-pills { + display: flex; + align-items: center; + gap: 6px; + overflow-x: auto; + overscroll-behavior-x: contain; + scrollbar-width: none; + padding: 8px 14px 2px; +} +.composer-agent-pills::-webkit-scrollbar { + display: none; +} +.composer-agent-pill { + display: inline-flex; + align-items: center; + gap: 6px; + flex-shrink: 0; + min-height: 36px; + padding: 4px 11px 4px 5px; + border: 1px solid var(--line); + border-radius: 999px; + background: var(--bg); + color: var(--muted); + font-size: 12px; + font-weight: 500; + line-height: 1.2; + white-space: nowrap; +} +.composer-agent-pill:first-child:has(svg) { + padding-left: 10px; +} +.composer-agent-pill .avatar { + width: 22px; + height: 22px; + min-width: 22px; + min-height: 22px; + flex-shrink: 0; +} +.composer-agent-pill.selected { + border-color: color-mix(in srgb, var(--brass) 55%, var(--line)); + background: color-mix(in srgb, var(--brass) 14%, var(--surface)); + color: var(--text); + font-weight: 650; +} +[data-keyboard="open"] .composer-agent-pills { + display: none; +} @media (min-width: 1100px) { .app-shell { @@ -973,6 +1030,16 @@ label.catalog-search { width: 58px; height: 58px; } + .agent-portrait:has(.agent-status-dot[data-status="Working"]) .avatar { + box-shadow: + 0 0 0 2px var(--surface), + 0 0 0 3.5px color-mix(in srgb, var(--green) 72%, transparent); + } + .agent-portrait:has(.agent-status-dot[data-status="Needs you"]) .avatar { + box-shadow: + 0 0 0 2px var(--surface), + 0 0 0 3.5px color-mix(in srgb, var(--orange) 78%, transparent); + } .agent-shortcut-name { font-size: 12px; } @@ -1063,25 +1130,56 @@ label.catalog-search { gap: 10px; } .workspace-content .feed-card > .card-content { - margin-left: 48px; - width: calc(100% - 48px); + margin-left: 0; + width: 100%; } .workspace-content .feed-card > .card-actions, .workspace-content .feed-item-details { - margin-left: 48px; + margin-left: 0; } .workspace-content .feed-card .card-content h2 { - font-size: 15px; + font-size: 16px; + line-height: 1.42; } .workspace-content .feed-card .card-content .markdown { font-size: 14px; } .workspace-content .feed-card > .card-actions { - gap: 4px 14px; + gap: 6px; + margin-top: 10px; + } + .workspace-content .feed-card .card-actions button { + min-height: 44px; + padding: 0 10px; + gap: 5px; + border: 1px solid var(--line); + border-radius: 999px; + background: var(--surface); + color: var(--muted); + font-size: 12px; + font-weight: 500; + white-space: nowrap; + } + .workspace-content .feed-card .card-actions .next-action { + padding-inline: 10px; + border: 1px solid color-mix(in srgb, var(--brass) 38%, var(--line)); + border-radius: 999px; + background: color-mix(in srgb, var(--brass) 10%, var(--surface)); + color: var(--brass-text); + font-weight: 600; + } + .workspace-content .feed-card .card-actions .card-action-done { + margin-left: 0; + border-color: color-mix(in srgb, var(--green) 32%, var(--line)); + background: color-mix(in srgb, var(--green) 8%, var(--surface)); + color: var(--green); + font-weight: 600; } .needs-stack { margin-block: 14px 4px; padding-inline: 12px; + border-color: color-mix(in srgb, var(--brass) 35%, var(--attention-line)); + box-shadow: 0 2px 10px color-mix(in srgb, var(--brass) 10%, transparent); } .needs-stack .feed-card > .card-content, .needs-stack .feed-card > .card-actions { From 468c4c8689e95aeeb2948dff6d1646a98010614c Mon Sep 17 00:00:00 2001 From: Jamie Asefa <13409617+j-asefa@users.noreply.github.com> Date: Sat, 21 Nov 2026 13:08:46 +0000 Subject: [PATCH 2/4] Address Loop review findings: preserve context on same-recipient tap, label reply archive accurately, keep pills visible with keyboard open --- .../helpers/main-composer-keyboard-smoke.mjs | 3 ++ .../profile-photos-recipient-smoke.mjs | 35 ++++++++++++++- scripts/helpers/workspace-project-smoke.mjs | 22 ++++++++++ src/client/Feed.tsx | 20 ++++++--- src/client/app/Composer.tsx | 43 +++++++------------ src/client/design.css | 6 ++- 6 files changed, 92 insertions(+), 37 deletions(-) diff --git a/scripts/helpers/main-composer-keyboard-smoke.mjs b/scripts/helpers/main-composer-keyboard-smoke.mjs index a171f225..040d4e12 100644 --- a/scripts/helpers/main-composer-keyboard-smoke.mjs +++ b/scripts/helpers/main-composer-keyboard-smoke.mjs @@ -102,6 +102,9 @@ export async function mainComposerKeyboardSmoke(page, fixture, capture) { el.scrollTop = 0; }); await expect(dock.getByLabel("Agent recipient")).toBeInViewport(); + await expect( + dock.getByRole("group", { name: "Quick recipient", exact: true }), + ).toBeInViewport(); await page.evaluate(() => { Object.defineProperty(window, "scrollY", window.__composerScroll); delete window.__composerScroll; diff --git a/scripts/helpers/profile-photos-recipient-smoke.mjs b/scripts/helpers/profile-photos-recipient-smoke.mjs index 8621a6cb..b2d83547 100644 --- a/scripts/helpers/profile-photos-recipient-smoke.mjs +++ b/scripts/helpers/profile-photos-recipient-smoke.mjs @@ -29,17 +29,50 @@ export async function profilePhotosRecipientSmoke(page, fixture) { .click(); } await openTab(page, "Feed"); + // Tapping the already-selected recipient pill must preserve reply context; + // tapping a different pill clears it like the recipient dropdown does. + await page.evaluate( + ({ owner, agentId }) => { + sessionStorage.setItem( + `loop-workspace-draft:${JSON.stringify([owner, "", "composer", ""])}`, + JSON.stringify({ + selected: agentId, + replyContext: { + agentId, + conversationId: "", + messageId: "fixture-reply", + content: "Preserve this reply context", + mine: false, + }, + folderChoice: "", + }), + ); + }, + { owner: fixture.owner, agentId: first.id }, + ); + await page.reload({ waitUntil: "networkidle" }); await page .getByRole("button", { name: "Compose a message", exact: true }) .click(); - // Quick recipient pills mirror the recipient picker with one tap. + const replyChip = page.locator(".composer-reply-chip"); + await expect(replyChip).toContainText("Preserve this reply context"); const pills = page.getByRole("group", { name: "Quick recipient", exact: true, }); + await expect( + pills.getByRole("button", { name: `@${first.name}`, exact: true }), + ).toHaveAttribute("aria-pressed", "true"); + await pills + .getByRole("button", { name: `@${first.name}`, exact: true }) + .click(); + await expect(replyChip).toContainText("Preserve this reply context"); + // Quick recipient pills mirror the recipient picker with one tap and clear + // reply context only when switching to a different recipient. await pills .getByRole("button", { name: `@${second.name}`, exact: true }) .click(); + await expect(replyChip).toHaveCount(0); await expect(page.getByLabel("Agent recipient")).toHaveValue(second.id); await expect( pills.getByRole("button", { name: `@${second.name}`, exact: true }), diff --git a/scripts/helpers/workspace-project-smoke.mjs b/scripts/helpers/workspace-project-smoke.mjs index 72b8b0a2..efdb3bbe 100644 --- a/scripts/helpers/workspace-project-smoke.mjs +++ b/scripts/helpers/workspace-project-smoke.mjs @@ -106,6 +106,28 @@ export async function workspaceProjectSmoke(page, fixture, _engine, capture) { await expect(doneCard).toHaveCount(1); await doneCard.getByRole("button", { name: title }).click(); await expect(reading).toBeVisible(); + // A dismissal failure after closing the reading sheet surfaces an alert + // and keeps the card in Done. + const failDismiss = (route) => + route.request().method() === "PATCH" + ? route.fulfill({ + status: 503, + json: { error: "Could not dismiss card" }, + }) + : route.continue(); + await page.route("**/api/feed/*", failDismiss); + try { + await reading.getByRole("button", { name: "Done", exact: true }).click(); + await expect(reading).toHaveCount(0); + await expect(page.getByRole("alert")).toContainText( + "Could not dismiss card", + ); + await expect(doneCard).toHaveCount(1); + } finally { + await page.unroute("**/api/feed/*", failDismiss); + } + await doneCard.getByRole("button", { name: title }).click(); + await expect(reading).toBeVisible(); await reading.getByRole("button", { name: "Done", exact: true }).click(); await expect(reading).toHaveCount(0); await expect(doneCard).toHaveCount(0); diff --git a/src/client/Feed.tsx b/src/client/Feed.tsx index 548f94d7..9cdff482 100644 --- a/src/client/Feed.tsx +++ b/src/client/Feed.tsx @@ -313,8 +313,14 @@ function FeedCard({ ? item.run.error : ""; const name = item.agent_name || agent?.name; - const canQuickDone = + const canQuickDismiss = !!onDismiss && !groupCount && dismissLabel !== "Dismiss from Needs you"; + const quickDismissLabel = item.reply ? "Archive" : "Done"; + const quickDismissIcon = item.reply ? ( +