mirror of
https://github.com/block/buzz.git
synced 2026-11-05 17:01:35 +00:00
fix(mesh): restore the status dot, and settle on one name
Two regressions from the previous commit. The dot is the row's reason to exist -- hollow when nothing is known, slate when there is capacity to join, green sharing, blue consuming -- and the last change swapped it for a Share2 glyph in the cold state. That threw the signal away in the one state that still had something to say, and made the row read as a network widget rather than a status line. The dot is now unconditional in every state, and Share2 sits beside the invitation it labels. The same change also invented two names, "MeshLLM" cold and "Buzz MeshLLM" otherwise, then failed to apply the second to the popover -- so the card kept saying "Buzz MeshLLM" after the row had dropped it. There is now one constant, "MeshLLM" (the "Buzz" qualifier adds nothing inside Buzz), and a test asserts the label is identical across every state so it cannot drift again. Signed-off-by: Michael Neale <michael.neale@gmail.com>
This commit is contained in:
@@ -223,16 +223,18 @@ test("an empty mesh offers the action instead of sitting inert", () => {
|
||||
assert.match(model.tooltip, /share this computer to start the mesh/);
|
||||
});
|
||||
|
||||
test("the cold state drops the Buzz qualifier to make room", () => {
|
||||
// "Buzz MeshLLM" plus "Share your compute" does not fit 256px. The name is
|
||||
// the part that can afford to lose a word.
|
||||
assert.equal(derive({ snapshot: snapshot() }).label, "MeshLLM");
|
||||
assert.equal(
|
||||
derive({
|
||||
snapshot: snapshot({ sharingDeviceCount: 1, sharedCapacityGb: 36 }),
|
||||
}).label,
|
||||
"Buzz MeshLLM",
|
||||
);
|
||||
test("the label is the same in every state", () => {
|
||||
// Two name variants was the source of drift: one surface kept saying "Buzz
|
||||
// MeshLLM" after the other had dropped it.
|
||||
for (const input of [
|
||||
{ snapshot: null },
|
||||
{ snapshot: snapshot() },
|
||||
{ snapshot: snapshot({ sharingDeviceCount: 1, sharedCapacityGb: 36 }) },
|
||||
{ toggle: SHARING, view: view() },
|
||||
{ toggle: CONSUMING },
|
||||
]) {
|
||||
assert.equal(derive(input).label, "MeshLLM");
|
||||
}
|
||||
});
|
||||
|
||||
test("only the cold state invites; every other state reports", () => {
|
||||
|
||||
@@ -64,10 +64,7 @@ export type MeshRowPulse = "none" | "activity" | "invite";
|
||||
|
||||
export type MeshRowModel = {
|
||||
tone: MeshRowTone;
|
||||
/**
|
||||
* Row label. Drops the "Buzz" qualifier in the cold state, where a call to
|
||||
* action shares the same 256px and every character costs.
|
||||
*/
|
||||
/** Row label. */
|
||||
label: string;
|
||||
/** Accessible state sentence, used as the row tooltip. */
|
||||
tooltip: string;
|
||||
@@ -99,8 +96,9 @@ export type MeshRowModel = {
|
||||
pulse: MeshRowPulse;
|
||||
};
|
||||
|
||||
/** Full name. Used everywhere except the cold state, which needs the room. */
|
||||
const LABEL = "Buzz MeshLLM";
|
||||
/** One name in every state. Two variants was the source of drift, and "Buzz"
|
||||
* adds nothing inside Buzz. */
|
||||
const LABEL = "MeshLLM";
|
||||
|
||||
/** Live pool capacity: this machine plus every peer that reports a figure. */
|
||||
function liveCapacityGb(view: MeshLiveView | null): number {
|
||||
@@ -234,8 +232,7 @@ export function deriveMeshRowModel({
|
||||
// annoyance. The invite throb stays reserved for capacity that exists.
|
||||
return {
|
||||
tone: "unknown",
|
||||
// "Buzz" is dropped here so the invitation fits beside it.
|
||||
label: "MeshLLM",
|
||||
label: LABEL,
|
||||
tooltip: "No shared compute yet — share this computer to start the mesh",
|
||||
badge: null,
|
||||
callToAction: "Share your compute",
|
||||
|
||||
@@ -83,7 +83,7 @@ export function MeshComputePopover({
|
||||
<div className="flex items-start justify-between gap-2">
|
||||
<div className="min-w-0 flex-1">
|
||||
<p className="truncate text-sm font-semibold leading-tight">
|
||||
{model.capacityLabel ?? "Buzz MeshLLM"}
|
||||
{model.capacityLabel ?? "MeshLLM"}
|
||||
</p>
|
||||
<p
|
||||
className="mt-0.5 text-2xs text-muted-foreground"
|
||||
|
||||
@@ -9,7 +9,7 @@ import type { MeshRowPulse, MeshRowTone } from "../meshRowModel";
|
||||
import { MeshComputePopover } from "./MeshComputePopover";
|
||||
|
||||
/**
|
||||
* The sidebar Buzz MeshLLM row.
|
||||
* The sidebar MeshLLM row.
|
||||
*
|
||||
* Replaces the ~120px footer card with one menu line beside Inbox and Agents,
|
||||
* because front-page sidebar space is premium. The row carries a single signal
|
||||
@@ -84,34 +84,29 @@ export function SidebarMeshComputeRow({
|
||||
className="flex h-4 w-4 shrink-0 items-center justify-center"
|
||||
>
|
||||
{/*
|
||||
In the cold state a status dot has nothing to say — there is no
|
||||
capacity to report and nothing running — so the slot carries a
|
||||
Share2 glyph, which names the action instead. Every other state has
|
||||
a real status, and the dot is the more honest signal there.
|
||||
The dot is in every state, without exception. It is the row's
|
||||
reason to exist: hollow when nothing is known, slate when there is
|
||||
capacity to join, green while sharing, blue while consuming. An
|
||||
earlier revision swapped it for a Share2 glyph in the cold state,
|
||||
which threw away the signal and made the row read as a network
|
||||
widget rather than a status line.
|
||||
*/}
|
||||
{row.callToAction ? (
|
||||
<Share2
|
||||
className="h-3.5 w-3.5 text-muted-foreground"
|
||||
data-testid="mesh-row-share-icon"
|
||||
/>
|
||||
) : (
|
||||
<span className="relative flex h-2 w-2 items-center justify-center">
|
||||
{row.pulse === "none" ? null : (
|
||||
<span
|
||||
className={cn(
|
||||
"absolute h-2 w-2 rounded-full opacity-75 motion-reduce:animate-none",
|
||||
PULSE_CLASS[row.pulse],
|
||||
TONE_PING[row.tone],
|
||||
)}
|
||||
data-mesh-pulse={row.pulse}
|
||||
/>
|
||||
)}
|
||||
<span className="relative flex h-2 w-2 items-center justify-center">
|
||||
{row.pulse === "none" ? null : (
|
||||
<span
|
||||
className={cn("h-2 w-2 rounded-full", TONE_DOT[row.tone])}
|
||||
data-testid="mesh-row-dot"
|
||||
className={cn(
|
||||
"absolute h-2 w-2 rounded-full opacity-75 motion-reduce:animate-none",
|
||||
PULSE_CLASS[row.pulse],
|
||||
TONE_PING[row.tone],
|
||||
)}
|
||||
data-mesh-pulse={row.pulse}
|
||||
/>
|
||||
</span>
|
||||
)}
|
||||
)}
|
||||
<span
|
||||
className={cn("h-2 w-2 rounded-full", TONE_DOT[row.tone])}
|
||||
data-testid="mesh-row-dot"
|
||||
/>
|
||||
</span>
|
||||
</span>
|
||||
<SidebarMenuLabel className="opacity-80">
|
||||
{row.label}
|
||||
@@ -134,9 +129,10 @@ export function SidebarMeshComputeRow({
|
||||
*/}
|
||||
{row.callToAction ? (
|
||||
<span
|
||||
className="pointer-events-none absolute right-2 top-1/2 -translate-y-1/2 text-2xs font-medium text-muted-foreground group-data-[collapsible=icon]:hidden"
|
||||
className="pointer-events-none absolute right-2 top-1/2 flex -translate-y-1/2 items-center gap-1 text-2xs font-medium text-muted-foreground group-data-[collapsible=icon]:hidden"
|
||||
data-testid="mesh-row-cta"
|
||||
>
|
||||
<Share2 aria-hidden className="h-3 w-3" />
|
||||
{row.callToAction}
|
||||
</span>
|
||||
) : row.badge ? (
|
||||
|
||||
Reference in New Issue
Block a user