pi-fancy-footer 0.3.1 → 0.3.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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
2
|
-
import { homedir } from "node:os";
|
|
3
2
|
import { join } from "node:path";
|
|
4
3
|
import {
|
|
4
|
+
getAgentDir,
|
|
5
5
|
getSettingsListTheme,
|
|
6
6
|
type Theme,
|
|
7
7
|
} from "@mariozechner/pi-coding-agent";
|
|
@@ -67,20 +67,6 @@ function readJsonObject(filePath: string): Record<string, unknown> | undefined {
|
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
function expandHome(pathValue: string): string {
|
|
71
|
-
if (pathValue === "~") return homedir();
|
|
72
|
-
if (pathValue.startsWith("~/") || pathValue.startsWith("~\\")) {
|
|
73
|
-
return join(homedir(), pathValue.slice(2));
|
|
74
|
-
}
|
|
75
|
-
return pathValue;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
function getAgentDir(): string {
|
|
79
|
-
return process.env.PI_CODING_AGENT_DIR
|
|
80
|
-
? expandHome(process.env.PI_CODING_AGENT_DIR)
|
|
81
|
-
: join(homedir(), ".pi", "agent");
|
|
82
|
-
}
|
|
83
|
-
|
|
84
70
|
export function coerceCompactionSettings(
|
|
85
71
|
value: unknown,
|
|
86
72
|
fallback: CompactionSettingsSnapshot = DEFAULT_COMPACTION_SETTINGS,
|
|
@@ -800,11 +786,13 @@ export function genericFooterSettingsItems(
|
|
|
800
786
|
label: "context bar style",
|
|
801
787
|
currentValue: formatContextBarStyleValue(draft.contextBarStyle),
|
|
802
788
|
values: CONTEXT_BAR_STYLE_IDS.map(formatContextBarStyleValue),
|
|
803
|
-
description:
|
|
789
|
+
description:
|
|
790
|
+
"Choose the character style for the context usage bar: " +
|
|
804
791
|
CONTEXT_BAR_STYLES.map((s, i) => {
|
|
805
792
|
const repr = s.label + " " + s.used + s.free + s.reserved;
|
|
806
793
|
return i === CONTEXT_BAR_STYLES.length - 1 ? "or " + repr : repr;
|
|
807
|
-
}).join(", ") +
|
|
794
|
+
}).join(", ") +
|
|
795
|
+
".",
|
|
808
796
|
},
|
|
809
797
|
{
|
|
810
798
|
id: "defaultTextColor",
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "@mariozechner/pi-coding-agent";
|
|
5
5
|
import {
|
|
6
6
|
Key,
|
|
7
|
-
|
|
7
|
+
getKeybindings,
|
|
8
8
|
matchesKey,
|
|
9
9
|
truncateToWidth,
|
|
10
10
|
visibleWidth,
|
|
@@ -543,19 +543,19 @@ export default function (pi: ExtensionAPI) {
|
|
|
543
543
|
return;
|
|
544
544
|
}
|
|
545
545
|
|
|
546
|
-
const kb =
|
|
546
|
+
const kb = getKeybindings();
|
|
547
547
|
|
|
548
|
-
if (kb.matches(data, "
|
|
548
|
+
if (kb.matches(data, "tui.select.up")) {
|
|
549
549
|
if (getActiveSectionItems().length > 0) moveSelection(-1);
|
|
550
|
-
} else if (kb.matches(data, "
|
|
550
|
+
} else if (kb.matches(data, "tui.select.down")) {
|
|
551
551
|
if (getActiveSectionItems().length > 0) moveSelection(1);
|
|
552
552
|
} else if (matchesKey(data, Key.tab)) {
|
|
553
553
|
moveSection(1);
|
|
554
554
|
} else if (matchesKey(data, Key.shift("tab"))) {
|
|
555
555
|
moveSection(-1);
|
|
556
|
-
} else if (kb.matches(data, "
|
|
556
|
+
} else if (kb.matches(data, "tui.select.confirm") || data === " ") {
|
|
557
557
|
activateCurrentItem();
|
|
558
|
-
} else if (kb.matches(data, "
|
|
558
|
+
} else if (kb.matches(data, "tui.select.cancel")) {
|
|
559
559
|
done(undefined);
|
|
560
560
|
return;
|
|
561
561
|
}
|