@danypops/pi-packed 0.18.0 → 0.19.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/README.md CHANGED
@@ -10,7 +10,7 @@ The extension connects to Packed's authenticated user daemon and starts the pack
10
10
 
11
11
  ## Commands
12
12
 
13
- - `/packed` -- one floating overlay, four tabs (Packages/Find/Config/Settings), always shown in a persistent tab bar at the top, each label's own first letter highlighted as its mnemonic. `Tab`/`Shift-Tab` (or `←`/`→`) sweep between them; from any tab other than Packages, `p`/`f`/`c`/`s` also jump straight to the matching one (never stolen while that tab's own filter/query box is capturing text). `Esc` returns to Packages from anywhere else, or closes the panel from Packages itself. Every approval and reload confirmation, on any tab, renders inline on this same panel (`y`/`n` keys), never a separate popup or native dialog. A standing test (`keymap.test.ts`, using Malevich's tree-style `findMnemonicConflicts`) verifies no two actions genuinely reachable at once share a key.
13
+ - `/packed` -- one floating overlay, four tabs (Packages/Find/Config/Settings), always shown in a persistent tab bar at the top: the focused tab is real reverse-video (guaranteed visible contrast on any theme, unlike a specific configured background color), unfocused tabs show only a foreground color, and each label's own first letter is highlighted as its mnemonic on both. `Tab`/`Shift-Tab` (or `←`/`→`) sweep between them -- recognized under legacy CSI, xterm's modifyOtherKeys, and the Kitty keyboard protocol alike, not just one hardcoded encoding; from any tab other than Packages, `p`/`f`/`c`/`s` also jump straight to the matching one (never stolen while that tab's own filter/query box is capturing text). `Esc` returns to Packages from anywhere else, or closes the panel from Packages itself. Every approval and reload confirmation, on any tab, renders inline on this same panel (`y`/`n` keys), never a separate popup or native dialog. A standing test (`keymap.test.ts`, using Malevich's tree-style `findMnemonicConflicts`) verifies no two actions genuinely reachable at once share a key.
14
14
  - **Packages** (the default tab) -- every installed Pi package, with update availability. Mnemonics follow lazy.nvim's own convention (uppercase acts on every row, lowercase on the one under the cursor):
15
15
  - `u` / `U` -- update the selected package / update every outdated package, one combined confirmation and one reload. `U` shows a spinner inline next to the package currently updating, settling into a real ✓ or ✗ plus a short tail of that update's own captured output once it finishes -- the list stays visible throughout, nothing swaps to a separate screen. A reload is confirmed separately from the update itself -- decline it to defer: the update already happened, only picking it up in this Pi session is deferred until `/reload`.
16
16
  - `x` -- remove the selected package.
@@ -31,12 +31,18 @@ export function dialogTheme(theme: Theme): DialogTheme {
31
31
  * overlay, replacing what used to be four separately-opened screens. */
32
32
  export function tabBarTheme(theme: Theme): TabBarTheme {
33
33
  return {
34
- tab: (s) => theme.fg("muted", s),
35
- activeTab: (s) => theme.bold(theme.fg("accent", s)),
34
+ // Matches pi-tickets' own TabMenu convention (tab/activeTab, same
35
+ // reverse-video choice) rather than inventing a new one: real ANSI
36
+ // reverse-video for the focused tab, since a theme's own selectedBg
37
+ // can be too close in luminance to the surrounding UI to read as a
38
+ // highlight at all -- reverse video swaps whatever foreground and
39
+ // background are already in effect, guaranteeing contrast on any theme.
40
+ tab: (s) => theme.fg("dim", s),
41
+ activeTab: (s) => theme.inverse(s),
36
42
  // Every tab's first letter is a jump mnemonic (p/f/c/s) -- a distinct
37
43
  // warning-colored bold, so it reads as "press this letter" on both the
38
- // active and inactive tabs alike, not just whichever accent color
39
- // activeTab already uses for the whole label.
44
+ // active and inactive tabs alike, not just whichever style tab/activeTab
45
+ // already applies to the whole label.
40
46
  mnemonic: (s) => theme.bold(theme.fg("warning", s)),
41
47
  };
42
48
  }
@@ -46,7 +46,7 @@
46
46
  */
47
47
  import type { ExtensionCommandContext } from "@earendil-works/pi-coding-agent";
48
48
  import { DynamicBorder, rawKeyHint } from "@earendil-works/pi-coding-agent";
49
- import { Container, Input, Spacer, truncateToWidth, visibleWidth } from "@earendil-works/pi-tui";
49
+ import { Container, Input, matchesKey, Spacer, truncateToWidth, visibleWidth } from "@earendil-works/pi-tui";
50
50
  import { Dialog, Envelope, Menu, Spinner, Table, TabbedContainer, type Component, type MenuItem, type TextMeasure } from "malevich-tui-components";
51
51
  import { filterRows, mergeRows, nextMode, visibleRows } from "./model.js";
52
52
  import type { Row, ViewMode } from "./model.js";
@@ -779,6 +779,13 @@ function renderUnifiedPanel(
779
779
  ],
780
780
  theme: tabBarTheme(theme),
781
781
  initialKey: initialTab,
782
+ // Malevich's own default matcher only recognizes legacy CSI sequences;
783
+ // pi-tui's real matchesKey also covers the Kitty keyboard protocol and
784
+ // xterm's modifyOtherKeys encodings for the same keys. Malevich's
785
+ // KeyMatcher type takes a bare string (it doesn't share pi-tui's KeyId
786
+ // union), so this only ever forwards the small fixed set of key names
787
+ // TabbedContainer itself actually calls with (left/right/tab/shift+tab).
788
+ matchesKey: (data, keyId) => matchesKey(data, keyId as Parameters<typeof matchesKey>[1]),
782
789
  });
