Open-source Grok Bot alternative with a virtual machine that bots can use
TypeScript ai-agentsclaude-codecodexcomputer-usedockerelectrongrokgrok-botgrok-bot-alternativeself-hostedtypescript
fix(usage): keep the usage bars grey while plenty is left
Bugfixer 27197ff2a9dfd
diff --git a/src/components/EngineUsage.tsx b/src/components/EngineUsage.tsxindex 037a2af966..cc29abc1aa 100644--- a/src/components/EngineUsage.tsx+++ b/src/components/EngineUsage.tsx@@ -80,8 +80,8 @@ const GLYPH_HEIGHT = 14;const BASELINE_INSET = 2;const TALLEST = GLYPH_HEIGHT - BASELINE_INSET;const GLYPH_WIDTH = BAR_STEP * USAGE_BARS - (BAR_STEP - BAR_WIDTH);-const TONE_INK: Record<UsageTone, string> = { fine: "text-success", near: "text-warning", out: "text-danger" };-const TONE_TRACK: Record<UsageTone, string> = { fine: "bg-success", near: "bg-warning", out: "bg-danger" };+const TONE_INK: Record<UsageTone, string> = { fine: "text-ink-tertiary", near: "text-warning", out: "text-danger" };+const TONE_TRACK: Record<UsageTone, string> = { fine: "bg-ink-tertiary", near: "bg-warning", out: "bg-danger" };/** Four rising bars on whole pixels, filled for the usage left; at the limit every bar is empty and struck through. */export function UsageGlyph({ limit, className }: { limit: EngineLimit; className?: string }) {diff --git a/src/components/limit-resets.test.ts b/src/components/limit-resets.test.tsindex e9e433baf1..dd3ba628c7 100644--- a/src/components/limit-resets.test.ts+++ b/src/components/limit-resets.test.ts@@ -198,7 +198,7 @@ describe("the bars", () => {expect(out.querySelector(".sr-only")?.textContent).toBe("Claude: at its limit, resets 3:40 PM");});- it("color the bars and each window's track green with room left, orange near the limit and red at it", () => {+ it("keep the bars and each window's track grey with room left, orange near the limit and red at it", () => {const glyph = (limit: EngineLimit) => {serve([limit]);const ink = mount(createElement(UsageBars, { engine: "claude" })).querySelector("[data-usage-glyph]")?.getAttribute("class");@@ -206,15 +206,15 @@ describe("the bars", () => {return ink;};expect([glyph(windows(38, 10)), glyph(claude(92)), glyph(claude(100, true))]).toEqual([- expect.stringContaining("text-success"), expect.stringContaining("text-warning"), expect.stringContaining("text-danger"),+ expect.stringContaining("text-ink-tertiary"), expect.stringContaining("text-warning"), expect.stringContaining("text-danger"),]);const tracks = (limit: EngineLimit) => {- const fills = [...mount(createElement(UsageRows, { limit })).querySelectorAll("[data-usage-track]")].map((track) => track.className.match(/bg-\w+/)?.[0]);+ const fills = [...mount(createElement(UsageRows, { limit })).querySelectorAll("[data-usage-track]")].map((track) => track.className.match(/bg-[\w-]+/)?.[0]);root!.unmount();return fills;};- expect(tracks(windows(92, 20, { blocked: true, usedPercent: 100 }))).toEqual(["bg-danger", "bg-success"]);- expect(tracks(windows(95, 20))).toEqual(["bg-warning", "bg-success"]);+ expect(tracks(windows(92, 20, { blocked: true, usedPercent: 100 }))).toEqual(["bg-danger", "bg-ink-tertiary"]);+ expect(tracks(windows(95, 20))).toEqual(["bg-warning", "bg-ink-tertiary"]);});it("open every window in a card on a mouse hover, never on a touch, and keep the card's clicks from the model button", async () => {