diff --git a/apps/server/src/guide/topics.ts b/apps/server/src/guide/topics.ts index f79bed20a..9a20ffa9f 100644 --- a/apps/server/src/guide/topics.ts +++ b/apps/server/src/guide/topics.ts @@ -313,7 +313,7 @@ While this computer is asleep or Threadlines is closed, assistants are told it's Claude's models come from Claude Code itself, so a new one shows up without a Threadlines update. A model Threadlines has no settings of its own for starts on Default reasoning: no level is sent and Claude Code picks one. When Claude Code stops listing a model, the picker stops offering it, but a thread, room agent or setting already on it keeps it. -How much of each plan you've used is on {place:usage}. The ring beside the composer's send button shows the same limits when you hover or tap it; a short upright tick on each bar marks how much of that limit's window has passed, so a bar filled past its tick is on track to run out before the reset, and its line says "ahead of pace" once it is clearly past. Clicking a limit there opens {place:usage}. +How much of each plan you've used is on {place:usage}. The ring beside the composer's send button shows the same limits when you hover or tap it; a short upright tick on each bar marks how much of that limit's window has passed (hover the tick for the exact share, "55% of the week has passed"), so a bar filled past its tick is on track to run out before the reset, and its line says "ahead of pace" once it is clearly past. The same ticks show on a provider's Usage tab in Settings › Providers. Clicking a limit there opens {place:usage}. An agent's row that says Can't start means its program is on this computer but fails to launch, usually because an update stopped partway. It is not a sign-in problem: the sign-in is still saved. The row has Reinstall when Threadlines can put that same copy back: with npm, bun or Homebrew for a copy they installed, or with the agent's own installer for a copy sitting where that installer puts it (Claude, OpenCode, Cursor, fx, Muse Code, and Codex on Windows). For Pi it reinstalls an npm copy, or installs Threadlines' own copy of Pi. There is no Reinstall for a copy from pnpm, Scoop, winget or Nix, for one at a custom path, or for Grok from xAI's installer (it would switch the release channel); reinstall those the way they were installed. An update that leaves an agent unable to start runs that reinstall once on its own before reporting. Community agents are installed by Threadlines itself and have Install again instead. Antigravity is downloaded and checked by Threadlines, so it isn't covered. diff --git a/apps/web/src/components/ProviderUsageDashboard.tsx b/apps/web/src/components/ProviderUsageDashboard.tsx index 44713a650..092c65724 100644 --- a/apps/web/src/components/ProviderUsageDashboard.tsx +++ b/apps/web/src/components/ProviderUsageDashboard.tsx @@ -16,6 +16,7 @@ import { Button } from "./ui/button"; import { SegmentedControl, SegmentedControlItem } from "./ui/segmented-control"; import { Tooltip, TooltipPopup, TooltipTrigger } from "./ui/tooltip"; import { ProviderExternalResetsButton } from "./ProviderRateLimitResetCredit"; +import { UsagePaceMark, usagePaceLabel } from "./usage/UsagePaceMark"; type TokenActivityMode = "daily" | "weekly" | "cumulative"; type TokenActivityRange = "13-weeks" | "1-year"; @@ -448,16 +449,22 @@ function UsageLimitBar(props: {
+ {props.window.elapsedPercent !== undefined && props.window.paceDetail !== undefined ? ( + + ) : null}
); diff --git a/apps/web/src/components/chat/ContextWindowMeter.browser.tsx b/apps/web/src/components/chat/ContextWindowMeter.browser.tsx index 8037c6ac4..052380c6e 100644 --- a/apps/web/src/components/chat/ContextWindowMeter.browser.tsx +++ b/apps/web/src/components/chat/ContextWindowMeter.browser.tsx @@ -1,6 +1,6 @@ import "../../index.css"; -import { page } from "vite-plus/test/browser"; +import { page, userEvent } from "vite-plus/test/browser"; import { describe, expect, it, vi } from "vite-plus/test"; import { render } from "vitest-browser-react"; @@ -121,7 +121,9 @@ describe("ContextWindowMeter", () => { accountUsage={{ ...TEST_ACCOUNT_USAGE, windows: TEST_ACCOUNT_USAGE.windows.map((window) => - window.key === "secondary" ? { ...window, elapsedPercent: 14.3 } : window, + window.key === "secondary" + ? { ...window, elapsedPercent: 14.3, paceDetail: "14% of the week has passed" } + : window, ), }} onOpenUsage={openUsage} @@ -135,7 +137,13 @@ describe("ContextWindowMeter", () => { expect(paceMarks).toHaveLength(1); expect(paceMarks[0]?.style.left).toBe("14.3%"); - await page.getByRole("button", { name: /Weekly 36% used, 14% of the window passed/ }).click(); + // Hovering the mark says what it measures. + await userEvent.hover(paceMarks[0]!); + await expect.element(page.getByText("14% of the week has passed")).toBeVisible(); + + await page + .getByRole("button", { name: /Weekly 36% used, 14% of the week has passed/ }) + .click(); expect(openUsage).toHaveBeenCalledTimes(1); // The row closes the popover. Checked on the meter's own state: the popup // leaves the page only after its fade-out, which needs frames a busy CI diff --git a/apps/web/src/components/chat/ContextWindowMeter.tsx b/apps/web/src/components/chat/ContextWindowMeter.tsx index 2eef4df46..26719cc88 100644 --- a/apps/web/src/components/chat/ContextWindowMeter.tsx +++ b/apps/web/src/components/chat/ContextWindowMeter.tsx @@ -37,10 +37,11 @@ function AccountUsageBar(props: { usedPercent: number; warning: boolean; elapsedPercent?: number | undefined; + paceDetail?: string | undefined; onOpen?: (() => void) | undefined; }) { const meterColor = usageMeterColor(props.usedPercent, props.warning); - const meterLabel = `${props.usageLabel} ${props.rowLabel} ${props.usedPercent}% used${usagePaceLabel(props.elapsedPercent)}`; + const meterLabel = `${props.usageLabel} ${props.rowLabel} ${props.usedPercent}% used${usagePaceLabel(props.paceDetail)}`; const content = ( <> @@ -62,8 +63,8 @@ function AccountUsageBar(props: { )} style={{ width: `${props.usedPercent}%`, backgroundColor: meterColor }} /> - {props.elapsedPercent !== undefined ? ( - + {props.elapsedPercent !== undefined && props.paceDetail !== undefined ? ( + ) : null} @@ -582,6 +583,7 @@ export function ContextWindowMeter(props: { usedPercent={window.usedPercent} warning={window.warning} elapsedPercent={window.elapsedPercent} + paceDetail={window.paceDetail} onOpen={openUsage} /> ))} diff --git a/apps/web/src/components/usage/UsagePaceMark.tsx b/apps/web/src/components/usage/UsagePaceMark.tsx index 8d8426679..ca68a6c0d 100644 --- a/apps/web/src/components/usage/UsagePaceMark.tsx +++ b/apps/web/src/components/usage/UsagePaceMark.tsx @@ -1,28 +1,47 @@ import { cn } from "~/lib/utils"; +import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip"; /** * The pace mark on a usage bar: a short upright tick at how much of the * window has passed. Usage that stops left of it lasts until the reset. Put it * inside the bar's track, which needs `relative` and must not clip it. + * + * Hovering the tick says how much of the window has passed (`detail`, from the + * shared usage presentation). The hover area is wider than the tick so it can + * be found; keyboard and screen reader users get the same words from the + * bar's accessible name (`usagePaceLabel`). */ -export function UsagePaceMark(props: { elapsedPercent: number; className?: string }) { +export function UsagePaceMark(props: { + elapsedPercent: number; + detail: string; + className?: string; +}) { const left = Math.max(0, Math.min(100, props.elapsedPercent)); return ( -