783
790
 
784
791
  // measure must be explicit: Envelope's own default is ASCII-only (raw
@@ -822,13 +829,18 @@ function renderUnifiedPanel(
822
829
  // Tab/Shift-Tab always sweep between menus -- nothing needs a literal
823
830
  // Tab character for itself (Packages'/Config's own former Tab bindings
824
831
  // moved to v once Tab was claimed globally; see the mnemonics.test.ts
825
- // conflict check for why that reassignment was necessary).
826
- if (data === "\t" || data === "\x1b[Z") {
832
+ // conflict check for why that reassignment was necessary). Real
833
+ // matchesKey(), not a hardcoded "\x1b[Z" literal, because Shift-Tab has
834
+ // no single universal encoding: legacy terminals send CSI Z, but the
835
+ // Kitty keyboard protocol and xterm's modifyOtherKeys mode both send a
836
+ // different sequence for the same keypress -- a literal check silently
837
+ // misses whichever ones it doesn't happen to be pinned to.
838
+ if (matchesKey(data, "tab") || matchesKey(data, "shift+tab")) {
827
839
  tabbedContainer.handleInput(data);
828
840
  tui.requestRender();
829
841
  return;
830
842
  }
831
- if ((data === "\x1b[C" || data === "\x1b[D") && !(activeTab.capturesHorizontalArrows?.() ?? false)) {
843
+ if ((matchesKey(data, "right") || matchesKey(data, "left")) && !(activeTab.capturesHorizontalArrows?.() ?? false)) {
832
844
  tabbedContainer.handleInput(data); // owns Left/Right cycling itself
833
845
  tui.requestRender();
834
846
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danypops/pi-packed",
3
- "version": "0.18.0",
3
+ "version": "0.19.2",
4
4
  "description": "Pi package tools, commands, profiles, and TUI for the Packed daemon",
5
5
  "type": "module",
6
6
  "keywords": ["pi-package"],