From 07c2e00e5582fc79580c5201b094be990be830ee Mon Sep 17 00:00:00 2001
From: monsterlag <64719697+monsterlag@users.noreply.github.com>
Date: Thu, 22 Oct 2026 05:54:38 +0000
Subject: [PATCH] fix(compat): distinguish auto and dontAsk permission pills
---
specs/05-frontend-web.md | 12 ++++++++++++
src/components/InfoBar.test.tsx | 25 ++++++++++++++++++++++---
src/components/InfoBar.tsx | 6 +++++-
src/lib/format.test.ts | 4 ++++
src/lib/format.ts | 4 ++++
src/styles/global.css | 10 ++++++++++
6 files changed, 57 insertions(+), 4 deletions(-)
diff --git a/specs/05-frontend-web.md b/specs/05-frontend-web.md
index 76b14350..b6005906 100644
--- a/specs/05-frontend-web.md
+++ b/specs/05-frontend-web.md
@@ -320,6 +320,18 @@ Supports text search and project filtering (via `ProjectTree` selection).
Top bar showing: project · session_id (8 chars) · git branch · permission mode ·
context % · tokens · cost · ongoing spinner.
+Permission mode pills use explicit labels and colours:
+
+| Mode | Label | Background |
+| ------------------- | ----------- | ---------- |
+| `default`, `manual` | hidden | — |
+| `acceptEdits` | `auto-edit` | purple |
+| `bypassPermissions` | `yolo` | red |
+| `plan` | `plan` | green |
+| `auto` | `auto` | blue |
+| `dontAsk` | `don't ask` | orange |
+| unknown mode | raw value | muted grey |
+
Context % uses a colour gradient:
- `< 50%` → green
diff --git a/src/components/InfoBar.test.tsx b/src/components/InfoBar.test.tsx
index 6a6973d7..99854ffb 100644
--- a/src/components/InfoBar.test.tsx
+++ b/src/components/InfoBar.test.tsx
@@ -124,7 +124,7 @@ describe("InfoBar", () => {
canFocus={false}
/>,
);
- expect(screen.getByText("yolo")).toBeInTheDocument();
+ expect(screen.getByText("yolo")).toHaveClass("info-bar__pill--bypass");
});
it("shows permission mode pill for acceptEdits", () => {
@@ -139,7 +139,7 @@ describe("InfoBar", () => {
canFocus={false}
/>,
);
- expect(screen.getByText("auto-edit")).toBeInTheDocument();
+ expect(screen.getByText("auto-edit")).toHaveClass("info-bar__pill--acceptEdits");
});
it("shows permission mode pill for plan", () => {
@@ -154,7 +154,26 @@ describe("InfoBar", () => {
canFocus={false}
/>,
);
- expect(screen.getByText("plan")).toBeInTheDocument();
+ expect(screen.getByText("plan")).toHaveClass("info-bar__pill--plan");
+ });
+
+ it.each([
+ ["auto", "auto", "info-bar__pill--auto"],
+ ["dontAsk", "don't ask", "info-bar__pill--dontAsk"],
+ ["customMode", "customMode", "info-bar__pill--default"],
+ ])("shows the label and pill class for %s", (mode, label, pillClass) => {
+ render(
+