@linxiraos/pi-tui 1.4.7 → 1.4.10
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 +154 -231
- package/README.md +7 -1
- package/dist/types/app-keybindings.d.ts +5 -0
- package/dist/types/charts/table-data.d.ts +4 -2
- package/dist/types/chat/bash-execution.d.ts +4 -1
- package/dist/types/chat/eval-execution.d.ts +2 -0
- package/dist/types/chat/execution-shared.d.ts +14 -8
- package/dist/types/chat/figure-markdown.d.ts +2 -0
- package/dist/types/chat/svg-figure.d.ts +5 -0
- package/dist/types/chat/table-chart.d.ts +2 -0
- package/dist/types/chat/transcript-render-helpers.d.ts +11 -3
- package/dist/types/chrome/dynamic-border.d.ts +6 -0
- package/dist/types/chrome/transcript-status.d.ts +2 -2
- package/dist/types/components/editor.d.ts +15 -6
- package/dist/types/components/image.d.ts +6 -0
- package/dist/types/components/loader.d.ts +2 -0
- package/dist/types/keybinding-matchers.d.ts +7 -0
- package/dist/types/native/describe.d.ts +4 -2
- package/dist/types/native/node.d.ts +2 -3
- package/dist/types/native/overlay.d.ts +42 -2
- package/dist/types/native/state.d.ts +4 -0
- package/dist/types/overlays/btw-history-panel.d.ts +15 -0
- package/dist/types/overlays/btw-history.d.ts +24 -0
- package/dist/types/overlays/btw-inject.d.ts +22 -0
- package/dist/types/overlays/btw-panel.d.ts +7 -0
- package/dist/types/overlays/hook-editor.d.ts +2 -0
- package/dist/types/overlays/jobs-panel.d.ts +4 -0
- package/dist/types/overlays/model-browser.d.ts +1 -1
- package/dist/types/overlays/session-selector.d.ts +11 -2
- package/dist/types/prompt/composer.d.ts +13 -5
- package/dist/types/render/render-utils.d.ts +23 -1
- package/dist/types/setup/scenes/language.d.ts +3 -0
- package/dist/types/setup/scenes/types.d.ts +5 -0
- package/dist/types/setup/setup-version.d.ts +1 -1
- package/dist/types/setup/wizard.d.ts +1 -1
- package/dist/types/status-line/startup.d.ts +0 -15
- package/dist/types/terminal-capabilities.d.ts +1 -1
- package/dist/types/theme/symbols.d.ts +3 -1
- package/dist/types/theme/theme-class.d.ts +1 -0
- package/dist/types/theme/theme.d.ts +1 -1
- package/dist/types/theme/tui-adapters.d.ts +2 -0
- package/dist/types/thinking.d.ts +8 -6
- package/dist/types/tools/ast-grep.d.ts +2 -0
- package/dist/types/tools/eval.d.ts +2 -0
- package/dist/types/tools/find.d.ts +1 -1
- package/dist/types/tools/grouped-file-output.d.ts +100 -19
- package/dist/types/tools/hashline-format.d.ts +5 -0
- package/dist/types/tools/native-view.d.ts +2 -0
- package/dist/types/tools/output-meta.d.ts +27 -0
- package/dist/types/tools/read.d.ts +14 -4
- package/dist/types/tools/task.d.ts +4 -3
- package/dist/types/tools/wait.d.ts +2 -0
- package/dist/types/tui.d.ts +12 -0
- package/dist/types/utils.d.ts +4 -0
- package/package.json +9 -9
- package/src/app-keybindings.d.ts +5 -0
- package/src/app-keybindings.ts +5 -0
- package/src/apps/git/git-tui.ts +10 -17
- package/src/apps/git/sidebar.ts +21 -35
- package/src/apps/ps-top.ts +4 -12
- package/src/charts/chart-plan.ts +0 -29
- package/src/charts/table-data.d.ts +4 -2
- package/src/charts/table-data.ts +55 -6
- package/src/chat/bash-execution.d.ts +4 -1
- package/src/chat/bash-execution.ts +20 -9
- package/src/chat/chat-transcript-builder.ts +5 -2
- package/src/chat/eval-execution.d.ts +2 -0
- package/src/chat/eval-execution.ts +14 -7
- package/src/chat/execution-shared.d.ts +14 -8
- package/src/chat/execution-shared.ts +39 -18
- package/src/chat/figure-markdown.d.ts +2 -0
- package/src/chat/figure-markdown.ts +6 -4
- package/src/chat/read-tool-group.ts +56 -36
- package/src/chat/svg-figure.d.ts +5 -0
- package/src/chat/svg-figure.ts +55 -16
- package/src/chat/table-chart.d.ts +2 -0
- package/src/chat/table-chart.ts +19 -2
- package/src/chat/transcript-render-helpers.d.ts +11 -3
- package/src/chat/transcript-render-helpers.ts +70 -22
- package/src/chrome/dynamic-border.d.ts +6 -0
- package/src/chrome/dynamic-border.ts +28 -2
- package/src/chrome/transcript-status.d.ts +2 -2
- package/src/chrome/transcript-status.ts +5 -3
- package/src/components/editor.d.ts +15 -6
- package/src/components/editor.ts +123 -24
- package/src/components/image.d.ts +6 -0
- package/src/components/image.ts +13 -0
- package/src/components/key-value-list.ts +9 -9
- package/src/components/loader.d.ts +2 -0
- package/src/components/loader.ts +7 -0
- package/src/components/section.ts +1 -9
- package/src/components/table.ts +1 -9
- package/src/keybinding-matchers.d.ts +7 -0
- package/src/keybinding-matchers.ts +13 -0
- package/src/native/backend.ts +7 -3
- package/src/native/describe.d.ts +4 -2
- package/src/native/describe.ts +9 -4
- package/src/native/node.d.ts +2 -3
- package/src/native/node.ts +2 -3
- package/src/native/overlay.d.ts +42 -2
- package/src/native/overlay.ts +124 -16
- package/src/native/state.d.ts +4 -0
- package/src/native/state.ts +25 -5
- package/src/overlays/btw-history-panel.ts +106 -14
- package/src/overlays/btw-history.ts +65 -0
- package/src/overlays/btw-inject.ts +91 -0
- package/src/overlays/btw-panel.ts +53 -12
- package/src/overlays/extensions/extension-dashboard.ts +7 -8
- package/src/overlays/hook-editor.ts +6 -0
- package/src/overlays/jobs-panel.ts +82 -22
- package/src/overlays/login-dialog.ts +8 -26
- package/src/overlays/model-browser.ts +69 -10
- package/src/overlays/session-selector.ts +25 -5
- package/src/overlays/settings-defs.ts +2 -2
- package/src/overlays/settings-selector.ts +113 -11
- package/src/overlays/tree-selector.ts +83 -27
- package/src/overlays/usage-dashboard.ts +4 -6
- package/src/prompt/composer.ts +17 -5
- package/src/render/code-cell.ts +1 -1
- package/src/render/file-list.ts +4 -7
- package/src/render/render-utils.d.ts +23 -1
- package/src/render/render-utils.ts +38 -6
- package/src/setup/scenes/glyph.ts +1 -1
- package/src/setup/scenes/language.ts +122 -0
- package/src/setup/scenes/types.ts +6 -0
- package/src/setup/setup-version.ts +1 -1
- package/src/setup/wizard.ts +2 -0
- package/src/status-line/startup.ts +36 -70
- package/src/terminal-capabilities.d.ts +1 -1
- package/src/terminal-capabilities.ts +5 -0
- package/src/theme/symbols.d.ts +3 -1
- package/src/theme/symbols.ts +16 -9
- package/src/theme/theme-class.d.ts +1 -0
- package/src/theme/theme-class.ts +15 -3
- package/src/theme/theme.d.ts +1 -1
- package/src/theme/theme.ts +1 -0
- package/src/theme/tui-adapters.d.ts +2 -0
- package/src/theme/tui-adapters.ts +8 -3
- package/src/thinking.d.ts +8 -6
- package/src/thinking.ts +17 -11
- package/src/tmux.ts +1 -0
- package/src/tools/agent-tree.ts +13 -11
- package/src/tools/ask.ts +24 -37
- package/src/tools/ast-edit.ts +48 -93
- package/src/tools/ast-grep.d.ts +2 -0
- package/src/tools/ast-grep.ts +31 -67
- package/src/tools/bash.ts +7 -0
- package/src/tools/default-renderer.ts +1 -1
- package/src/tools/edit.ts +50 -43
- package/src/tools/eval.d.ts +2 -0
- package/src/tools/eval.ts +2 -0
- package/src/tools/fetch.ts +2 -1
- package/src/tools/find.d.ts +1 -1
- package/src/tools/find.ts +13 -5
- package/src/tools/github.ts +14 -46
- package/src/tools/glob.ts +2 -1
- package/src/tools/grep.ts +47 -277
- package/src/tools/grouped-file-output.d.ts +100 -19
- package/src/tools/grouped-file-output.ts +414 -103
- package/src/tools/hashline-format.d.ts +5 -0
- package/src/tools/hashline-format.ts +5 -0
- package/src/tools/json-tree.ts +1 -5
- package/src/tools/lsp.ts +210 -32
- package/src/tools/native-view.d.ts +2 -0
- package/src/tools/native-view.ts +11 -5
- package/src/tools/output-meta.d.ts +27 -0
- package/src/tools/output-meta.ts +68 -4
- package/src/tools/proc-render.ts +3 -3
- package/src/tools/read.d.ts +14 -4
- package/src/tools/read.ts +20 -5
- package/src/tools/task.d.ts +4 -3
- package/src/tools/task.ts +41 -81
- package/src/tools/vibe.ts +4 -4
- package/src/tools/wait.d.ts +2 -0
- package/src/tools/wait.ts +8 -5
- package/src/tools/write.ts +17 -27
- package/src/tools/yield.ts +1 -1
- package/src/tui.d.ts +12 -0
- package/src/tui.ts +91 -9
- package/src/utils.d.ts +4 -0
- package/src/utils.ts +10 -0
|
@@ -629,6 +629,18 @@ export class SettingsSelectorComponent implements Component {
|
|
|
629
629
|
/** Single-line editor backing the search banner (cursor, word ops, paste). */
|
|
630
630
|
#searchInput = new Input();
|
|
631
631
|
#searchMatchCount = 0;
|
|
632
|
+
/**
|
|
633
|
+
* Bumped whenever the native page's structure or values may have changed.
|
|
634
|
+
* `#describePrefs` uses it to skip rebuilding hundreds of rows on frames
|
|
635
|
+
* where nothing moved; the terminal patches the same node in place.
|
|
636
|
+
*/
|
|
637
|
+
#prefsRevision = 0;
|
|
638
|
+
/**
|
|
639
|
+
* Search text typed since the last frame. Keys can arrive in a burst (a
|
|
640
|
+
* paste, fast typing); ranking every settings tab for each byte makes the
|
|
641
|
+
* page stutter, so the burst is coalesced into one rebuild per frame.
|
|
642
|
+
*/
|
|
643
|
+
#pendingSearchQuery: string | null = null;
|
|
632
644
|
/** First matching item id per tab id, for Tab-key jumps while searching. */
|
|
633
645
|
#searchFirstMatch = new Map<string, string>();
|
|
634
646
|
/**
|
|
@@ -675,6 +687,7 @@ export class SettingsSelectorComponent implements Component {
|
|
|
675
687
|
}
|
|
676
688
|
|
|
677
689
|
invalidate(): void {
|
|
690
|
+
this.#prefsRevision += 1;
|
|
678
691
|
this.#tabBar.invalidate();
|
|
679
692
|
this.#currentList?.invalidate();
|
|
680
693
|
this.#searchList?.invalidate();
|
|
@@ -683,12 +696,22 @@ export class SettingsSelectorComponent implements Component {
|
|
|
683
696
|
|
|
684
697
|
/** Swap the active content (per-tab list, search list, or plugins). */
|
|
685
698
|
#setContent(build: () => void): void {
|
|
699
|
+
this.#prefsRevision += 1;
|
|
686
700
|
this.#currentList = null;
|
|
687
701
|
this.#searchList = null;
|
|
688
702
|
this.#pluginComponent = null;
|
|
689
703
|
build();
|
|
690
704
|
}
|
|
691
705
|
|
|
706
|
+
/** Apply search text typed since the last frame, once. */
|
|
707
|
+
#flushSearchQuery(): void {
|
|
708
|
+
const pending = this.#pendingSearchQuery;
|
|
709
|
+
if (pending === null) return;
|
|
710
|
+
this.#pendingSearchQuery = null;
|
|
711
|
+
if (pending.length === 0) this.#endSearch(false);
|
|
712
|
+
else this.#setSearchQuery(pending);
|
|
713
|
+
}
|
|
714
|
+
|
|
692
715
|
#switchToTab(tabId: SettingTab | "plugins"): void {
|
|
693
716
|
this.#currentTabId = tabId;
|
|
694
717
|
this.#setContent(() => {
|
|
@@ -737,6 +760,7 @@ export class SettingsSelectorComponent implements Component {
|
|
|
737
760
|
* then a footer hint pinned above the bottom border.
|
|
738
761
|
*/
|
|
739
762
|
render(width: number): readonly string[] {
|
|
763
|
+
this.#flushSearchQuery();
|
|
740
764
|
const height = Math.max(14, process.stdout.rows || 40);
|
|
741
765
|
const innerWidth = Math.max(1, width - 4);
|
|
742
766
|
|
|
@@ -801,6 +825,7 @@ export class SettingsSelectorComponent implements Component {
|
|
|
801
825
|
* root card of today's generic composition.
|
|
802
826
|
*/
|
|
803
827
|
describe(cx: DescribeContext): NativeNode {
|
|
828
|
+
this.#flushSearchQuery();
|
|
804
829
|
return cx.supports("prefs") ? this.#describePrefs() : this.#describeCard();
|
|
805
830
|
}
|
|
806
831
|
|
|
@@ -826,14 +851,45 @@ export class SettingsSelectorComponent implements Component {
|
|
|
826
851
|
});
|
|
827
852
|
pages.push({ id: PLUGINS_PAGE, label: "Installed", icon: "plugins", group: "Plugins" });
|
|
828
853
|
|
|
829
|
-
let sections: TspPrefsProps["sections"] = [];
|
|
830
854
|
let focus: string | null = null;
|
|
831
855
|
let editing: TspPrefsProps["editing"] = null;
|
|
832
|
-
const children: NativeChild[] = [];
|
|
833
856
|
if (pluginPage) {
|
|
834
|
-
sections = pluginPage.sections;
|
|
835
857
|
focus = pluginPage.focus;
|
|
836
858
|
editing = pluginPage.editing;
|
|
859
|
+
} else if (list) {
|
|
860
|
+
const at = list.prefsFocus();
|
|
861
|
+
focus = at.row ?? (at.section ? prefsSectionId(at.section) : null);
|
|
862
|
+
editing = list.prefsEditing(id => this.#inlineMenu(id));
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
// Rebuilding every row and JSON-stringifying them each frame is what
|
|
866
|
+
// made the page stutter while typing in search. The revision covers
|
|
867
|
+
// every value/list change; focus, editing, the open menu and the search
|
|
868
|
+
// text cover the rest. Only a real change pays for the full build.
|
|
869
|
+
let signature: string | null = null;
|
|
870
|
+
if (!pluginPage) {
|
|
871
|
+
const preview = tab === "appearance" && !searching ? this.#getStatusPreviewString() : "";
|
|
872
|
+
const pageKey = pages.map(page => `${page.id}:${page.changed ?? 0}`).join(",");
|
|
873
|
+
const cursor = searching ? this.#searchInput.getCursor() : -1;
|
|
874
|
+
signature = [
|
|
875
|
+
this.#prefsRevision,
|
|
876
|
+
this.#currentTabId,
|
|
877
|
+
searching ? 1 : 0,
|
|
878
|
+
this.#searchQuery,
|
|
879
|
+
cursor,
|
|
880
|
+
pageKey,
|
|
881
|
+
focus ?? "",
|
|
882
|
+
editing ? JSON.stringify(editing) : "",
|
|
883
|
+
list?.openSubmenu?.id ?? "",
|
|
884
|
+
preview,
|
|
885
|
+
].join("\u0000");
|
|
886
|
+
if (memo.prefs?.signature === signature) return memo.prefs.node;
|
|
887
|
+
}
|
|
888
|
+
|
|
889
|
+
let sections: TspPrefsProps["sections"] = [];
|
|
890
|
+
const children: NativeChild[] = [];
|
|
891
|
+
if (pluginPage) {
|
|
892
|
+
sections = pluginPage.sections;
|
|
837
893
|
if (pluginPage.editor) children.push(pluginPage.editor);
|
|
838
894
|
} else if (list) {
|
|
839
895
|
sections = list.prefsSections(
|
|
@@ -845,9 +901,6 @@ export class SettingsSelectorComponent implements Component {
|
|
|
845
901
|
},
|
|
846
902
|
item => this.#prefsControl(item.id, item.currentValue),
|
|
847
903
|
);
|
|
848
|
-
const at = list.prefsFocus();
|
|
849
|
-
focus = at.row ?? (at.section ? prefsSectionId(at.section) : null);
|
|
850
|
-
editing = list.prefsEditing(id => this.#inlineMenu(id));
|
|
851
904
|
const open = list.openSubmenu;
|
|
852
905
|
if (open && !editing) {
|
|
853
906
|
// Pickers describe themselves as a sheet; anything else sits in a card over the page.
|
|
@@ -889,15 +942,17 @@ export class SettingsSelectorComponent implements Component {
|
|
|
889
942
|
focus,
|
|
890
943
|
editing,
|
|
891
944
|
};
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
945
|
+
if (signature === null) {
|
|
946
|
+
// The plugin page owns its own structure; keep the structural memo.
|
|
947
|
+
signature = JSON.stringify(props);
|
|
948
|
+
if (memo.prefs && memo.prefs.signature === signature && sameItems(memo.prefs.children, children)) {
|
|
949
|
+
return memo.prefs.node;
|
|
950
|
+
}
|
|
895
951
|
}
|
|
896
952
|
const root = node("prefs", props, children);
|
|
897
953
|
memo.prefs = { signature, children, node: root };
|
|
898
954
|
return root;
|
|
899
955
|
}
|
|
900
|
-
|
|
901
956
|
/** Settings changed from their default on `tab` (visible ones only); cached until the items rebuild. */
|
|
902
957
|
#changedCount(tab: SettingTab): number {
|
|
903
958
|
const cached = this.#changedCounts.get(tab);
|
|
@@ -1032,6 +1087,10 @@ export class SettingsSelectorComponent implements Component {
|
|
|
1032
1087
|
}
|
|
1033
1088
|
if (list.openSubmenu) list.handleInput(ESCAPE);
|
|
1034
1089
|
list.selectItem(event.item);
|
|
1090
|
+
// Tern reports a click on the row itself (not its control) as
|
|
1091
|
+
// `select`. A label click is the click users make to open a popup or
|
|
1092
|
+
// a text field, so open the editor the control would have opened.
|
|
1093
|
+
if (this.#opensOnRowClick(event.item)) list.openSubmenuFor(event.item);
|
|
1035
1094
|
return;
|
|
1036
1095
|
}
|
|
1037
1096
|
case "activate":
|
|
@@ -1051,6 +1110,31 @@ export class SettingsSelectorComponent implements Component {
|
|
|
1051
1110
|
if (id !== this.#currentTabId) this.#tabBar.selectTab(id);
|
|
1052
1111
|
}
|
|
1053
1112
|
|
|
1113
|
+
/**
|
|
1114
|
+
* Rows whose control is a popup, a text field or an action button: a click
|
|
1115
|
+
* on the row's label should open it. Segments, switches, steppers and chip
|
|
1116
|
+
* rows act in place and must not grow a menu from a label click.
|
|
1117
|
+
*/
|
|
1118
|
+
#opensOnRowClick(id: string): boolean {
|
|
1119
|
+
const def = getSettingDef(this.#context.settings.entries, id);
|
|
1120
|
+
if (!def) return false;
|
|
1121
|
+
if (def.type === "text" || def.type === "providerLimits") return true;
|
|
1122
|
+
if (def.type === "submenu") {
|
|
1123
|
+
if (numberSteps(def)) return false;
|
|
1124
|
+
const options = this.#submenuOptions(def);
|
|
1125
|
+
return (
|
|
1126
|
+
PREVIEWED_SETTINGS.has(def.path) ||
|
|
1127
|
+
options.some(option => option.description) ||
|
|
1128
|
+
options.length > 4 ||
|
|
1129
|
+
options.reduce((width, option) => width + option.label.length, 0) > 28
|
|
1130
|
+
);
|
|
1131
|
+
}
|
|
1132
|
+
if (def.type === "enum") {
|
|
1133
|
+
return def.values.length > 4 || def.values.reduce((width, value) => width + value.length, 0) > 28;
|
|
1134
|
+
}
|
|
1135
|
+
return false;
|
|
1136
|
+
}
|
|
1137
|
+
|
|
1054
1138
|
/** A pointer value change on row `id`, through the path its keys take (see {@link #handlePrefsEvent}). */
|
|
1055
1139
|
#applyPrefsChange(
|
|
1056
1140
|
list: SettingsList,
|
|
@@ -1121,7 +1205,9 @@ export class SettingsSelectorComponent implements Component {
|
|
|
1121
1205
|
|
|
1122
1206
|
/** Rebuilds the visible items after a change made outside a list's own `onChange` (changed flags, conditions). */
|
|
1123
1207
|
#refreshItems(): void {
|
|
1208
|
+
this.#prefsRevision += 1;
|
|
1124
1209
|
if (this.#searchList) {
|
|
1210
|
+
this.#flushSearchQuery();
|
|
1125
1211
|
this.#searchCorpora = null;
|
|
1126
1212
|
this.#setSearchQuery(this.#searchQuery);
|
|
1127
1213
|
} else if (this.#currentTabId !== "plugins")
|
|
@@ -1213,6 +1299,8 @@ export class SettingsSelectorComponent implements Component {
|
|
|
1213
1299
|
* jump, while searching), unless an open submenu owns the pointer.
|
|
1214
1300
|
*/
|
|
1215
1301
|
handleNativeEvent(event: NativeUiEvent): void {
|
|
1302
|
+
this.#flushSearchQuery();
|
|
1303
|
+
this.#prefsRevision += 1;
|
|
1216
1304
|
if (event.key === "") {
|
|
1217
1305
|
this.#handlePrefsEvent(event);
|
|
1218
1306
|
return;
|
|
@@ -1230,6 +1318,7 @@ export class SettingsSelectorComponent implements Component {
|
|
|
1230
1318
|
* activates it (toggle / open submenu).
|
|
1231
1319
|
*/
|
|
1232
1320
|
#handleMouse(data: string): boolean {
|
|
1321
|
+
this.#flushSearchQuery();
|
|
1233
1322
|
return routeSgrMouseInput(data, event => this.#routeMouseEvent(event));
|
|
1234
1323
|
}
|
|
1235
1324
|
|
|
@@ -1274,6 +1363,7 @@ export class SettingsSelectorComponent implements Component {
|
|
|
1274
1363
|
return true;
|
|
1275
1364
|
}
|
|
1276
1365
|
if (overContent && list) {
|
|
1366
|
+
this.#prefsRevision += 1;
|
|
1277
1367
|
const itemId = list.hoverTest(contentLine, innerCol);
|
|
1278
1368
|
const id = itemId ?? list.hitTest(contentLine, innerCol);
|
|
1279
1369
|
if (id !== undefined) {
|
|
@@ -1292,6 +1382,7 @@ export class SettingsSelectorComponent implements Component {
|
|
|
1292
1382
|
|
|
1293
1383
|
/** Swap the tab content for the global search result list. */
|
|
1294
1384
|
#startSearch(initialQuery: string): void {
|
|
1385
|
+
this.#pendingSearchQuery = null;
|
|
1295
1386
|
this.#preSearchTabId = this.#currentTabId;
|
|
1296
1387
|
this.#searchCorpora = null;
|
|
1297
1388
|
this.#searchInput = new Input();
|
|
@@ -1325,10 +1416,12 @@ export class SettingsSelectorComponent implements Component {
|
|
|
1325
1416
|
*/
|
|
1326
1417
|
#setSearchQuery(query: string): void {
|
|
1327
1418
|
if (!this.#searchList) return;
|
|
1419
|
+
this.#pendingSearchQuery = null;
|
|
1328
1420
|
if (query.length === 0) {
|
|
1329
1421
|
this.#endSearch(false);
|
|
1330
1422
|
return;
|
|
1331
1423
|
}
|
|
1424
|
+
this.#prefsRevision += 1;
|
|
1332
1425
|
this.#searchQuery = query;
|
|
1333
1426
|
this.#changedCounts.clear();
|
|
1334
1427
|
|
|
@@ -1390,6 +1483,8 @@ export class SettingsSelectorComponent implements Component {
|
|
|
1390
1483
|
*/
|
|
1391
1484
|
#endSearch(jumpToSelection: boolean): void {
|
|
1392
1485
|
if (!this.#searchList) return;
|
|
1486
|
+
this.#pendingSearchQuery = null;
|
|
1487
|
+
this.#prefsRevision += 1;
|
|
1393
1488
|
const selected = jumpToSelection ? this.#searchList.getSelectedItem() : undefined;
|
|
1394
1489
|
const selectedDef = selected ? getSettingDef(this.#context.settings.entries, selected.id) : undefined;
|
|
1395
1490
|
const targetTab: SettingTab | "plugins" = selectedDef?.tab ?? this.#preSearchTabId;
|
|
@@ -1875,6 +1970,7 @@ export class SettingsSelectorComponent implements Component {
|
|
|
1875
1970
|
/** Re-evaluate condition gates against the current settings and refresh the active list. */
|
|
1876
1971
|
#refreshCurrentTabItems(defs: SettingDef[]): void {
|
|
1877
1972
|
if (this.#currentTabId === "plugins" || !this.#currentList) return;
|
|
1973
|
+
this.#prefsRevision += 1;
|
|
1878
1974
|
this.#currentList.setItems(this.#buildItemsForDefs(defs));
|
|
1879
1975
|
}
|
|
1880
1976
|
|
|
@@ -1917,6 +2013,9 @@ export class SettingsSelectorComponent implements Component {
|
|
|
1917
2013
|
this.#handleMouse(data);
|
|
1918
2014
|
return;
|
|
1919
2015
|
}
|
|
2016
|
+
this.#flushSearchQuery();
|
|
2017
|
+
// Any key can move the selection, edit a draft or change the search.
|
|
2018
|
+
this.#prefsRevision += 1;
|
|
1920
2019
|
|
|
1921
2020
|
// Text-input submenus take every byte: arrow keys must reach the
|
|
1922
2021
|
// cursor and Tab must not switch tabs.
|
|
@@ -1998,6 +2097,9 @@ export class SettingsSelectorComponent implements Component {
|
|
|
1998
2097
|
// cursor movement, word ops, kill ring, undo, paste.
|
|
1999
2098
|
this.#searchInput.handleInput(data);
|
|
2000
2099
|
const value = this.#searchInput.getValue();
|
|
2001
|
-
if (value !== this.#searchQuery)
|
|
2100
|
+
if (value !== this.#searchQuery) {
|
|
2101
|
+
this.#pendingSearchQuery = value;
|
|
2102
|
+
this.#context.requestRender?.();
|
|
2103
|
+
}
|
|
2002
2104
|
}
|
|
2003
2105
|
}
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
TruncatedText,
|
|
11
11
|
truncateToWidth,
|
|
12
12
|
} from "../index";
|
|
13
|
-
import { isRecord, sanitizeText } from "@linxiraos/pi-utils";
|
|
13
|
+
import { isRecord, oklabDistance, sanitizeText } from "@linxiraos/pi-utils";
|
|
14
14
|
/** Available session-tree display filters. */
|
|
15
15
|
export const TREE_FILTER_MODES = ["default", "no-tools", "user-only", "labeled-only", "all"] as const;
|
|
16
16
|
/** Session-tree display filter. */
|
|
@@ -94,10 +94,15 @@ interface AdvisorTreeDisplay {
|
|
|
94
94
|
*/
|
|
95
95
|
function sanitizeTreeField(value: string): string {
|
|
96
96
|
return sanitizeText(value)
|
|
97
|
-
.replace(/[\n\t]/g, " ")
|
|
97
|
+
.replace(/[\r\n\t\u2028\u2029]/g, " ")
|
|
98
98
|
.trim();
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
+
/** Strip ANSI/control characters and fold line breaks for single-line tree rows and headers. */
|
|
102
|
+
function treeRowText(value: string): string {
|
|
103
|
+
return plainText(value.replace(/[\r\n\u2028\u2029]/g, " "));
|
|
104
|
+
}
|
|
105
|
+
|
|
101
106
|
/**
|
|
102
107
|
* Extract display metadata from an advisor custom-message's `details.notes`,
|
|
103
108
|
* ignoring the model-facing `<advisory>` wrapper stored in `content`. Collects
|
|
@@ -165,10 +170,38 @@ function stripSystemWrapperTags(content: string): string {
|
|
|
165
170
|
/** Per-message cap on text folded into the tree search index. */
|
|
166
171
|
const SEARCH_TEXT_LIMIT = 200;
|
|
167
172
|
|
|
168
|
-
/** One theme-colored piece of an entry's display text. */
|
|
173
|
+
/** One theme-colored piece of an entry's display text; `strong` draws it bold. */
|
|
169
174
|
interface EntryPart {
|
|
170
175
|
t: string;
|
|
171
176
|
s?: ThemeColor;
|
|
177
|
+
strong?: boolean;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/** An entry part as a native span. */
|
|
181
|
+
function partSpan(part: EntryPart): TspSpan {
|
|
182
|
+
const style = part.strong ? (part.s ? `${part.s} strong` : "strong") : part.s;
|
|
183
|
+
return span(treeRowText(part.t), style);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/** OKLab distance under which two role colors read as the same color. */
|
|
187
|
+
const SAME_COLOR_DISTANCE = 0.05;
|
|
188
|
+
|
|
189
|
+
let assistantLabel: { theme: typeof theme; color: ThemeColor } | undefined;
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* The `assistant:` label color: `success`, unless it looks like the `user:` label's
|
|
193
|
+
* `accent` (`dark-terminal`, `*-poimandres`); then the path color, then `muted`.
|
|
194
|
+
*/
|
|
195
|
+
function assistantLabelColor(): ThemeColor {
|
|
196
|
+
if (assistantLabel?.theme !== theme) {
|
|
197
|
+
const accent = theme.getColorHex("accent");
|
|
198
|
+
const color =
|
|
199
|
+
(["success", "statusLinePath"] as const).find(
|
|
200
|
+
c => oklabDistance(theme.getColorHex(c), accent) >= SAME_COLOR_DISTANCE,
|
|
201
|
+
) ?? "muted";
|
|
202
|
+
assistantLabel = { theme, color };
|
|
203
|
+
}
|
|
204
|
+
return assistantLabel.color;
|
|
172
205
|
}
|
|
173
206
|
|
|
174
207
|
/** A cached native tree item and the inputs it was built from. */
|
|
@@ -234,6 +267,8 @@ class TreeList implements Component {
|
|
|
234
267
|
| undefined;
|
|
235
268
|
/** Bumped on every label edit: labels are item badges. */
|
|
236
269
|
#labelVersion = 0;
|
|
270
|
+
/** Theme the native item caches were built under: labels bake in the `assistant:` color. */
|
|
271
|
+
#nativeTheme = theme;
|
|
237
272
|
#pickerItems:
|
|
238
273
|
| { rows: readonly TreeRow<TreeSelectorNode, string>[]; labels: number; items: TspPickerItem[] }
|
|
239
274
|
| undefined;
|
|
@@ -703,6 +738,7 @@ class TreeList implements Component {
|
|
|
703
738
|
* only `order` (the visible entries) and the selection.
|
|
704
739
|
*/
|
|
705
740
|
pickerView(): TreePickerView {
|
|
741
|
+
this.#syncNativeTheme();
|
|
706
742
|
const allRows = this.#tree.allRows;
|
|
707
743
|
if (this.#pickerItems?.rows !== allRows || this.#pickerItems.labels !== this.#labelVersion) {
|
|
708
744
|
// Real branch points get a disclosure; linear chains stay flat at their head's depth.
|
|
@@ -734,9 +770,7 @@ class TreeList implements Component {
|
|
|
734
770
|
#pickerItem(row: TreeRow<TreeSelectorNode, string>, open: boolean): TspPickerItem {
|
|
735
771
|
const item = row.item;
|
|
736
772
|
const entry = item.entry;
|
|
737
|
-
const label = this.#entryParts(item).map(
|
|
738
|
-
span(part.t.includes("\x1b") ? plainText(part.t) : part.t, part.s),
|
|
739
|
-
);
|
|
773
|
+
const label = this.#entryParts(item).map(partSpan);
|
|
740
774
|
let kind: TspPickerItem["node"] = "marker";
|
|
741
775
|
let role: string | undefined;
|
|
742
776
|
if (isUserRequestEntry(entry)) {
|
|
@@ -755,7 +789,7 @@ class TreeList implements Component {
|
|
|
755
789
|
node: kind,
|
|
756
790
|
...(role ? { role } : {}),
|
|
757
791
|
...(open ? { open: true } : {}),
|
|
758
|
-
...(item.label ? { badges: [{ text:
|
|
792
|
+
...(item.label ? { badges: [{ text: treeRowText(item.label), tone: "warning" as const }] } : {}),
|
|
759
793
|
...(this.#activePathIds.has(row.key) ? { dot: "accent" as const } : {}),
|
|
760
794
|
};
|
|
761
795
|
}
|
|
@@ -772,7 +806,7 @@ class TreeList implements Component {
|
|
|
772
806
|
if (selected) {
|
|
773
807
|
const entry = selected.entry;
|
|
774
808
|
const parts = this.#entryParts(selected)
|
|
775
|
-
.map(part => (part.t
|
|
809
|
+
.map(part => treeRowText(part.t))
|
|
776
810
|
.join("");
|
|
777
811
|
if (entry.type === "message" || entry.type === "custom_message") {
|
|
778
812
|
const target: OutlineTarget = {
|
|
@@ -784,12 +818,16 @@ class TreeList implements Component {
|
|
|
784
818
|
entries: [entry],
|
|
785
819
|
};
|
|
786
820
|
const copy = targetCopy(target, collectBlocks(target.entries));
|
|
787
|
-
preview.push(
|
|
788
|
-
|
|
821
|
+
preview.push(
|
|
822
|
+
text(treeRowText(`${copy.label[0]!.toUpperCase()}${copy.label.slice(1)}`), {
|
|
823
|
+
role: "zeta.picker.title",
|
|
824
|
+
}),
|
|
825
|
+
);
|
|
826
|
+
if (selected.label) preview.push(text([span(treeRowText(selected.label), "warning")]));
|
|
789
827
|
preview.push(turnPreview(target, copy.content || parts));
|
|
790
828
|
} else {
|
|
791
829
|
preview.push(text(parts, { role: "zeta.picker.title" }));
|
|
792
|
-
if (selected.label) preview.push(text([span(
|
|
830
|
+
if (selected.label) preview.push(text([span(treeRowText(selected.label), "warning")]));
|
|
793
831
|
}
|
|
794
832
|
}
|
|
795
833
|
this.#previewMemo = { node: selected, labels: this.#labelVersion, preview };
|
|
@@ -803,6 +841,7 @@ class TreeList implements Component {
|
|
|
803
841
|
* instead of drawn tree connectors.
|
|
804
842
|
*/
|
|
805
843
|
describeList(): NativeNode {
|
|
844
|
+
this.#syncNativeTheme();
|
|
806
845
|
const rows = this.#tree.rows;
|
|
807
846
|
let items = this.#itemsNative;
|
|
808
847
|
if (items?.rows !== rows) {
|
|
@@ -852,6 +891,15 @@ class TreeList implements Component {
|
|
|
852
891
|
];
|
|
853
892
|
}
|
|
854
893
|
|
|
894
|
+
/** Drop native items built under another theme. */
|
|
895
|
+
#syncNativeTheme(): void {
|
|
896
|
+
if (this.#nativeTheme === theme) return;
|
|
897
|
+
this.#nativeTheme = theme;
|
|
898
|
+
this.#pickerItems = undefined;
|
|
899
|
+
this.#itemsNative = undefined;
|
|
900
|
+
this.#itemCache.clear();
|
|
901
|
+
}
|
|
902
|
+
|
|
855
903
|
#describeRow(row: TreeRow<TreeSelectorNode, string>): NativeNode {
|
|
856
904
|
const item = row.item;
|
|
857
905
|
const branch = row.parentKey !== undefined && row.siblingCount > 1;
|
|
@@ -859,10 +907,8 @@ class TreeList implements Component {
|
|
|
859
907
|
if (cached !== undefined && cached.label === item.label && cached.branch === branch) return cached.node;
|
|
860
908
|
const label: TspSpan[] = [];
|
|
861
909
|
if (this.#activePathIds.has(row.key)) label.push(span(`${theme.md.bullet} `, "accent"));
|
|
862
|
-
if (item.label) label.push(span(`[${
|
|
863
|
-
for (const part of this.#entryParts(item))
|
|
864
|
-
label.push(span(part.t.includes("\x1b") ? plainText(part.t) : part.t, part.s));
|
|
865
|
-
}
|
|
910
|
+
if (item.label) label.push(span(`[${treeRowText(item.label)}] `, "warning"));
|
|
911
|
+
for (const part of this.#entryParts(item)) label.push(partSpan(part));
|
|
866
912
|
const described = node("item", { label, icon: branch ? "branch" : undefined }, undefined, row.key);
|
|
867
913
|
this.#itemCache.set(row.key, { label: item.label, branch, node: described });
|
|
868
914
|
return described;
|
|
@@ -954,7 +1000,7 @@ class TreeList implements Component {
|
|
|
954
1000
|
// Active path marker - shown right before the entry text
|
|
955
1001
|
const isOnActivePath = this.#activePathIds.has(node.entry.id);
|
|
956
1002
|
const pathMarker = isOnActivePath ? theme.fg("accent", `${theme.md.bullet} `) : "";
|
|
957
|
-
const label = node.label ? theme.fg("warning", `[${node.label}] `) : "";
|
|
1003
|
+
const label = node.label ? theme.fg("warning", `[${treeRowText(node.label)}] `) : "";
|
|
958
1004
|
return `${pathMarker}${label}${this.#getEntryDisplayText(node, selected)}`;
|
|
959
1005
|
}
|
|
960
1006
|
|
|
@@ -1050,7 +1096,13 @@ class TreeList implements Component {
|
|
|
1050
1096
|
|
|
1051
1097
|
#getEntryDisplayText(node: TreeSelectorNode, isSelected: boolean): string {
|
|
1052
1098
|
let result = "";
|
|
1053
|
-
for (const part of this.#entryParts(node))
|
|
1099
|
+
for (const part of this.#entryParts(node)) {
|
|
1100
|
+
let value = treeRowText(part.t);
|
|
1101
|
+
if (part.s) value = theme.fg(part.s, value);
|
|
1102
|
+
// A selected row is bolded whole; nested bold would close it early.
|
|
1103
|
+
if (part.strong && !isSelected) value = theme.bold(value);
|
|
1104
|
+
result += value;
|
|
1105
|
+
}
|
|
1054
1106
|
return isSelected ? theme.bold(result) : result;
|
|
1055
1107
|
}
|
|
1056
1108
|
|
|
@@ -1066,7 +1118,10 @@ class TreeList implements Component {
|
|
|
1066
1118
|
if (role === "user") {
|
|
1067
1119
|
const msgWithContent = msg as { content?: unknown };
|
|
1068
1120
|
const content = normalize(this.#extractContent(msgWithContent.content));
|
|
1069
|
-
return [
|
|
1121
|
+
return [
|
|
1122
|
+
{ t: "user: ", s: "accent", strong: true },
|
|
1123
|
+
{ t: content, s: "accent", strong: true },
|
|
1124
|
+
];
|
|
1070
1125
|
}
|
|
1071
1126
|
if (role === "developer") {
|
|
1072
1127
|
const msgWithContent = msg as { content?: unknown };
|
|
@@ -1078,15 +1133,10 @@ class TreeList implements Component {
|
|
|
1078
1133
|
}
|
|
1079
1134
|
if (role === "assistant") {
|
|
1080
1135
|
const presentation = resolveAssistantErrorPresentation(msg);
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
{ t: "assistant: ", s: "success" },
|
|
1084
|
-
{ t: presentation.text, s: "dim" },
|
|
1085
|
-
];
|
|
1086
|
-
}
|
|
1136
|
+
const head: EntryPart = { t: "assistant: ", s: assistantLabelColor() };
|
|
1137
|
+
if (presentation.kind === "compact-recovered") return [head, { t: presentation.text, s: "dim" }];
|
|
1087
1138
|
const msgWithContent = msg as { content?: unknown; stopReason?: string; errorMessage?: string };
|
|
1088
1139
|
const textContent = normalize(this.#extractContent(msgWithContent.content));
|
|
1089
|
-
const head: EntryPart = { t: "assistant: ", s: "success" };
|
|
1090
1140
|
if (textContent) return [head, { t: textContent }];
|
|
1091
1141
|
if (presentation.kind === "full") {
|
|
1092
1142
|
return [head, { t: normalize(presentation.text).slice(0, 80), s: "error" }];
|
|
@@ -1110,10 +1160,16 @@ class TreeList implements Component {
|
|
|
1110
1160
|
if (entry.customType === "advisor") {
|
|
1111
1161
|
const { qualifier, text } = advisorTreeDisplay(entry.details);
|
|
1112
1162
|
const label = qualifier ? `advisor (${qualifier}): ` : "advisor: ";
|
|
1113
|
-
return [
|
|
1163
|
+
return [
|
|
1164
|
+
{ t: label, s: "customMessageLabel" },
|
|
1165
|
+
{ t: normalize(text), s: "muted" },
|
|
1166
|
+
];
|
|
1114
1167
|
}
|
|
1115
1168
|
const content = stripSystemWrapperTags(this.#joinTextContent(entry.content));
|
|
1116
|
-
return [
|
|
1169
|
+
return [
|
|
1170
|
+
{ t: `[${entry.customType}]: `, s: "customMessageLabel" },
|
|
1171
|
+
{ t: normalize(content), s: "muted" },
|
|
1172
|
+
];
|
|
1117
1173
|
}
|
|
1118
1174
|
case "compaction": {
|
|
1119
1175
|
const tokens = Math.round(entry.tokensBefore / 1000);
|
|
@@ -43,7 +43,7 @@ import { editorKey, editorKeys } from "../chrome/keybinding-hints";
|
|
|
43
43
|
import type { TspSpan, TspTableColumn, TspText, TspTone } from "@linxiraos/pi-wire";
|
|
44
44
|
import { col, elapsed, node, span, text } from "../native/describe";
|
|
45
45
|
import { type DescribeContext, leafKey, type NativeChild, type NativeNode, type NativeUiEvent } from "../native/node";
|
|
46
|
-
import { actionBar, actionButton } from "../native/overlay";
|
|
46
|
+
import { actionBar, actionButton, segmentedTabs } from "../native/overlay";
|
|
47
47
|
|
|
48
48
|
/** Local calendar-day activity consumed by the usage heatmap. */
|
|
49
49
|
export interface DailyActivityPoint {
|
|
@@ -649,8 +649,8 @@ export interface UsageDashboardOptions {
|
|
|
649
649
|
export function formatActivityErrorDetail(error: string, homeDir = os.homedir()): string {
|
|
650
650
|
let text = replaceTabs(sanitizeText(error)).replace(/\s+/g, " ").trim();
|
|
651
651
|
if (homeDir) {
|
|
652
|
-
const escaped =
|
|
653
|
-
const forward = homeDir.replaceAll("\\", "/")
|
|
652
|
+
const escaped = RegExp.escape(homeDir);
|
|
653
|
+
const forward = RegExp.escape(homeDir.replaceAll("\\", "/"));
|
|
654
654
|
text = text.replace(new RegExp(`${escaped}|${forward}`, "gi"), "~");
|
|
655
655
|
}
|
|
656
656
|
return text.replace(/\.+$/, "");
|
|
@@ -1135,8 +1135,7 @@ export class UsageDashboardComponent implements Component {
|
|
|
1135
1135
|
);
|
|
1136
1136
|
}
|
|
1137
1137
|
const children: NativeChild[] = [
|
|
1138
|
-
|
|
1139
|
-
"tabs",
|
|
1138
|
+
segmentedTabs(
|
|
1140
1139
|
{
|
|
1141
1140
|
items: [
|
|
1142
1141
|
{ id: "overview", label: "Overview" },
|
|
@@ -1144,7 +1143,6 @@ export class UsageDashboardComponent implements Component {
|
|
|
1144
1143
|
],
|
|
1145
1144
|
active: this.#view,
|
|
1146
1145
|
},
|
|
1147
|
-
undefined,
|
|
1148
1146
|
"tabs",
|
|
1149
1147
|
),
|
|
1150
1148
|
node("spacer", { grow: 1 }),
|
package/src/prompt/composer.ts
CHANGED
|
@@ -103,6 +103,13 @@ export interface RuntimeChildrenOptions {
|
|
|
103
103
|
* to the roots below the transcript in render order.
|
|
104
104
|
*/
|
|
105
105
|
readonly nativeDock?: readonly Component[];
|
|
106
|
+
/**
|
|
107
|
+
* Below-transcript containers whose children continue `main` on a TSP
|
|
108
|
+
* terminal, one block each after the transcript's, instead of riding in the
|
|
109
|
+
* dock: output on its way into the transcript (shell runs deferred until the
|
|
110
|
+
* next prompt) reads as its tail, and keeps its block when it moves in.
|
|
111
|
+
*/
|
|
112
|
+
readonly nativeTail?: readonly Container[];
|
|
106
113
|
/**
|
|
107
114
|
* Below-transcript roots the user opens and closes (the editor surface that
|
|
108
115
|
* drafts and dialogs swap into, docked reports). Their rows never become
|
|
@@ -266,6 +273,7 @@ export class Composer implements TerminalFrameProvider, NativeSurfaceProvider {
|
|
|
266
273
|
#headerAfter: readonly Component[] = [];
|
|
267
274
|
#runtimeChildren: readonly Component[] = [];
|
|
268
275
|
#nativeDock: readonly Component[] | undefined;
|
|
276
|
+
#nativeTail: readonly Container[] = [];
|
|
269
277
|
/** Cache-driven status line shown until {@link setStatusComponent} mounts the session's. */
|
|
270
278
|
#startupStatus: StatusLineComponent | undefined;
|
|
271
279
|
#runtimeMounted = false;
|
|
@@ -660,10 +668,11 @@ export class Composer implements TerminalFrameProvider, NativeSurfaceProvider {
|
|
|
660
668
|
/**
|
|
661
669
|
* Describe the whole surface for a TSP terminal. `main` is the flowing
|
|
662
670
|
* document: the header (welcome, extras) and every transcript block as its
|
|
663
|
-
* own component child
|
|
664
|
-
*
|
|
665
|
-
*
|
|
666
|
-
*
|
|
671
|
+
* own component child, then the children of the
|
|
672
|
+
* {@link RuntimeChildrenOptions.nativeTail} roots. `dock` is the live chrome
|
|
673
|
+
* below the transcript in render order: pending messages, HUDs, the working
|
|
674
|
+
* row, the editor and the status line. There is no history/viewport split:
|
|
675
|
+
* retirement, resize replay and hover bands are ANSI concerns.
|
|
667
676
|
*/
|
|
668
677
|
describeSurface(): NativeSurface {
|
|
669
678
|
if (!this.#started || this.#stopped) return this.#nativeSurface;
|
|
@@ -680,7 +689,9 @@ export class Composer implements TerminalFrameProvider, NativeSurfaceProvider {
|
|
|
680
689
|
} else {
|
|
681
690
|
const transcript = roots[transcriptIndex] as TranscriptContainer;
|
|
682
691
|
main.push(...roots.slice(0, transcriptIndex), ...transcript.nativeBlocks());
|
|
683
|
-
|
|
692
|
+
for (const root of this.#nativeTail) main.push(...root.children);
|
|
693
|
+
const tail: readonly Component[] = this.#nativeTail;
|
|
694
|
+
dock.push(...(this.#nativeDock ?? roots.slice(transcriptIndex + 1).filter(root => !tail.includes(root))));
|
|
684
695
|
}
|
|
685
696
|
}
|
|
686
697
|
const previous = this.#nativeSurface;
|
|
@@ -1266,6 +1277,7 @@ export class Composer implements TerminalFrameProvider, NativeSurfaceProvider {
|
|
|
1266
1277
|
this.#chromeFloorPromoted = false;
|
|
1267
1278
|
this.#resetIdleChrome();
|
|
1268
1279
|
this.#nativeDock = options.nativeDock;
|
|
1280
|
+
this.#nativeTail = options.nativeTail ?? [];
|
|
1269
1281
|
this.#transientChrome = new Set(options.transientChrome);
|
|
1270
1282
|
this.#selfClearingChrome = new Set(options.selfClearingChrome);
|
|
1271
1283
|
this.#transientFloor = undefined;
|
package/src/render/code-cell.ts
CHANGED
package/src/render/file-list.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { node, span } from "../native/describe";
|
|
|
6
6
|
import type { NativeNode } from "../native/node";
|
|
7
7
|
import type { Theme } from "../theme/theme";
|
|
8
8
|
import { fileLinkSpan } from "./hyperlink";
|
|
9
|
+
import { formatStyledPath } from "./render-utils";
|
|
9
10
|
import { renderTreeList } from "./tree-list";
|
|
10
11
|
|
|
11
12
|
/** A file-list item with optional display metadata. */
|
|
@@ -69,15 +70,11 @@ export function renderFileList(options: FileListOptions, theme: Theme): string[]
|
|
|
69
70
|
const isDirectory = entry.isDirectory ?? entry.path.endsWith("/");
|
|
70
71
|
const displayPath = entry.path;
|
|
71
72
|
const lang = isDirectory ? undefined : getLanguageFromPath(displayPath);
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
: isDirectory
|
|
75
|
-
? theme.fg("accent", theme.icon.folder)
|
|
76
|
-
: theme.fg("muted", theme.getLangIcon(lang));
|
|
77
|
-
const labelColor = isDirectory ? "accent" : "toolOutput";
|
|
73
|
+
// Type icons stay muted beside the dim directory and colored file name.
|
|
74
|
+
const icon = !showIcons ? "" : theme.fg("muted", isDirectory ? theme.icon.folder : theme.getLangIcon(lang));
|
|
78
75
|
const meta = entry.meta ? ` ${theme.fg("dim", entry.meta)}` : "";
|
|
79
76
|
const iconPrefix = icon ? `${icon} ` : "";
|
|
80
|
-
const pathStr =
|
|
77
|
+
const pathStr = formatStyledPath(displayPath, theme);
|
|
81
78
|
const linkedPath = entry.absPath && hyperlinkFn ? hyperlinkFn(entry.absPath, pathStr) : pathStr;
|
|
82
79
|
return `${iconPrefix}${linkedPath}${meta}`;
|
|
83
80
|
},
|