pi-footer-dock 0.1.1 → 0.1.2

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/CHANGELOG.md CHANGED
@@ -4,6 +4,17 @@ All notable changes to Footer Dock are listed here. The format follows [Keep a C
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.1.2] - 2026-10-20
8
+
9
+ ### Added
10
+
11
+ - The first time Footer Dock starts for a user who never chose an icon set, it says once what to do if the icons look like empty boxes (`/dock-glyphs`, or install a Nerd Font). It is remembered in the settings file as `glyphHintShown`; a settings file that had to be ignored is never rewritten for this. The README now says in the Install section that the icons need a Nerd Font. **New setting:** `glyphHintShown` (written automatically; you never need to set it). Versions before 0.1.2 reject a settings file that contains it, so after going back to 0.1.1 or 0.1.0 delete that line.
12
+ - The package manifest now names the launch video (`pi.video`), so the package page on pi.dev can play it. The video is hosted by GitHub as an attachment (the same one the README plays); it is not part of the npm package.
13
+
14
+ ### Fixed
15
+
16
+ - The cost screen's bar of dollars by category sat directly under the "This session" and "This month" lines; there is now a blank row between them, as on the other screens.
17
+
7
18
  ## [0.1.1] - 2026-10-19
8
19
 
9
20
  ### Changed
