diff --git a/app/src/components/agents/bot-orb.tsx b/app/src/components/agents/bot-orb.tsx
index 92234db09b..97cfe23f0d 100644
--- a/app/src/components/agents/bot-orb.tsx
+++ b/app/src/components/agents/bot-orb.tsx
@@ -262,7 +262,7 @@ export function BotOrbArt({
* - `idle`: still.
* - `working`: live, it breathes.
* - `waiting`: something from it waits on the person, the next move theirs: still, with two short
- * arcs of its own color (`orbColor`) at its upper right, like a phone ringing, the Bot calling for
+ * arcs of its own color (`orbColor`) at its upper left, like a phone ringing, the Bot calling for
* them. They stand clear of the orb, so they read on an orb of any color.
*
* A new state is one more name here and one more rule there.
diff --git a/app/src/components/app-sidebar/channel-item-content.tsx b/app/src/components/app-sidebar/channel-item-content.tsx
index e82a5a3795..af3ff93282 100644
--- a/app/src/components/app-sidebar/channel-item-content.tsx
+++ b/app/src/components/app-sidebar/channel-item-content.tsx
@@ -17,7 +17,10 @@ import type { MessageListEmphasis } from "@/lib/settings/message-list";
* the row ends in the unread dot instead. The dot has a place of its own at the row's end, kept
* empty on such a row with nothing unread, so every row's dot is in one column, and the pin and the
* age line up before it. The pin used to come after the dot, and on a pinned row pushed it out of
- * the column. A row whose orb says it keeps no place for a dot.
+ * the column. A row whose orb says it keeps no place for a dot. A row under its Bot in the Bots
+ * panel, which has no orb, says it with the same arcs in the dot's color instead, coming out of its
+ * title at the first letter's upper-left corner (`.waiting-arcs-left` in styles.css), and keeps no
+ * place for a dot either.
*
* A conversation a routine spoke in last, with nothing written since (`routine`), has a small clock
* drawn inside its Bot's orb (`BotOrb`'s `startedBy`), so a routine's conversations read apart from
@@ -68,14 +71,17 @@ export function ChannelItemContent({
// Whether the row's orb says it is unread: one Bot's orb, drawn (a compact row under its Bot has none).
const oneOrb = useOneOrb(participantIds);
const onOrb = oneOrb && (view !== "compact" || avatar);
- const unreadDot = onOrb ? null : unread ? (
-
- ) : (
-
- );
+ // Under its Bot (a compact row with no avatar), the arcs at the title's corner say it.
+ const underItsBot = view === "compact" && !avatar;
+ const unreadDot =
+ onOrb || underItsBot ? null : unread ? (
+
+ ) : (
+
+ );
const pin = pinned ? (
{`${name}, `}
) : null}
+ {/*
+ * Under its Bot, something new: the waiting arcs, at the title's upper-left corner, hung
+ * from a place of no width (its `-mr-2` gives back the row's gap), so the title keeps its
+ * column.
+ */}
+ {underItsBot && unread ? (
+
+
+
+ ) : null}
= STANDS_OUT,
};
}
@@ -511,7 +514,7 @@ const THEMES = ["light", "dark"] as const;
describe.skipIf(!asked)(
"a Bot waiting on the person, in the Bots panel",
() => {
- test("its orb wears two arcs of its own color at its upper right, clear of the orb, that stand out on an orb of every color, in light and dark; a Bot with nothing waiting has none, and no row has a dot", async () => {
+ test("its orb wears two arcs of its own color at its upper left, clear of the orb, that stand out on an orb of every color, in light and dark; a Bot with nothing waiting has none, and no row has a dot", async () => {
for (const [engine, browser] of engines) {
for (const theme of THEMES) {
const page = await open(browser, { theme });
@@ -538,7 +541,7 @@ describe.skipIf(!asked)(
near: true,
far: true,
clear: true,
- upperRight: true,
+ upperLeft: true,
standsOut: true,
});
}
@@ -573,9 +576,12 @@ describe.skipIf(!asked)(
/*
* Opening a Bot answers nothing that waits on the person, so its arcs stay while it is open. Its
- * conversations under it have no orb of their own, so the unread one keeps its dot.
+ * conversations under it have no orb of their own, so the unread one says it with the same arcs,
+ * coming out of its title at the first letter's upper-left corner, in the dot's color:
+ * clear of the letter (a W, square at its top-left, the closest a letter comes), of the Bot's
+ * guide line and of the row above, and standing out from the surface.
*/
- test("the arcs stay while the Bot is open and after it closes; its unread conversation under it keeps its dot", async () => {
+ test("the arcs stay while the Bot is open and after it closes; its unread conversation under it has the arcs at its title's corner", async () => {
for (const [engine, browser] of engines) {
for (const theme of THEMES) {
const page = await open(browser, { theme });
@@ -601,18 +607,130 @@ describe.skipIf(!asked)(
near: true,
far: true,
clear: true,
- upperRight: true,
+ upperLeft: true,
standsOut: true,
});
- const unreadDots = await panel(page)
- .locator(
- '[data-slot="bot-conversation-row"] [data-slot="unread-dot"]',
- )
- .count();
- expect({ engine, theme, unreadDots }).toEqual({
+ const rows = panel(page).locator(
+ '[data-slot="bot-conversation-row"]',
+ );
+ const row = rows.filter({ hasText: "Which vendors to shortlist" });
+ // From the guide line to past the title's first letters, and from a little above the row
+ // to the title's foot, in CSS pixels.
+ const where = await row.evaluate((row) => {
+ const title = row.querySelector("[data-slot=unread-arcs] + span");
+ const guide = row.closest(".border-l");
+ if (!title || !guide) return null;
+ const t = title.getBoundingClientRect();
+ return {
+ titleLeft: t.left,
+ guideLeft: guide.getBoundingClientRect().left,
+ rowTop: row.getBoundingClientRect().top,
+ bottom: t.bottom,
+ };
+ });
+ if (!where) throw new Error("no row");
+ const ABOVE = 4;
+ const clip = {
+ x: where.guideLeft + 1,
+ y: where.rowTop - ABOVE,
+ width: where.titleLeft + 16 - (where.guideLeft + 1),
+ height: where.bottom - (where.rowTop - ABOVE),
+ };
+ // The arcs' ink is what changes when they are hidden; the title's is what is left.
+ const arcs = row.locator(".waiting-arcs-left");
+ const drawn = await page.screenshot({ clip });
+ await arcs.evaluate((each) => {
+ (each as HTMLElement).style.visibility = "hidden";
+ });
+ const bare = await page.screenshot({ clip });
+ await arcs.evaluate((each) => {
+ (each as HTMLElement).style.visibility = "";
+ });
+ const ink = await page.evaluate(
+ async ({ shots, theme, width }) => {
+ const pixels = async (base64: string) => {
+ const image = new Image();
+ image.src = `data:image/png;base64,${base64}`;
+ await image.decode();
+ const canvas = document.createElement("canvas");
+ canvas.width = image.naturalWidth;
+ canvas.height = image.naturalHeight;
+ const context = canvas.getContext("2d");
+ if (!context) throw new Error("no 2d context");
+ context.drawImage(image, 0, 0);
+ return context.getImageData(
+ 0,
+ 0,
+ canvas.width,
+ canvas.height,
+ );
+ };
+ const [drawn, bare] = await Promise.all(shots.map(pixels));
+ if (!drawn || !bare) throw new Error("no shots");
+ const scale = drawn.width / width;
+ const level = (data: Uint8ClampedArray, at: number) =>
+ ((data[at] ?? 0) +
+ (data[at + 1] ?? 0) +
+ (data[at + 2] ?? 0)) /
+ 3;
+ const surface = level(bare.data, 0);
+ const arcs: [number, number][] = [];
+ const text: [number, number][] = [];
+ let best = surface;
+ for (let y = 0; y < drawn.height; y++)
+ for (let x = 0; x < drawn.width; x++) {
+ const at = (y * drawn.width + x) * 4;
+ const with_ = level(drawn.data, at);
+ const without = level(bare.data, at);
+ if (Math.abs(with_ - without) >= 40) {
+ arcs.push([x, y]);
+ best =
+ theme === "light"
+ ? Math.min(best, with_)
+ : Math.max(best, with_);
+ }
+ if (Math.abs(without - surface) >= 40) text.push([x, y]);
+ }
+ let first = Infinity;
+ let top = Infinity;
+ let nearest = Infinity;
+ for (const [x, y] of arcs) {
+ first = Math.min(first, x / scale);
+ top = Math.min(top, y / scale);
+ for (const [u, v] of text)
+ nearest = Math.min(
+ nearest,
+ Math.hypot(x - u, y - v) / scale,
+ );
+ }
+ return { count: arcs.length, first, top, nearest, best };
+ },
+ {
+ shots: [drawn, bare].map((shot) => shot.toString("base64")),
+ theme,
+ width: clip.width,
+ },
+ );
+ expect({
+ engine,
+ theme,
+ dots: await rows.locator('[data-slot="unread-dot"]').count(),
+ arcs: await rows.locator('[data-slot="unread-arcs"]').count(),
+ drawn: ink.count > 0,
+ clearOfGuide: ink.first >= 1,
+ inItsRow: ink.top >= ABOVE,
+ clearOfTitle: ink.nearest >= 1,
+ inked: theme === "light" ? ink.best < 90 : ink.best > 165,
+ }).toEqual({
engine,
theme,
- unreadDots: 1,
+ dots: 0,
+ arcs: 1,
+ drawn: true,
+ clearOfGuide: true,
+ inItsRow: true,
+ clearOfTitle: true,
+ inked: true,
});
await research.getByRole("button", { name: /^Research/ }).click();
@@ -632,7 +750,7 @@ describe.skipIf(!asked)(
near: true,
far: true,
clear: true,
- upperRight: true,
+ upperLeft: true,
standsOut: true,
});
} finally {
@@ -687,7 +805,7 @@ describe.skipIf(!asked)(
near: true,
far: true,
clear: true,
- upperRight: true,
+ upperLeft: true,
standsOut: true,
});
expect({
diff --git a/app/tests/compact-conversations.test.tsx b/app/tests/compact-conversations.test.tsx
index e151b30bd5..f611c2af26 100644
--- a/app/tests/compact-conversations.test.tsx
+++ b/app/tests/compact-conversations.test.tsx
@@ -198,7 +198,7 @@ test("where Bots are orbs, an unread conversation's orb wears the arcs and its r
}
});
-test("where there is no lone orb to wear the arcs, an unread row keeps its dot", () => {
+test("where there is no lone orb to wear the arcs, an unread row keeps its dot, but under its Bot the arcs are at its title's corner", () => {
const group = compactRow(
{ unread: true, participantIds: ["bot-1", "bot-2"] },
"orb",
@@ -210,11 +210,27 @@ test("where there is no lone orb to wear the arcs, an unread row keeps its dot",
expect((each as HTMLElement).dataset.state).toBe("idle");
group.unmount();
+ // Under its Bot: no dot, nor a place kept for one; the arcs hang from just before the title, at its
+ // first letter's upper-left corner, unseen by a screen reader as the dot was.
const underItsBot = compactRow({ unread: true, avatar: false }, "orb");
expect(
underItsBot.container.querySelector("[data-slot=unread-dot]"),
- ).not.toBeNull();
+ ).toBeNull();
+ const arcs = underItsBot.container.querySelector(
+ "[data-slot=unread-arcs]",
+ ) as HTMLElement;
+ expect(arcs.getAttribute("aria-hidden")).toBe("true");
+ expect(arcs.nextElementSibling?.textContent).toBe("Trip budget for Lisbon");
+ expect(arcs.querySelector(".waiting-arcs-left")).not.toBeNull();
+ expect(
+ underItsBot.container.querySelector("[aria-hidden=true].size-2"),
+ ).toBeNull();
underItsBot.unmount();
+ const readUnderItsBot = compactRow({ unread: false, avatar: false }, "orb");
+ expect(
+ readUnderItsBot.container.querySelector("[data-slot=unread-arcs]"),
+ ).toBeNull();
+ readUnderItsBot.unmount();
const face = compactRow({ unread: true }, "face");
expect(face.container.querySelector("[data-slot=unread-dot]")).not.toBeNull();