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
2 changes: 1 addition & 1 deletion app/src/components/agents/bot-orb.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
38 changes: 29 additions & 9 deletions app/src/components/app-sidebar/channel-item-content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 ? (
<span
className="size-2 shrink-0 rounded-full bg-primary"
data-slot="unread-dot"
/>
) : (
<span aria-hidden="true" className="size-2 shrink-0" />
);
// 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 ? (
<span
className="size-2 shrink-0 rounded-full bg-primary"
data-slot="unread-dot"
/>
) : (
<span aria-hidden="true" className="size-2 shrink-0" />
);
const pin = pinned ? (
<IconPinFilled
className="size-3 shrink-0 text-muted-foreground"
Expand Down Expand Up @@ -139,6 +145,20 @@ export function ChannelItemContent({
{avatar ? (
<span className="sr-only" data-slot="bot-name">{`${name}, `}</span>
) : 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 ? (
<span
aria-hidden="true"
className="relative -mr-2 w-0 self-stretch"
data-slot="unread-arcs"
>
<span className="waiting-arcs-left" />
</span>
) : null}
<span
className={`min-w-0 flex-1 truncate text-sm leading-5 tracking-[-1%] ${unread ? "font-semibold" : "font-normal"}`}
title={title}
Expand Down
61 changes: 54 additions & 7 deletions app/src/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -744,13 +744,15 @@

/*
* A Bot waiting on the person (`BotOrb`'s state `waiting`): two short arcs at its orb's upper
* right, like a phone ringing, the Bot calling for them. They are the orb's own color
* left, like a phone ringing, the Bot calling for them. They are the orb's own color
* (`--bot-orb-color`, set on the orb), drawn a little toward the text color so they hold against
* the surface: deeper in light, brighter in dark. The near arc sits 2px clear of the orb's edge and
* the far one 3px past it, reaching 6px out; the far one is a shade fainter, as a sound dies away.
* Each sweeps 60°, centred at half past one, and fades out at both ends, so neither ends in a hard
* stop. Between them, and between arc and orb, is whatever is behind, a row's hover included. They
* scale with the orb; these sizes are at the sidebar's 24px.
* Each sweeps 60°, centred at about twenty past ten, and fades out at both ends, so neither ends in
* a hard stop. They face the way the arcs coming out of an unread conversation's title do
* (`.waiting-arcs-left` below), so the two read as one sign; they were at half past one. Between
* them, and between arc and orb, is whatever is behind, a row's hover included. They scale with the
* orb; these sizes are at the sidebar's 24px.
*
* They come in once, as the state comes: they fade in and settle out from the orb, over the app's
* entrance (200ms, lib/motion.ts), and go the same way back. Nothing pulses. Under reduced motion
Expand Down Expand Up @@ -788,13 +790,13 @@
transparent calc(var(--bot-orb-unit) * 18.25)
);
-webkit-mask-image: conic-gradient(
from 15deg,
from 280deg,
transparent 0deg,
#000 9deg 51deg,
transparent 60deg
);
mask-image: conic-gradient(
from 15deg,
from 280deg,
transparent 0deg,
#000 9deg 51deg,
transparent 60deg
Expand Down Expand Up @@ -825,6 +827,51 @@
}
}

/*
* A conversation under its Bot in the Bots panel with something new in it (`ChannelItemContent`, a
* row with no orb of its own): the waiting arcs a Bot's orb wears, facing the same way, coming out
* of the title as the orb's come out of the orb. They are drawn round a point in the title's first
* letter (4.5px in, at the line's middle) and sit at that letter's upper-left corner, as the orb's
* sit at the orb's: the same 60° about twenty past ten. Their shape is the orb's, scaled to the letter:
* the near arc 2.25px clear of the letter's corner (6.6px out), as the orb's is of the orb's edge,
* the far one 3px past it, so the pair reads as short as it does round an orb. Drawn at the orb's
* radii, with no orb inside, they read long and flat, and from below the title's start, not out of
* it. In the dot's color (`--primary`: near black in light, near white in dark), the far arc a
* shade fainter and half the weight, both fading out at their ends as the orb's do. They reach
* 1-2px above the line, into the row's own padding, and about 8px before the title, clear of the
* Bot's guide line. The box hangs off a place of no width before the title.
*/
.waiting-arcs-left {
/* How far the far arc reaches from the centre, which is the box's right foot. */
--arcs-reach: 12.85px;
position: absolute;
right: -4.5px;
top: calc(50% - var(--arcs-reach));
width: var(--arcs-reach);
height: var(--arcs-reach);
pointer-events: none;
background: radial-gradient(
circle at var(--arcs-reach) var(--arcs-reach),
transparent 8.35px,
var(--primary) 8.85px 9.85px,
transparent 10.35px 11.35px,
color-mix(in oklab, var(--primary) 75%, transparent) 11.85px 12.35px,
transparent var(--arcs-reach)
);
-webkit-mask-image: conic-gradient(
from 280deg at var(--arcs-reach) var(--arcs-reach),
transparent 0deg,
#000 9deg 51deg,
transparent 60deg
);
mask-image: conic-gradient(
from 280deg at var(--arcs-reach) var(--arcs-reach),
transparent 0deg,
#000 9deg 51deg,
transparent 60deg
);
}

/*
* A Bot whose routine spoke last (`BotOrb`'s `startedBy` "routine"): a small clock inside its orb,
* so a routine's conversation reads apart from the person's own. A pale, soft-edged dial breathed
Expand All @@ -839,7 +886,7 @@
* in the paint is literal because a data URI can't read a variable.
*
* All of it is on `::after`, `inset: 0`, inside the circle, so it never meets the waiting arcs
* (`::before`, outside at the upper right). The hand is drawn in the orb's 24 units and the face in
* (`::before`, outside at the upper left). The hand is drawn in the orb's 24 units and the face in
* fractions of its radius, so it is the same mark at 20, 24 and 32px. The orb's own drawing is
* untouched.
*
Expand Down
Loading
Loading