package/README.md CHANGED
@@ -8,6 +8,10 @@
8
8
  [![Pi 1.2 and 1.3](https://img.shields.io/badge/Pi-1.2%20%7C%201.3-b4befe)](#requirements)
9
9
  [![PRs welcome](https://img.shields.io/badge/PRs-welcome-brightgreen)](CONTRIBUTING.md)
10
10
 
11
+ https://github.com/user-attachments/assets/2f7eab93-210e-40e2-8736-d7cc64520ccc
12
+
13
+ _The 30-second tour, also [on YouTube](https://youtu.be/fkBa8wB2_YI)._
14
+
11
15
  **A two-row status footer for [Pi](https://pi.dev) that tells you what is going on.** Git, model, context, tokens, cache, speed, provider limits and cost, in two rows that fit your terminal, with an explanation behind every value.
12
16
 
13
17
  ![Footer Dock on a wide terminal](docs/images/footer-wide.png)
@@ -24,6 +28,8 @@ pi install npm:pi-footer-dock
24
28
 
25
29
  Then restart Pi (or run `/reload`). That is all. Full instructions, updating, removing and troubleshooting: **[SETUP.md](SETUP.md)**.
26
30
 
31
+ **Icons need a [Nerd Font](https://www.nerdfonts.com/) in your terminal.** If the icons show up as empty boxes, your font does not have them: run `/dock-glyphs` for plain symbols that every font has, or install a Nerd Font. Footer Dock mentions this once, the first time it starts.
32
+
27
33
  ## What the footer shows
28
34
 
29
35
  | Item | What it is | Click the icon | Click the text |
package/dist/index.js CHANGED
@@ -364,6 +364,9 @@ function say(ctx, text, level = "info") {
364
364
  } catch {
365
365
  }
366
366
  }
367
+ var sayAt = (ctx, level = "info") => (text) => {
368
+ say(ctx, text, level);
369
+ };
367
370
 
368
371
  // src/open-with-command.ts
369
372
  function runOpenWith(args, ctx, settings) {
@@ -4554,7 +4557,16 @@ var ownOption = (id, key) => {
4554
4557
  if (id === "quota") return QUOTA_ONLY.includes(key);
4555
4558
  return id === "compaction" && key === "unit" || id === "cost" && key === "period";
4556
4559
  };
4557
- var KEYS = ["version", "glyphs", "quotaExpanded", "clicks", "openWith", "limits", "slots"];
4560
+ var KEYS = [
4561
+ "version",
4562
+ "glyphs",
4563
+ "glyphHintShown",
4564
+ "quotaExpanded",
4565
+ "clicks",
4566
+ "openWith",
4567
+ "limits",
4568
+ "slots"
4569
+ ];
4558
4570
  var defaultSettings = () => ({ version: 1, slots: {} });
4559
4571
  var settingsItems = () => [...slotHelp.keys()].filter((id) => id !== QUOTA_TOGGLE);
4560
4572
  function slots(value) {
@@ -4579,15 +4591,19 @@ function parseSettings(value) {
4579
4591
  if (data.slots !== void 0) result.slots = slots(data.slots);
4580
4592
  return result;
4581
4593
  }
4594
+ function readFlags(data, result) {
4595
+ for (const key of ["glyphHintShown", "quotaExpanded"]) {
4596
+ if (data[key] === void 0) continue;
4597
+ if (typeof data[key] !== "boolean") throw new Error(`${key} must be boolean`);
4598
+ result[key] = data[key];
4599
+ }
4600
+ }
4582
4601
  function readChoices(data, result) {
4583
4602
  if (data.glyphs !== void 0) {
4584
4603
  if (data.glyphs !== "nerd" && data.glyphs !== "portable") throw new Error("Invalid glyph set");
4585
4604
  result.glyphs = data.glyphs;
4586
4605
  }
4587
- if (data.quotaExpanded !== void 0) {
4588
- if (typeof data.quotaExpanded !== "boolean") throw new Error("quotaExpanded must be boolean");
4589
- result.quotaExpanded = data.quotaExpanded;
4590
- }
4606
+ readFlags(data, result);
4591
4607
  if (data.limits !== void 0) {
4592
4608
  if (data.limits !== "on" && data.limits !== "off") throw new Error("limits must be on or off");
4593
4609
  result.limits = data.limits;
@@ -7370,7 +7386,7 @@ var cost = {
7370
7386
  sessionFact(estimate, priced),
7371
7387
  ...headlineFact(snapshot.history, period ?? "month", new Date(now))
7372
7388
  ),
7373
- ...priced ? [categoryBar(breakdown)] : []
7389
+ ...priced ? [gap, categoryBar(breakdown)] : []
7374
7390
  ],
7375
7391
  body: [
7376
7392
  ...priced ? pricedBody(breakdown) : [],
@@ -8424,6 +8440,7 @@ var FooterInteractions = class {
8424
8440
  };
8425
8441
 
8426
8442
  // src/settings-controller.ts
8443
+ var GLYPH_HINT = `${PRODUCT}: if the icons look like empty boxes, your terminal font has no Nerd Font symbols. Run /dock-glyphs for plain symbols, or install a Nerd Font.`;
8427
8444
  var SettingsController = class {
8428
8445
  constructor(store) {
8429
8446
  this.store = store;
@@ -8441,12 +8458,26 @@ var SettingsController = class {
8441
8458
  followSavedGlyphs() {
8442
8459
  this.toggled = void 0;
8443
8460
  }
8461
+ /** Set while the file on disk was ignored: it must not be overwritten with defaults. */
8462
+ ignored = false;
8444
8463
  /** Re-reads the file; says why through `report` if it had to be ignored. */
8445
8464
  load(report) {
8446
8465
  const { settings, problem } = this.store.load();
8447
8466
  this.current = settings;
8467
+ this.ignored = problem !== void 0;
8448
8468
  if (problem) report(`${PRODUCT} settings ignored: ${problem}.`);
8449
8469
  }
8470
+ /**
8471
+ * Once, for a user who never chose an icon set: what to do if the icons are not drawn (a
8472
+ * terminal cannot tell us its font). Never touches a file that was ignored; a failed save only
8473
+ * means the note may come again.
8474
+ */
8475
+ announceGlyphs(report) {
8476
+ const { glyphs, glyphHintShown } = this.current;
8477
+ if (this.ignored || glyphs !== void 0 || glyphHintShown) return;
8478
+ report(GLYPH_HINT);
8479
+ this.update({ ...this.current, glyphHintShown: true });
8480
+ }
8450
8481
  /** Applies a change in memory first, so the footer follows even if saving fails. */
8451
8482
  update(next) {
8452
8483
  this.current = next;
@@ -9359,9 +9390,8 @@ var DockRuntime = class {
9359
9390
  this.stop();
9360
9391
  if (ctx.mode !== "tui") return;
9361
9392
  ctx.ui.setFooter(void 0);
9362
- this.settings.load((message) => {
9363
- say(ctx, message, "warning");
9364
- });
9393
+ this.settings.load(sayAt(ctx, "warning"));
9394
+ this.settings.announceGlyphs(sayAt(ctx));
9365
9395
  this.ctx = ctx;
9366
9396
  this.trackers.start(ctx);
9367
9397
  this.live = this.usage.capture(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-footer-dock",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "A two-row status footer for Pi: Git, model, context, tokens, cache, speed, provider limits and cost, with explanations behind every value.",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -41,7 +41,8 @@
41
41
  "extensions": [
42
42
  "./dist/index.js"
43
43
  ],
44
- "image": "https://raw.githubusercontent.com/KKhosla7/pi-footer-dock/main/docs/images/footer-wide.png"
44
+ "image": "https://raw.githubusercontent.com/KKhosla7/pi-footer-dock/main/docs/images/footer-wide.png",
45
+ "video": "https://github.com/user-attachments/assets/2f7eab93-210e-40e2-8736-d7cc64520ccc"
45
46
  },
46
47
  "scripts": {
47
48
  "format": "prettier --write .",