@pi-archimedes/footer 2.3.0 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-archimedes/footer",
3
- "version": "2.3.0",
3
+ "version": "2.5.0",
4
4
  "type": "module",
5
5
  "keywords": [
6
6
  "pi-package"
@@ -15,15 +15,15 @@
15
15
  "./config": "./src/config.ts"
16
16
  },
17
17
  "dependencies": {
18
- "@pi-archimedes/core": "2.3.0"
18
+ "@pi-archimedes/core": "2.5.0"
19
19
  },
20
20
  "peerDependencies": {
21
21
  "@earendil-works/pi-coding-agent": ">=0.1.0",
22
22
  "@earendil-works/pi-tui": ">=0.1.0"
23
23
  },
24
24
  "devDependencies": {
25
- "@earendil-works/pi-coding-agent": "^0.84.2",
26
- "@earendil-works/pi-tui": "^0.84.2",
25
+ "@earendil-works/pi-coding-agent": "^0.84.4",
26
+ "@earendil-works/pi-tui": "^0.84.4",
27
27
  "typescript": "^6.0.0"
28
28
  },
29
29
  "pi": {
package/src/index.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * dir | branch [+status] | worktree | model | ◐thinking | ↑↓R W $cost ━ context%
2
+ * dir | branch [+status] | worktree | model | ◕thinking | ↑↓R W $cost ━ context%
3
3
  *
4
4
  * Adaptive layout — wraps to additional lines instead of truncating:
5
5
  * - fits width → single line (system info · stats · context bar)
@@ -6,7 +6,7 @@ import {
6
6
  formatGitStatusIndicators,
7
7
  formatThinkingIndicator,
8
8
  } from "./format.js";
9
- import type { ColorFn } from "./icons.js";
9
+ import { thinkingLevelColors, thinkingLevelIcons, type ColorFn } from "./icons.js";
10
10
 
11
11
  // ── Mock ColorFn ────────────────────────────────────────────────────────────
12
12
  // Passthrough — we test structure, not actual coloring.
@@ -137,15 +137,27 @@ describe("formatGitStatusIndicators", () => {
137
137
  // ── formatThinkingIndicator ─────────────────────────────────────────────────
138
138
 
139
139
  describe("formatThinkingIndicator", () => {
140
- it("off returns empty string", () => {
141
- expect(formatThinkingIndicator("off", mockColor)).toBe("");
140
+ it("off renders the open circle in dim", () => {
141
+ expect(formatThinkingIndicator("off", mockColor)).toBe("○ off");
142
142
  });
143
143
 
144
- it("other levels return indicator with level name", () => {
145
- expect(formatThinkingIndicator("minimal", mockColor)).toBe("◐ minimal");
146
- expect(formatThinkingIndicator("low", mockColor)).toBe("◐ low");
147
- expect(formatThinkingIndicator("medium", mockColor)).toBe("◐ medium");
148
- expect(formatThinkingIndicator("high", mockColor)).toBe("◐ high");
149
- expect(formatThinkingIndicator("xhigh", mockColor)).toBe("◐ xhigh");
144
+ it.each([
145
+ ["minimal", "○"],
146
+ ["low", "◔"],
147
+ ["medium", "◑"],
148
+ ["high", "◕"],
149
+ ["xhigh", "●"],
150
+ ["max", "●"],
151
+ ])("renders the %s glyph", (level, glyph) => {
152
+ expect(formatThinkingIndicator(level, mockColor)).toBe(`${glyph} ${level}`);
153
+ });
154
+
155
+ it("uses themed color tokens per level", () => {
156
+ expect(thinkingLevelColors["max"]).toBe("thinkingMax");
157
+ expect(thinkingLevelColors["high"]).toBe("thinkingHigh");
158
+ });
159
+
160
+ it("falls back for unknown levels", () => {
161
+ expect(formatThinkingIndicator("unknown", mockColor)).toBe("◑ unknown");
150
162
  });
151
163
  });
@@ -1,4 +1,4 @@
1
- import { footerIcons, gitDisplayIcons, gitStatusColors, thinkingLevelColors, type ColorFn } from "./icons.js";
1
+ import { footerIcons, gitDisplayIcons, gitStatusColors, thinkingLevelColors, thinkingLevelIcons, type ColorFn } from "./icons.js";
2
2
 
3
3
  // Token counts use binary units (1K = 1024)
4
4
  const TOKEN_K = 1_024;
@@ -50,5 +50,5 @@ export function formatGitStatusIndicators(
50
50
  }
51
51
 
52
52
  export function formatThinkingIndicator(thinkingLevel: string, colorize: ColorFn): string {
53
- return thinkingLevel !== "off" ? colorize(thinkingLevelColors[thinkingLevel] || "dim", "◐ " + thinkingLevel) : "";
53
+ return colorize(thinkingLevelColors[thinkingLevel] || "dim", `${thinkingLevelIcons[thinkingLevel] || "◑"} ${thinkingLevel}`);
54
54
  }
@@ -31,6 +31,19 @@ export const thinkingLevelColors: Record<string, string> = {
31
31
  medium: "thinkingMedium",
32
32
  high: "thinkingHigh",
33
33
  xhigh: "thinkingXhigh",
34
+ max: "thinkingMax",
35
+ };
36
+
37
+ // Thinking level glyphs — fill ramp: off/minimal open ○, low 25% ◔,
38
+ // medium 50% ◑, high 75% ◕, xhigh/max fully filled ● (level labeled by text)
39
+ export const thinkingLevelIcons: Record<string, string> = {
40
+ off: "○",
41
+ minimal: "○",
42
+ low: "◔",
43
+ medium: "◑",
44
+ high: "◕",
45
+ xhigh: "●",
46
+ max: "●",
34
47
  };
35
48
 
36
49
  // Color function type used by formatting functions
@@ -11,7 +11,7 @@ const DIR = "📁 auth";
11
11
  const BRANCH = "⎇ feat/plan-040-jwt-cookie-security+~3"; // + fake status
12
12
  const WORKTREE = "⛅ feat/plan-040-jwt-cookie-security";
13
13
  const MODEL = "🧠 claude-sonnet-4-6";
14
- const THINKING = "◐ high";
14
+ const THINKING = "◕ high"; // current format for the 'high' level
15
15
  const STATS = "↑141 ↓42k R8.7M W220k $4.25 116k/977k";
16
16
 
17
17
  function buildLines(width: number, pct: number, splitThreshold = 150) {