@xynogen/pix-optimizer 1.1.26 → 1.1.27
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 +1 -1
- package/src/opt.ts +6 -5
- package/src/status.ts +3 -3
package/package.json
CHANGED
package/src/opt.ts
CHANGED
|
@@ -73,6 +73,7 @@ export function registerOptCommand(
|
|
|
73
73
|
pi.registerCommand("optimizer", {
|
|
74
74
|
description: "pix-optimizer: caveman / rtk / ponytail tools",
|
|
75
75
|
handler: async (_args, ctx) => {
|
|
76
|
+
// SAFETY: Runtime UI supports custom overlays beyond the published command context type.
|
|
76
77
|
const ui = ctx.ui as unknown as {
|
|
77
78
|
theme: {
|
|
78
79
|
fg(c: string, t: string): string;
|
|
@@ -114,8 +115,8 @@ export function registerOptCommand(
|
|
|
114
115
|
done: (v: null) => void,
|
|
115
116
|
) => {
|
|
116
117
|
const guide = (key: string, action: string) =>
|
|
117
|
-
theme.fg("text", key) + theme.fg("
|
|
118
|
-
const guideSep = theme.fg("
|
|
118
|
+
theme.fg("text", key) + theme.fg("muted", ` ${action}`);
|
|
119
|
+
const guideSep = theme.fg("muted", " · ");
|
|
119
120
|
let selected = 0;
|
|
120
121
|
const pager = new ModalPager();
|
|
121
122
|
|
|
@@ -138,14 +139,14 @@ export function registerOptCommand(
|
|
|
138
139
|
const on = handles[tool].current() !== "off";
|
|
139
140
|
const sel = i === selected;
|
|
140
141
|
const cursor = sel ? theme.fg("accent", "→") : " ";
|
|
141
|
-
const glyph = theme.fg(on ? "accent" : "
|
|
142
|
+
const glyph = theme.fg(on ? "accent" : "muted", toolIcon(tool));
|
|
142
143
|
const name = theme.fg(
|
|
143
144
|
sel ? "accent" : on ? "text" : "muted",
|
|
144
145
|
tool.padEnd(nameWidth),
|
|
145
146
|
);
|
|
146
147
|
const cur = handles[tool].current();
|
|
147
|
-
const value = theme.fg(on ? "success" : "
|
|
148
|
-
const bar = theme.fg(on ? "accent" : "
|
|
148
|
+
const value = theme.fg(on ? "success" : "muted", cur.padEnd(valueWidth));
|
|
149
|
+
const bar = theme.fg(on ? "accent" : "muted", levelBar(cur, handles[tool].values));
|
|
149
150
|
return `${cursor} ${glyph} ${name} ${value} ${bar}`;
|
|
150
151
|
});
|
|
151
152
|
const result = frameModal({
|
package/src/status.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* caveman / rtk / ponytail each toggle independently, but they're all the same
|
|
5
5
|
* class of thing (token-optimization tools), so they share ONE status cell.
|
|
6
6
|
* Each tool reports its on/off state into a single registry; the cell renders
|
|
7
|
-
* all three icons in a fixed order — accent-colored when enabled,
|
|
7
|
+
* all three icons in a fixed order — accent-colored when enabled, muted when
|
|
8
8
|
* disabled. The cell is never empty.
|
|
9
9
|
*/
|
|
10
10
|
|
|
@@ -62,7 +62,7 @@ const TOOL_ORDER: readonly OptimizerTool[] = ["caveman", "rtk", "ponytail"];
|
|
|
62
62
|
/** Theme color for enabled icons. */
|
|
63
63
|
const ENABLED_COLOR: ThemeColor = "accent";
|
|
64
64
|
/** Theme color for disabled icons. */
|
|
65
|
-
const DISABLED_COLOR: ThemeColor = "
|
|
65
|
+
const DISABLED_COLOR: ThemeColor = "muted";
|
|
66
66
|
|
|
67
67
|
/** Colorizer: maps a (theme color, text) pair to a rendered string. */
|
|
68
68
|
export type Colorize = (color: ThemeColor, text: string) => string;
|
|
@@ -70,7 +70,7 @@ export type Colorize = (color: ThemeColor, text: string) => string;
|
|
|
70
70
|
/**
|
|
71
71
|
* Build the colored status string for a set of tool states. ALL tool icons are
|
|
72
72
|
* always shown in TOOL_ORDER; each is accent-colored when its tool is enabled
|
|
73
|
-
* and
|
|
73
|
+
* and muted when disabled. Glyphs resolve against the active global icon mode
|
|
74
74
|
* (see /pix). `color` applies the theme color (e.g. theme.fg).
|
|
75
75
|
*
|
|
76
76
|
* Pure + exported for tests (pass a tagging colorizer to assert per-icon color).
|