ccstatusline-usage 2.1.4 → 2.1.5
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 +4 -0
- package/dist/ccstatusline.js +623 -95
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -46,6 +46,10 @@
|
|
|
46
46
|
|
|
47
47
|
## 🆕 Recent Updates
|
|
48
48
|
|
|
49
|
+
### [v2.1.5](https://github.com/pcvelz/ccstatusline-usage/releases/tag/v2.1.5) - Claude Code Teams compatibility
|
|
50
|
+
|
|
51
|
+
- [pcvelz/ccstatusline-usage](https://github.com/pcvelz/ccstatusline-usage): **Teams mode support** — automatically detects Claude Code's native Teams sessions (orchestrator + teammates in tmux split panes) and applies compact rendering for the narrow orchestrator pane. Widgets render at half terminal width to fit CC's two-column status bar layout.
|
|
52
|
+
|
|
49
53
|
### [v2.1.4](https://github.com/pcvelz/ccstatusline-usage/releases/tag/v2.1.4) - Compact mode widget-boundary wrapping
|
|
50
54
|
|
|
51
55
|
- [pcvelz/ccstatusline-usage](https://github.com/pcvelz/ccstatusline-usage): **Widget-boundary wrapping** — compact mode now wraps at widget boundaries instead of mid-widget, using a dedicated compact renderer (`compact-renderer.ts`). Widgets that don't fit on the current line cleanly wrap to the next:
|
package/dist/ccstatusline.js
CHANGED
|
@@ -51450,7 +51450,7 @@ import { execSync as execSync3 } from "child_process";
|
|
|
51450
51450
|
import * as fs5 from "fs";
|
|
51451
51451
|
import * as path4 from "path";
|
|
51452
51452
|
var __dirname = "/Users/peter/Documents/Code/ccstatusline-usage/src/utils";
|
|
51453
|
-
var PACKAGE_VERSION = "2.1.
|
|
51453
|
+
var PACKAGE_VERSION = "2.1.5";
|
|
51454
51454
|
function getPackageVersion() {
|
|
51455
51455
|
if (/^\d+\.\d+\.\d+/.test(PACKAGE_VERSION)) {
|
|
51456
51456
|
return PACKAGE_VERSION;
|
|
@@ -52287,6 +52287,18 @@ function getDefaultPowerlineTheme() {
|
|
|
52287
52287
|
return "nord-aurora";
|
|
52288
52288
|
}
|
|
52289
52289
|
|
|
52290
|
+
// src/utils/input-guards.ts
|
|
52291
|
+
var CONTROL_CHAR_REGEX = /[\u0000-\u001F\u007F]/u;
|
|
52292
|
+
var shouldInsertInput = (input, key) => {
|
|
52293
|
+
if (!input) {
|
|
52294
|
+
return false;
|
|
52295
|
+
}
|
|
52296
|
+
if (key.ctrl || key.meta || key.tab) {
|
|
52297
|
+
return false;
|
|
52298
|
+
}
|
|
52299
|
+
return !CONTROL_CHAR_REGEX.test(input);
|
|
52300
|
+
};
|
|
52301
|
+
|
|
52290
52302
|
// src/widgets/Model.ts
|
|
52291
52303
|
import * as fs6 from "fs";
|
|
52292
52304
|
import { homedir as homedir4 } from "os";
|
|
@@ -52350,6 +52362,9 @@ class ModelWidget {
|
|
|
52350
52362
|
getDisplayName() {
|
|
52351
52363
|
return "Model";
|
|
52352
52364
|
}
|
|
52365
|
+
getCategory() {
|
|
52366
|
+
return "Core";
|
|
52367
|
+
}
|
|
52353
52368
|
getEditorDisplay(item) {
|
|
52354
52369
|
return { displayText: this.getDisplayName() };
|
|
52355
52370
|
}
|
|
@@ -52389,6 +52404,9 @@ class OutputStyleWidget {
|
|
|
52389
52404
|
getDisplayName() {
|
|
52390
52405
|
return "Output Style";
|
|
52391
52406
|
}
|
|
52407
|
+
getCategory() {
|
|
52408
|
+
return "Core";
|
|
52409
|
+
}
|
|
52392
52410
|
getEditorDisplay(item) {
|
|
52393
52411
|
return { displayText: this.getDisplayName() };
|
|
52394
52412
|
}
|
|
@@ -52420,6 +52438,9 @@ class GitBranchWidget {
|
|
|
52420
52438
|
getDisplayName() {
|
|
52421
52439
|
return "Git Branch";
|
|
52422
52440
|
}
|
|
52441
|
+
getCategory() {
|
|
52442
|
+
return "Git";
|
|
52443
|
+
}
|
|
52423
52444
|
getEditorDisplay(item) {
|
|
52424
52445
|
const hideNoGit = item.metadata?.hideNoGit === "true";
|
|
52425
52446
|
const modifiers = [];
|
|
@@ -52490,6 +52511,9 @@ class GitChangesWidget {
|
|
|
52490
52511
|
getDisplayName() {
|
|
52491
52512
|
return "Git Changes";
|
|
52492
52513
|
}
|
|
52514
|
+
getCategory() {
|
|
52515
|
+
return "Git";
|
|
52516
|
+
}
|
|
52493
52517
|
getEditorDisplay(item) {
|
|
52494
52518
|
const hideNoGit = item.metadata?.hideNoGit === "true";
|
|
52495
52519
|
const modifiers = [];
|
|
@@ -52579,6 +52603,9 @@ class GitWorktreeWidget {
|
|
|
52579
52603
|
getDisplayName() {
|
|
52580
52604
|
return "Git Worktree";
|
|
52581
52605
|
}
|
|
52606
|
+
getCategory() {
|
|
52607
|
+
return "Git";
|
|
52608
|
+
}
|
|
52582
52609
|
getEditorDisplay(item) {
|
|
52583
52610
|
const hideNoGit = item.metadata?.hideNoGit === "true";
|
|
52584
52611
|
const modifiers = [];
|
|
@@ -52646,7 +52673,7 @@ function getContextConfig(modelId) {
|
|
|
52646
52673
|
};
|
|
52647
52674
|
if (!modelId)
|
|
52648
52675
|
return defaultConfig;
|
|
52649
|
-
if (modelId.
|
|
52676
|
+
if (modelId.toLowerCase().includes("[1m]")) {
|
|
52650
52677
|
return {
|
|
52651
52678
|
maxTokens: 1e6,
|
|
52652
52679
|
usableTokens: 800000
|
|
@@ -53342,6 +53369,9 @@ class TokensInputWidget {
|
|
|
53342
53369
|
getDisplayName() {
|
|
53343
53370
|
return "Tokens Input";
|
|
53344
53371
|
}
|
|
53372
|
+
getCategory() {
|
|
53373
|
+
return "Tokens";
|
|
53374
|
+
}
|
|
53345
53375
|
getEditorDisplay(item) {
|
|
53346
53376
|
return { displayText: this.getDisplayName() };
|
|
53347
53377
|
}
|
|
@@ -53371,6 +53401,9 @@ class TokensOutputWidget {
|
|
|
53371
53401
|
getDisplayName() {
|
|
53372
53402
|
return "Tokens Output";
|
|
53373
53403
|
}
|
|
53404
|
+
getCategory() {
|
|
53405
|
+
return "Tokens";
|
|
53406
|
+
}
|
|
53374
53407
|
getEditorDisplay(item) {
|
|
53375
53408
|
return { displayText: this.getDisplayName() };
|
|
53376
53409
|
}
|
|
@@ -53400,6 +53433,9 @@ class TokensCachedWidget {
|
|
|
53400
53433
|
getDisplayName() {
|
|
53401
53434
|
return "Tokens Cached";
|
|
53402
53435
|
}
|
|
53436
|
+
getCategory() {
|
|
53437
|
+
return "Tokens";
|
|
53438
|
+
}
|
|
53403
53439
|
getEditorDisplay(item) {
|
|
53404
53440
|
return { displayText: this.getDisplayName() };
|
|
53405
53441
|
}
|
|
@@ -53429,6 +53465,9 @@ class TokensTotalWidget {
|
|
|
53429
53465
|
getDisplayName() {
|
|
53430
53466
|
return "Tokens Total";
|
|
53431
53467
|
}
|
|
53468
|
+
getCategory() {
|
|
53469
|
+
return "Tokens";
|
|
53470
|
+
}
|
|
53432
53471
|
getEditorDisplay(item) {
|
|
53433
53472
|
return { displayText: this.getDisplayName() };
|
|
53434
53473
|
}
|
|
@@ -53458,6 +53497,9 @@ class ContextLengthWidget {
|
|
|
53458
53497
|
getDisplayName() {
|
|
53459
53498
|
return "Context Length";
|
|
53460
53499
|
}
|
|
53500
|
+
getCategory() {
|
|
53501
|
+
return "Context";
|
|
53502
|
+
}
|
|
53461
53503
|
getEditorDisplay(item) {
|
|
53462
53504
|
return { displayText: this.getDisplayName() };
|
|
53463
53505
|
}
|
|
@@ -53487,6 +53529,9 @@ class ContextPercentageWidget {
|
|
|
53487
53529
|
getDisplayName() {
|
|
53488
53530
|
return "Context %";
|
|
53489
53531
|
}
|
|
53532
|
+
getCategory() {
|
|
53533
|
+
return "Context";
|
|
53534
|
+
}
|
|
53490
53535
|
getEditorDisplay(item) {
|
|
53491
53536
|
const isInverse = item.metadata?.inverse === "true";
|
|
53492
53537
|
const modifiers = [];
|
|
@@ -53549,6 +53594,9 @@ class ContextPercentageUsableWidget {
|
|
|
53549
53594
|
getDisplayName() {
|
|
53550
53595
|
return "Context % (usable)";
|
|
53551
53596
|
}
|
|
53597
|
+
getCategory() {
|
|
53598
|
+
return "Context";
|
|
53599
|
+
}
|
|
53552
53600
|
getEditorDisplay(item) {
|
|
53553
53601
|
const isInverse = item.metadata?.inverse === "true";
|
|
53554
53602
|
const modifiers = [];
|
|
@@ -53611,6 +53659,9 @@ class SessionClockWidget {
|
|
|
53611
53659
|
getDisplayName() {
|
|
53612
53660
|
return "Session Clock";
|
|
53613
53661
|
}
|
|
53662
|
+
getCategory() {
|
|
53663
|
+
return "Session";
|
|
53664
|
+
}
|
|
53614
53665
|
getEditorDisplay(item) {
|
|
53615
53666
|
return { displayText: this.getDisplayName() };
|
|
53616
53667
|
}
|
|
@@ -53639,6 +53690,9 @@ class SessionCostWidget {
|
|
|
53639
53690
|
getDisplayName() {
|
|
53640
53691
|
return "Session Cost";
|
|
53641
53692
|
}
|
|
53693
|
+
getCategory() {
|
|
53694
|
+
return "Session";
|
|
53695
|
+
}
|
|
53642
53696
|
getEditorDisplay(item) {
|
|
53643
53697
|
return { displayText: this.getDisplayName() };
|
|
53644
53698
|
}
|
|
@@ -53671,6 +53725,9 @@ class TerminalWidthWidget {
|
|
|
53671
53725
|
getDisplayName() {
|
|
53672
53726
|
return "Terminal Width";
|
|
53673
53727
|
}
|
|
53728
|
+
getCategory() {
|
|
53729
|
+
return "Environment";
|
|
53730
|
+
}
|
|
53674
53731
|
getEditorDisplay(item) {
|
|
53675
53732
|
return { displayText: this.getDisplayName() };
|
|
53676
53733
|
}
|
|
@@ -53702,6 +53759,9 @@ class VersionWidget {
|
|
|
53702
53759
|
getDisplayName() {
|
|
53703
53760
|
return "Version";
|
|
53704
53761
|
}
|
|
53762
|
+
getCategory() {
|
|
53763
|
+
return "Core";
|
|
53764
|
+
}
|
|
53705
53765
|
getEditorDisplay(item) {
|
|
53706
53766
|
return { displayText: this.getDisplayName() };
|
|
53707
53767
|
}
|
|
@@ -53734,6 +53794,9 @@ class CustomTextWidget {
|
|
|
53734
53794
|
getDisplayName() {
|
|
53735
53795
|
return "Custom Text";
|
|
53736
53796
|
}
|
|
53797
|
+
getCategory() {
|
|
53798
|
+
return "Custom";
|
|
53799
|
+
}
|
|
53737
53800
|
getEditorDisplay(item) {
|
|
53738
53801
|
const text = item.customText ?? "Empty";
|
|
53739
53802
|
return { displayText: `${this.getDisplayName()} (${text})` };
|
|
@@ -53836,7 +53899,7 @@ var CustomTextEditor = ({ widget, onComplete, onCancel }) => {
|
|
|
53836
53899
|
setText(text.slice(0, deleteFromIndex) + text.slice(deleteToIndex));
|
|
53837
53900
|
}
|
|
53838
53901
|
}
|
|
53839
|
-
} else if (input
|
|
53902
|
+
} else if (shouldInsertInput(input, key)) {
|
|
53840
53903
|
const newText = text.slice(0, cursorPos) + input + text.slice(cursorPos);
|
|
53841
53904
|
setText(newText);
|
|
53842
53905
|
setCursorPos(cursorPos + input.length);
|
|
@@ -53886,6 +53949,9 @@ class CustomCommandWidget {
|
|
|
53886
53949
|
getDisplayName() {
|
|
53887
53950
|
return "Custom Command";
|
|
53888
53951
|
}
|
|
53952
|
+
getCategory() {
|
|
53953
|
+
return "Custom";
|
|
53954
|
+
}
|
|
53889
53955
|
getEditorDisplay(item) {
|
|
53890
53956
|
const cmd = item.commandPath ?? "No command";
|
|
53891
53957
|
const truncatedCmd = cmd.length > 20 ? `${cmd.substring(0, 17)}...` : cmd;
|
|
@@ -54009,7 +54075,7 @@ var CustomCommandEditor = ({ widget, onComplete, onCancel, action }) => {
|
|
|
54009
54075
|
if (commandCursorPos < commandInput.length) {
|
|
54010
54076
|
setCommandInput(commandInput.slice(0, commandCursorPos) + commandInput.slice(commandCursorPos + 1));
|
|
54011
54077
|
}
|
|
54012
|
-
} else if (input) {
|
|
54078
|
+
} else if (shouldInsertInput(input, key)) {
|
|
54013
54079
|
setCommandInput(commandInput.slice(0, commandCursorPos) + input + commandInput.slice(commandCursorPos));
|
|
54014
54080
|
setCommandCursorPos(commandCursorPos + input.length);
|
|
54015
54081
|
}
|
|
@@ -54026,7 +54092,7 @@ var CustomCommandEditor = ({ widget, onComplete, onCancel, action }) => {
|
|
|
54026
54092
|
onCancel();
|
|
54027
54093
|
} else if (key.backspace) {
|
|
54028
54094
|
setWidthInput(widthInput.slice(0, -1));
|
|
54029
|
-
} else if (input && /\d/.test(input)) {
|
|
54095
|
+
} else if (shouldInsertInput(input, key) && /\d/.test(input)) {
|
|
54030
54096
|
setWidthInput(widthInput + input);
|
|
54031
54097
|
}
|
|
54032
54098
|
} else if (mode === "timeout") {
|
|
@@ -54042,7 +54108,7 @@ var CustomCommandEditor = ({ widget, onComplete, onCancel, action }) => {
|
|
|
54042
54108
|
onCancel();
|
|
54043
54109
|
} else if (key.backspace) {
|
|
54044
54110
|
setTimeoutInput(timeoutInput.slice(0, -1));
|
|
54045
|
-
} else if (input && /\d/.test(input)) {
|
|
54111
|
+
} else if (shouldInsertInput(input, key) && /\d/.test(input)) {
|
|
54046
54112
|
setTimeoutInput(timeoutInput + input);
|
|
54047
54113
|
}
|
|
54048
54114
|
}
|
|
@@ -54136,6 +54202,9 @@ class BlockTimerWidget {
|
|
|
54136
54202
|
getDisplayName() {
|
|
54137
54203
|
return "Block Timer";
|
|
54138
54204
|
}
|
|
54205
|
+
getCategory() {
|
|
54206
|
+
return "Session";
|
|
54207
|
+
}
|
|
54139
54208
|
getEditorDisplay(item) {
|
|
54140
54209
|
const mode = item.metadata?.display ?? "time";
|
|
54141
54210
|
const modifiers = [];
|
|
@@ -54236,8 +54305,8 @@ class BlockTimerWidget {
|
|
|
54236
54305
|
}
|
|
54237
54306
|
// src/widgets/CurrentWorkingDir.tsx
|
|
54238
54307
|
var import_react31 = __toESM(require_react(), 1);
|
|
54239
|
-
var jsx_dev_runtime3 = __toESM(require_jsx_dev_runtime(), 1);
|
|
54240
54308
|
import * as os5 from "node:os";
|
|
54309
|
+
var jsx_dev_runtime3 = __toESM(require_jsx_dev_runtime(), 1);
|
|
54241
54310
|
|
|
54242
54311
|
class CurrentWorkingDirWidget {
|
|
54243
54312
|
getDefaultColor() {
|
|
@@ -54249,6 +54318,9 @@ class CurrentWorkingDirWidget {
|
|
|
54249
54318
|
getDisplayName() {
|
|
54250
54319
|
return "Current Working Dir";
|
|
54251
54320
|
}
|
|
54321
|
+
getCategory() {
|
|
54322
|
+
return "Environment";
|
|
54323
|
+
}
|
|
54252
54324
|
getEditorDisplay(item) {
|
|
54253
54325
|
const segments = item.metadata?.segments ? parseInt(item.metadata.segments, 10) : undefined;
|
|
54254
54326
|
const fishStyle = item.metadata?.fishStyle === "true";
|
|
@@ -54391,7 +54463,7 @@ var CurrentWorkingDirEditor = ({ widget, onComplete, onCancel, action }) => {
|
|
|
54391
54463
|
onCancel();
|
|
54392
54464
|
} else if (key.backspace) {
|
|
54393
54465
|
setSegmentsInput(segmentsInput.slice(0, -1));
|
|
54394
|
-
} else if (input && /\d/.test(input)
|
|
54466
|
+
} else if (shouldInsertInput(input, key) && /\d/.test(input)) {
|
|
54395
54467
|
setSegmentsInput(segmentsInput + input);
|
|
54396
54468
|
}
|
|
54397
54469
|
}
|
|
@@ -54437,6 +54509,9 @@ class ClaudeSessionIdWidget {
|
|
|
54437
54509
|
getDisplayName() {
|
|
54438
54510
|
return "Claude Session ID";
|
|
54439
54511
|
}
|
|
54512
|
+
getCategory() {
|
|
54513
|
+
return "Core";
|
|
54514
|
+
}
|
|
54440
54515
|
getEditorDisplay(item) {
|
|
54441
54516
|
return { displayText: this.getDisplayName() };
|
|
54442
54517
|
}
|
|
@@ -54701,6 +54776,9 @@ class SessionUsageWidget {
|
|
|
54701
54776
|
getDisplayName() {
|
|
54702
54777
|
return "Session Usage";
|
|
54703
54778
|
}
|
|
54779
|
+
getCategory() {
|
|
54780
|
+
return "API Usage";
|
|
54781
|
+
}
|
|
54704
54782
|
getEditorDisplay(item) {
|
|
54705
54783
|
return { displayText: this.getDisplayName() };
|
|
54706
54784
|
}
|
|
@@ -54732,6 +54810,9 @@ class WeeklyUsageWidget {
|
|
|
54732
54810
|
getDisplayName() {
|
|
54733
54811
|
return "Weekly Usage";
|
|
54734
54812
|
}
|
|
54813
|
+
getCategory() {
|
|
54814
|
+
return "API Usage";
|
|
54815
|
+
}
|
|
54735
54816
|
getEditorDisplay(item) {
|
|
54736
54817
|
return { displayText: this.getDisplayName() };
|
|
54737
54818
|
}
|
|
@@ -54763,6 +54844,9 @@ class ResetTimerWidget {
|
|
|
54763
54844
|
getDisplayName() {
|
|
54764
54845
|
return "Reset Timer";
|
|
54765
54846
|
}
|
|
54847
|
+
getCategory() {
|
|
54848
|
+
return "API Usage";
|
|
54849
|
+
}
|
|
54766
54850
|
getEditorDisplay(item) {
|
|
54767
54851
|
return { displayText: this.getDisplayName() };
|
|
54768
54852
|
}
|
|
@@ -54822,6 +54906,9 @@ class ContextBarWidget {
|
|
|
54822
54906
|
getDisplayName() {
|
|
54823
54907
|
return "Context Bar";
|
|
54824
54908
|
}
|
|
54909
|
+
getCategory() {
|
|
54910
|
+
return "API Usage";
|
|
54911
|
+
}
|
|
54825
54912
|
getEditorDisplay(item) {
|
|
54826
54913
|
return { displayText: this.getDisplayName() };
|
|
54827
54914
|
}
|
|
@@ -54898,6 +54985,98 @@ function getAllWidgetTypes(settings) {
|
|
|
54898
54985
|
}
|
|
54899
54986
|
return allTypes;
|
|
54900
54987
|
}
|
|
54988
|
+
var LAYOUT_WIDGETS = {
|
|
54989
|
+
separator: {
|
|
54990
|
+
displayName: "Separator",
|
|
54991
|
+
description: "A separator character between status line widgets",
|
|
54992
|
+
category: "Layout"
|
|
54993
|
+
},
|
|
54994
|
+
"flex-separator": {
|
|
54995
|
+
displayName: "Flex Separator",
|
|
54996
|
+
description: "Expands to fill available terminal width",
|
|
54997
|
+
category: "Layout"
|
|
54998
|
+
}
|
|
54999
|
+
};
|
|
55000
|
+
function getLayoutCatalogEntry(type) {
|
|
55001
|
+
const layout = LAYOUT_WIDGETS[type];
|
|
55002
|
+
if (!layout) {
|
|
55003
|
+
return null;
|
|
55004
|
+
}
|
|
55005
|
+
return {
|
|
55006
|
+
type,
|
|
55007
|
+
displayName: layout.displayName,
|
|
55008
|
+
description: layout.description,
|
|
55009
|
+
category: layout.category,
|
|
55010
|
+
searchText: `${layout.displayName} ${layout.description} ${type}`.toLowerCase()
|
|
55011
|
+
};
|
|
55012
|
+
}
|
|
55013
|
+
function getWidgetCatalog(settings) {
|
|
55014
|
+
return getAllWidgetTypes(settings).map((type) => {
|
|
55015
|
+
const layoutEntry = getLayoutCatalogEntry(type);
|
|
55016
|
+
if (layoutEntry) {
|
|
55017
|
+
return layoutEntry;
|
|
55018
|
+
}
|
|
55019
|
+
const widget = getWidget(type);
|
|
55020
|
+
const displayName = widget?.getDisplayName() ?? type;
|
|
55021
|
+
const description = widget?.getDescription() ?? `Unknown widget: ${type}`;
|
|
55022
|
+
const category = widget?.getCategory() ?? "Other";
|
|
55023
|
+
return {
|
|
55024
|
+
type,
|
|
55025
|
+
displayName,
|
|
55026
|
+
description,
|
|
55027
|
+
category,
|
|
55028
|
+
searchText: `${displayName} ${description} ${type}`.toLowerCase()
|
|
55029
|
+
};
|
|
55030
|
+
});
|
|
55031
|
+
}
|
|
55032
|
+
function getWidgetCatalogCategories(catalog) {
|
|
55033
|
+
const categories = new Set;
|
|
55034
|
+
for (const entry of catalog) {
|
|
55035
|
+
categories.add(entry.category);
|
|
55036
|
+
}
|
|
55037
|
+
return Array.from(categories);
|
|
55038
|
+
}
|
|
55039
|
+
function filterWidgetCatalog(catalog, category, query) {
|
|
55040
|
+
const normalizedQuery = query.trim().toLowerCase();
|
|
55041
|
+
const categoryFiltered = category === "All" ? [...catalog] : catalog.filter((entry) => entry.category === category);
|
|
55042
|
+
const withScore = categoryFiltered.map((entry) => {
|
|
55043
|
+
if (!normalizedQuery) {
|
|
55044
|
+
return {
|
|
55045
|
+
entry,
|
|
55046
|
+
score: 99
|
|
55047
|
+
};
|
|
55048
|
+
}
|
|
55049
|
+
const name = entry.displayName.toLowerCase();
|
|
55050
|
+
const description = entry.description.toLowerCase();
|
|
55051
|
+
const type = entry.type.toLowerCase();
|
|
55052
|
+
if (name.startsWith(normalizedQuery)) {
|
|
55053
|
+
return { entry, score: 0 };
|
|
55054
|
+
}
|
|
55055
|
+
if (name.includes(normalizedQuery)) {
|
|
55056
|
+
return { entry, score: 1 };
|
|
55057
|
+
}
|
|
55058
|
+
if (type.includes(normalizedQuery)) {
|
|
55059
|
+
return { entry, score: 2 };
|
|
55060
|
+
}
|
|
55061
|
+
if (description.includes(normalizedQuery)) {
|
|
55062
|
+
return { entry, score: 3 };
|
|
55063
|
+
}
|
|
55064
|
+
if (entry.searchText.includes(normalizedQuery)) {
|
|
55065
|
+
return { entry, score: 4 };
|
|
55066
|
+
}
|
|
55067
|
+
return null;
|
|
55068
|
+
}).filter((item) => item !== null);
|
|
55069
|
+
return withScore.sort((a, b) => {
|
|
55070
|
+
if (a.score !== b.score) {
|
|
55071
|
+
return a.score - b.score;
|
|
55072
|
+
}
|
|
55073
|
+
const byDisplayName = a.entry.displayName.localeCompare(b.entry.displayName);
|
|
55074
|
+
if (byDisplayName !== 0) {
|
|
55075
|
+
return byDisplayName;
|
|
55076
|
+
}
|
|
55077
|
+
return a.entry.type.localeCompare(b.entry.type);
|
|
55078
|
+
}).map((item) => item.entry);
|
|
55079
|
+
}
|
|
54901
55080
|
|
|
54902
55081
|
// src/tui/components/ConfirmDialog.tsx
|
|
54903
55082
|
var import_react32 = __toESM(require_react(), 1);
|
|
@@ -55016,7 +55195,7 @@ var ColorMenu = ({ widgets, lineIndex, settings, onUpdate, onBack }) => {
|
|
|
55016
55195
|
}
|
|
55017
55196
|
} else if (key.backspace || key.delete) {
|
|
55018
55197
|
setHexInput(hexInput.slice(0, -1));
|
|
55019
|
-
} else if (input && hexInput.length < 6) {
|
|
55198
|
+
} else if (shouldInsertInput(input, key) && hexInput.length < 6) {
|
|
55020
55199
|
const upperInput = input.toUpperCase();
|
|
55021
55200
|
if (/^[0-9A-F]$/.test(upperInput)) {
|
|
55022
55201
|
setHexInput(hexInput + upperInput);
|
|
@@ -55054,7 +55233,7 @@ var ColorMenu = ({ widgets, lineIndex, settings, onUpdate, onBack }) => {
|
|
|
55054
55233
|
}
|
|
55055
55234
|
} else if (key.backspace || key.delete) {
|
|
55056
55235
|
setAnsi256Input(ansi256Input.slice(0, -1));
|
|
55057
|
-
} else if (input && ansi256Input.length < 3) {
|
|
55236
|
+
} else if (shouldInsertInput(input, key) && ansi256Input.length < 3) {
|
|
55058
55237
|
if (/^[0-9]$/.test(input)) {
|
|
55059
55238
|
const newInput = ansi256Input + input;
|
|
55060
55239
|
const code = parseInt(newInput, 10);
|
|
@@ -55528,7 +55707,7 @@ var GlobalOverridesMenu = ({ settings, onUpdate, onBack }) => {
|
|
|
55528
55707
|
setEditingPadding(false);
|
|
55529
55708
|
} else if (key.backspace) {
|
|
55530
55709
|
setPaddingInput(paddingInput.slice(0, -1));
|
|
55531
|
-
} else if (key.delete) {} else if (input) {
|
|
55710
|
+
} else if (key.delete) {} else if (shouldInsertInput(input, key)) {
|
|
55532
55711
|
setPaddingInput(paddingInput + input);
|
|
55533
55712
|
}
|
|
55534
55713
|
} else if (editingSeparator) {
|
|
@@ -55550,7 +55729,7 @@ var GlobalOverridesMenu = ({ settings, onUpdate, onBack }) => {
|
|
|
55550
55729
|
setEditingSeparator(false);
|
|
55551
55730
|
} else if (key.backspace) {
|
|
55552
55731
|
setSeparatorInput(separatorInput.slice(0, -1));
|
|
55553
|
-
} else if (key.delete) {} else if (input) {
|
|
55732
|
+
} else if (key.delete) {} else if (shouldInsertInput(input, key)) {
|
|
55554
55733
|
setSeparatorInput(separatorInput + input);
|
|
55555
55734
|
}
|
|
55556
55735
|
} else if (confirmingSeparator) {
|
|
@@ -56017,21 +56196,11 @@ var ItemsEditor = ({ widgets, onUpdate, onBack, lineNumber, settings }) => {
|
|
|
56017
56196
|
const [selectedIndex, setSelectedIndex] = import_react36.useState(0);
|
|
56018
56197
|
const [moveMode, setMoveMode] = import_react36.useState(false);
|
|
56019
56198
|
const [customEditorWidget, setCustomEditorWidget] = import_react36.useState(null);
|
|
56199
|
+
const [widgetPicker, setWidgetPicker] = import_react36.useState(null);
|
|
56200
|
+
const [showClearConfirm, setShowClearConfirm] = import_react36.useState(false);
|
|
56020
56201
|
const separatorChars = ["|", "-", ",", " "];
|
|
56021
|
-
const
|
|
56022
|
-
|
|
56023
|
-
if (settings.defaultSeparator) {
|
|
56024
|
-
allowedTypes = allowedTypes.filter((t) => t !== "separator");
|
|
56025
|
-
}
|
|
56026
|
-
if (settings.powerline.enabled) {
|
|
56027
|
-
allowedTypes = allowedTypes.filter((t) => t !== "separator" && t !== "flex-separator");
|
|
56028
|
-
}
|
|
56029
|
-
return allowedTypes;
|
|
56030
|
-
};
|
|
56031
|
-
const getDefaultItemType = () => {
|
|
56032
|
-
const allowedTypes = getAllowedTypes();
|
|
56033
|
-
return allowedTypes.includes("model") ? "model" : allowedTypes[0] ?? "model";
|
|
56034
|
-
};
|
|
56202
|
+
const widgetCatalog = getWidgetCatalog(settings);
|
|
56203
|
+
const widgetCategories = ["All", ...getWidgetCatalogCategories(widgetCatalog)];
|
|
56035
56204
|
const getUniqueBackgroundColor = (insertIndex) => {
|
|
56036
56205
|
if (!settings.powerline.enabled || settings.powerline.theme === "custom") {
|
|
56037
56206
|
return;
|
|
@@ -56057,10 +56226,187 @@ var ItemsEditor = ({ widgets, onUpdate, onBack, lineNumber, settings }) => {
|
|
|
56057
56226
|
const handleEditorCancel = () => {
|
|
56058
56227
|
setCustomEditorWidget(null);
|
|
56059
56228
|
};
|
|
56229
|
+
const getFilteredCategories = (query) => {
|
|
56230
|
+
return [...widgetCategories];
|
|
56231
|
+
};
|
|
56232
|
+
const normalizePickerState = (state) => {
|
|
56233
|
+
const filteredCategories = getFilteredCategories(state.categoryQuery);
|
|
56234
|
+
const selectedCategory = state.selectedCategory && filteredCategories.includes(state.selectedCategory) ? state.selectedCategory : filteredCategories[0] ?? null;
|
|
56235
|
+
const hasTopLevelSearch = state.level === "category" && state.categoryQuery.trim().length > 0;
|
|
56236
|
+
const effectiveCategory = hasTopLevelSearch ? "All" : selectedCategory ?? "All";
|
|
56237
|
+
const effectiveQuery = hasTopLevelSearch ? state.categoryQuery : state.widgetQuery;
|
|
56238
|
+
const filteredWidgets = filterWidgetCatalog(widgetCatalog, effectiveCategory, effectiveQuery);
|
|
56239
|
+
const hasSelectedType = state.selectedType ? filteredWidgets.some((entry) => entry.type === state.selectedType) : false;
|
|
56240
|
+
return {
|
|
56241
|
+
...state,
|
|
56242
|
+
selectedCategory,
|
|
56243
|
+
selectedType: hasSelectedType ? state.selectedType : filteredWidgets[0]?.type ?? null
|
|
56244
|
+
};
|
|
56245
|
+
};
|
|
56246
|
+
const openWidgetPicker = (action) => {
|
|
56247
|
+
if (widgetCatalog.length === 0) {
|
|
56248
|
+
return;
|
|
56249
|
+
}
|
|
56250
|
+
const currentType = widgets[selectedIndex]?.type;
|
|
56251
|
+
const selectedType = action === "change" ? currentType ?? null : null;
|
|
56252
|
+
setWidgetPicker(normalizePickerState({
|
|
56253
|
+
action,
|
|
56254
|
+
level: "category",
|
|
56255
|
+
selectedCategory: "All",
|
|
56256
|
+
categoryQuery: "",
|
|
56257
|
+
widgetQuery: "",
|
|
56258
|
+
selectedType
|
|
56259
|
+
}));
|
|
56260
|
+
};
|
|
56261
|
+
const applyWidgetPickerSelection = (selectedType) => {
|
|
56262
|
+
if (!widgetPicker) {
|
|
56263
|
+
return;
|
|
56264
|
+
}
|
|
56265
|
+
if (widgetPicker.action === "change") {
|
|
56266
|
+
const currentWidget2 = widgets[selectedIndex];
|
|
56267
|
+
if (currentWidget2) {
|
|
56268
|
+
const newWidgets = [...widgets];
|
|
56269
|
+
newWidgets[selectedIndex] = { ...currentWidget2, type: selectedType };
|
|
56270
|
+
onUpdate(newWidgets);
|
|
56271
|
+
}
|
|
56272
|
+
} else {
|
|
56273
|
+
const insertIndex = widgetPicker.action === "add" ? widgets.length > 0 ? selectedIndex + 1 : 0 : selectedIndex;
|
|
56274
|
+
const backgroundColor = getUniqueBackgroundColor(insertIndex);
|
|
56275
|
+
const newWidget = {
|
|
56276
|
+
id: generateGuid(),
|
|
56277
|
+
type: selectedType,
|
|
56278
|
+
...backgroundColor && { backgroundColor }
|
|
56279
|
+
};
|
|
56280
|
+
const newWidgets = [...widgets];
|
|
56281
|
+
newWidgets.splice(insertIndex, 0, newWidget);
|
|
56282
|
+
onUpdate(newWidgets);
|
|
56283
|
+
setSelectedIndex(insertIndex);
|
|
56284
|
+
}
|
|
56285
|
+
setWidgetPicker(null);
|
|
56286
|
+
};
|
|
56060
56287
|
use_input_default((input, key) => {
|
|
56061
56288
|
if (customEditorWidget) {
|
|
56062
56289
|
return;
|
|
56063
56290
|
}
|
|
56291
|
+
if (showClearConfirm) {
|
|
56292
|
+
return;
|
|
56293
|
+
}
|
|
56294
|
+
if (widgetPicker) {
|
|
56295
|
+
const filteredCategories = getFilteredCategories(widgetPicker.categoryQuery);
|
|
56296
|
+
const selectedCategory = widgetPicker.selectedCategory && filteredCategories.includes(widgetPicker.selectedCategory) ? widgetPicker.selectedCategory : filteredCategories[0] ?? null;
|
|
56297
|
+
const hasTopLevelSearch = widgetPicker.level === "category" && widgetPicker.categoryQuery.trim().length > 0;
|
|
56298
|
+
const topLevelSearchEntries2 = hasTopLevelSearch ? filterWidgetCatalog(widgetCatalog, "All", widgetPicker.categoryQuery) : [];
|
|
56299
|
+
const topLevelSelectedEntry = topLevelSearchEntries2.find((entry) => entry.type === widgetPicker.selectedType) ?? topLevelSearchEntries2[0];
|
|
56300
|
+
const filteredWidgets = filterWidgetCatalog(widgetCatalog, selectedCategory ?? "All", widgetPicker.widgetQuery);
|
|
56301
|
+
const selectedEntry = filteredWidgets.find((entry) => entry.type === widgetPicker.selectedType) ?? filteredWidgets[0];
|
|
56302
|
+
if (widgetPicker.level === "category") {
|
|
56303
|
+
if (key.escape) {
|
|
56304
|
+
if (widgetPicker.categoryQuery.length > 0) {
|
|
56305
|
+
setWidgetPicker((prev) => prev ? normalizePickerState({
|
|
56306
|
+
...prev,
|
|
56307
|
+
categoryQuery: ""
|
|
56308
|
+
}) : prev);
|
|
56309
|
+
} else {
|
|
56310
|
+
setWidgetPicker(null);
|
|
56311
|
+
}
|
|
56312
|
+
} else if (key.return) {
|
|
56313
|
+
if (hasTopLevelSearch) {
|
|
56314
|
+
if (topLevelSelectedEntry) {
|
|
56315
|
+
applyWidgetPickerSelection(topLevelSelectedEntry.type);
|
|
56316
|
+
}
|
|
56317
|
+
} else if (selectedCategory) {
|
|
56318
|
+
setWidgetPicker((prev) => prev ? normalizePickerState({
|
|
56319
|
+
...prev,
|
|
56320
|
+
level: "widget",
|
|
56321
|
+
selectedCategory
|
|
56322
|
+
}) : prev);
|
|
56323
|
+
}
|
|
56324
|
+
} else if (key.upArrow || key.downArrow) {
|
|
56325
|
+
if (hasTopLevelSearch) {
|
|
56326
|
+
if (topLevelSearchEntries2.length === 0) {
|
|
56327
|
+
return;
|
|
56328
|
+
}
|
|
56329
|
+
let currentIndex = topLevelSearchEntries2.findIndex((entry) => entry.type === widgetPicker.selectedType);
|
|
56330
|
+
if (currentIndex === -1) {
|
|
56331
|
+
currentIndex = 0;
|
|
56332
|
+
}
|
|
56333
|
+
const nextIndex = key.downArrow ? Math.min(topLevelSearchEntries2.length - 1, currentIndex + 1) : Math.max(0, currentIndex - 1);
|
|
56334
|
+
const nextType = topLevelSearchEntries2[nextIndex]?.type ?? null;
|
|
56335
|
+
setWidgetPicker((prev) => prev ? normalizePickerState({
|
|
56336
|
+
...prev,
|
|
56337
|
+
selectedType: nextType
|
|
56338
|
+
}) : prev);
|
|
56339
|
+
} else {
|
|
56340
|
+
if (filteredCategories.length === 0) {
|
|
56341
|
+
return;
|
|
56342
|
+
}
|
|
56343
|
+
let currentIndex = filteredCategories.findIndex((category) => category === selectedCategory);
|
|
56344
|
+
if (currentIndex === -1) {
|
|
56345
|
+
currentIndex = 0;
|
|
56346
|
+
}
|
|
56347
|
+
const nextIndex = key.downArrow ? Math.min(filteredCategories.length - 1, currentIndex + 1) : Math.max(0, currentIndex - 1);
|
|
56348
|
+
const nextCategory = filteredCategories[nextIndex] ?? null;
|
|
56349
|
+
setWidgetPicker((prev) => prev ? normalizePickerState({
|
|
56350
|
+
...prev,
|
|
56351
|
+
selectedCategory: nextCategory
|
|
56352
|
+
}) : prev);
|
|
56353
|
+
}
|
|
56354
|
+
} else if (key.backspace || key.delete) {
|
|
56355
|
+
setWidgetPicker((prev) => prev ? normalizePickerState({
|
|
56356
|
+
...prev,
|
|
56357
|
+
categoryQuery: prev.categoryQuery.slice(0, -1)
|
|
56358
|
+
}) : prev);
|
|
56359
|
+
} else if (input && !key.ctrl && !key.meta && !key.tab) {
|
|
56360
|
+
setWidgetPicker((prev) => prev ? normalizePickerState({
|
|
56361
|
+
...prev,
|
|
56362
|
+
categoryQuery: prev.categoryQuery + input
|
|
56363
|
+
}) : prev);
|
|
56364
|
+
}
|
|
56365
|
+
} else {
|
|
56366
|
+
if (key.escape) {
|
|
56367
|
+
if (widgetPicker.widgetQuery.length > 0) {
|
|
56368
|
+
setWidgetPicker((prev) => prev ? normalizePickerState({
|
|
56369
|
+
...prev,
|
|
56370
|
+
widgetQuery: ""
|
|
56371
|
+
}) : prev);
|
|
56372
|
+
} else {
|
|
56373
|
+
setWidgetPicker((prev) => prev ? normalizePickerState({
|
|
56374
|
+
...prev,
|
|
56375
|
+
level: "category"
|
|
56376
|
+
}) : prev);
|
|
56377
|
+
}
|
|
56378
|
+
} else if (key.return) {
|
|
56379
|
+
if (selectedEntry) {
|
|
56380
|
+
applyWidgetPickerSelection(selectedEntry.type);
|
|
56381
|
+
}
|
|
56382
|
+
} else if (key.upArrow || key.downArrow) {
|
|
56383
|
+
if (filteredWidgets.length === 0) {
|
|
56384
|
+
return;
|
|
56385
|
+
}
|
|
56386
|
+
let currentIndex = filteredWidgets.findIndex((entry) => entry.type === widgetPicker.selectedType);
|
|
56387
|
+
if (currentIndex === -1) {
|
|
56388
|
+
currentIndex = 0;
|
|
56389
|
+
}
|
|
56390
|
+
const nextIndex = key.downArrow ? Math.min(filteredWidgets.length - 1, currentIndex + 1) : Math.max(0, currentIndex - 1);
|
|
56391
|
+
const nextType = filteredWidgets[nextIndex]?.type ?? null;
|
|
56392
|
+
setWidgetPicker((prev) => prev ? normalizePickerState({
|
|
56393
|
+
...prev,
|
|
56394
|
+
selectedType: nextType
|
|
56395
|
+
}) : prev);
|
|
56396
|
+
} else if (key.backspace || key.delete) {
|
|
56397
|
+
setWidgetPicker((prev) => prev ? normalizePickerState({
|
|
56398
|
+
...prev,
|
|
56399
|
+
widgetQuery: prev.widgetQuery.slice(0, -1)
|
|
56400
|
+
}) : prev);
|
|
56401
|
+
} else if (input && !key.ctrl && !key.meta && !key.tab) {
|
|
56402
|
+
setWidgetPicker((prev) => prev ? normalizePickerState({
|
|
56403
|
+
...prev,
|
|
56404
|
+
widgetQuery: prev.widgetQuery + input
|
|
56405
|
+
}) : prev);
|
|
56406
|
+
}
|
|
56407
|
+
}
|
|
56408
|
+
return;
|
|
56409
|
+
}
|
|
56064
56410
|
if (moveMode) {
|
|
56065
56411
|
if (key.upArrow && selectedIndex > 0) {
|
|
56066
56412
|
const newWidgets = [...widgets];
|
|
@@ -56084,69 +56430,20 @@ var ItemsEditor = ({ widgets, onUpdate, onBack, lineNumber, settings }) => {
|
|
|
56084
56430
|
setMoveMode(false);
|
|
56085
56431
|
}
|
|
56086
56432
|
} else {
|
|
56087
|
-
if (key.upArrow) {
|
|
56433
|
+
if (key.upArrow && widgets.length > 0) {
|
|
56088
56434
|
setSelectedIndex(Math.max(0, selectedIndex - 1));
|
|
56089
|
-
} else if (key.downArrow) {
|
|
56435
|
+
} else if (key.downArrow && widgets.length > 0) {
|
|
56090
56436
|
setSelectedIndex(Math.min(widgets.length - 1, selectedIndex + 1));
|
|
56091
56437
|
} else if (key.leftArrow && widgets.length > 0) {
|
|
56092
|
-
|
|
56093
|
-
const currentWidget2 = widgets[selectedIndex];
|
|
56094
|
-
if (currentWidget2) {
|
|
56095
|
-
const currentType = currentWidget2.type;
|
|
56096
|
-
let currentIndex = types.indexOf(currentType);
|
|
56097
|
-
if (currentIndex === -1) {
|
|
56098
|
-
currentIndex = 0;
|
|
56099
|
-
}
|
|
56100
|
-
const prevIndex = currentIndex === 0 ? types.length - 1 : currentIndex - 1;
|
|
56101
|
-
const newWidgets = [...widgets];
|
|
56102
|
-
const prevType = types[prevIndex];
|
|
56103
|
-
if (prevType) {
|
|
56104
|
-
newWidgets[selectedIndex] = { ...currentWidget2, type: prevType };
|
|
56105
|
-
onUpdate(newWidgets);
|
|
56106
|
-
}
|
|
56107
|
-
}
|
|
56438
|
+
openWidgetPicker("change");
|
|
56108
56439
|
} else if (key.rightArrow && widgets.length > 0) {
|
|
56109
|
-
|
|
56110
|
-
const currentWidget2 = widgets[selectedIndex];
|
|
56111
|
-
if (currentWidget2) {
|
|
56112
|
-
const currentType = currentWidget2.type;
|
|
56113
|
-
let currentIndex = types.indexOf(currentType);
|
|
56114
|
-
if (currentIndex === -1) {
|
|
56115
|
-
currentIndex = 0;
|
|
56116
|
-
}
|
|
56117
|
-
const nextIndex = (currentIndex + 1) % types.length;
|
|
56118
|
-
const newWidgets = [...widgets];
|
|
56119
|
-
const nextType = types[nextIndex];
|
|
56120
|
-
if (nextType) {
|
|
56121
|
-
newWidgets[selectedIndex] = { ...currentWidget2, type: nextType };
|
|
56122
|
-
onUpdate(newWidgets);
|
|
56123
|
-
}
|
|
56124
|
-
}
|
|
56440
|
+
openWidgetPicker("change");
|
|
56125
56441
|
} else if (key.return && widgets.length > 0) {
|
|
56126
56442
|
setMoveMode(true);
|
|
56127
56443
|
} else if (input === "a") {
|
|
56128
|
-
|
|
56129
|
-
const backgroundColor = getUniqueBackgroundColor(insertIndex);
|
|
56130
|
-
const newWidget = {
|
|
56131
|
-
id: generateGuid(),
|
|
56132
|
-
type: getDefaultItemType(),
|
|
56133
|
-
...backgroundColor && { backgroundColor }
|
|
56134
|
-
};
|
|
56135
|
-
const newWidgets = [...widgets];
|
|
56136
|
-
newWidgets.splice(insertIndex, 0, newWidget);
|
|
56137
|
-
onUpdate(newWidgets);
|
|
56138
|
-
setSelectedIndex(insertIndex);
|
|
56444
|
+
openWidgetPicker("add");
|
|
56139
56445
|
} else if (input === "i") {
|
|
56140
|
-
|
|
56141
|
-
const backgroundColor = getUniqueBackgroundColor(insertIndex);
|
|
56142
|
-
const newWidget = {
|
|
56143
|
-
id: generateGuid(),
|
|
56144
|
-
type: getDefaultItemType(),
|
|
56145
|
-
...backgroundColor && { backgroundColor }
|
|
56146
|
-
};
|
|
56147
|
-
const newWidgets = [...widgets];
|
|
56148
|
-
newWidgets.splice(insertIndex, 0, newWidget);
|
|
56149
|
-
onUpdate(newWidgets);
|
|
56446
|
+
openWidgetPicker("insert");
|
|
56150
56447
|
} else if (input === "d" && widgets.length > 0) {
|
|
56151
56448
|
const newWidgets = widgets.filter((_, i) => i !== selectedIndex);
|
|
56152
56449
|
onUpdate(newWidgets);
|
|
@@ -56154,8 +56451,9 @@ var ItemsEditor = ({ widgets, onUpdate, onBack, lineNumber, settings }) => {
|
|
|
56154
56451
|
setSelectedIndex(selectedIndex - 1);
|
|
56155
56452
|
}
|
|
56156
56453
|
} else if (input === "c") {
|
|
56157
|
-
|
|
56158
|
-
|
|
56454
|
+
if (widgets.length > 0) {
|
|
56455
|
+
setShowClearConfirm(true);
|
|
56456
|
+
}
|
|
56159
56457
|
} else if (input === " " && widgets.length > 0) {
|
|
56160
56458
|
const currentWidget2 = widgets[selectedIndex];
|
|
56161
56459
|
if (currentWidget2 && currentWidget2.type === "separator") {
|
|
@@ -56241,6 +56539,12 @@ var ItemsEditor = ({ widgets, onUpdate, onBack, lineNumber, settings }) => {
|
|
|
56241
56539
|
};
|
|
56242
56540
|
const hasFlexSeparator = widgets.some((widget) => widget.type === "flex-separator");
|
|
56243
56541
|
const widthDetectionAvailable = canDetectTerminalWidth();
|
|
56542
|
+
const pickerCategories = widgetPicker ? getFilteredCategories(widgetPicker.categoryQuery) : [];
|
|
56543
|
+
const selectedPickerCategory = widgetPicker ? widgetPicker.selectedCategory && pickerCategories.includes(widgetPicker.selectedCategory) ? widgetPicker.selectedCategory : pickerCategories[0] ?? null : null;
|
|
56544
|
+
const topLevelSearchEntries = widgetPicker && widgetPicker.level === "category" && widgetPicker.categoryQuery.trim().length > 0 ? filterWidgetCatalog(widgetCatalog, "All", widgetPicker.categoryQuery) : [];
|
|
56545
|
+
const selectedTopLevelSearchEntry = widgetPicker ? topLevelSearchEntries.find((entry) => entry.type === widgetPicker.selectedType) ?? topLevelSearchEntries[0] : null;
|
|
56546
|
+
const pickerEntries = widgetPicker ? filterWidgetCatalog(widgetCatalog, selectedPickerCategory ?? "All", widgetPicker.widgetQuery) : [];
|
|
56547
|
+
const selectedPickerEntry = widgetPicker ? pickerEntries.find((entry) => entry.type === widgetPicker.selectedType) ?? pickerEntries[0] : null;
|
|
56244
56548
|
const currentWidget = widgets[selectedIndex];
|
|
56245
56549
|
const isSeparator = currentWidget?.type === "separator";
|
|
56246
56550
|
const isFlexSeparator = currentWidget?.type === "flex-separator";
|
|
@@ -56258,11 +56562,14 @@ var ItemsEditor = ({ widgets, onUpdate, onBack, lineNumber, settings }) => {
|
|
|
56258
56562
|
}
|
|
56259
56563
|
}
|
|
56260
56564
|
const canMerge = currentWidget && selectedIndex < widgets.length - 1 && !isSeparator && !isFlexSeparator;
|
|
56261
|
-
|
|
56565
|
+
const hasWidgets = widgets.length > 0;
|
|
56566
|
+
let helpText = hasWidgets ? "↑↓ select, ←→ open type picker" : "(a)dd via picker, (i)nsert via picker";
|
|
56262
56567
|
if (isSeparator) {
|
|
56263
56568
|
helpText += ", Space edit separator";
|
|
56264
56569
|
}
|
|
56265
|
-
|
|
56570
|
+
if (hasWidgets) {
|
|
56571
|
+
helpText += ", Enter to move, (a)dd via picker, (i)nsert via picker, (d)elete, (c)lear line";
|
|
56572
|
+
}
|
|
56266
56573
|
if (canToggleRaw) {
|
|
56267
56574
|
helpText += ", (r)aw value";
|
|
56268
56575
|
}
|
|
@@ -56271,6 +56578,7 @@ var ItemsEditor = ({ widgets, onUpdate, onBack, lineNumber, settings }) => {
|
|
|
56271
56578
|
}
|
|
56272
56579
|
helpText += ", ESC back";
|
|
56273
56580
|
const customKeybindsText = customKeybinds.map((kb) => kb.label).join(", ");
|
|
56581
|
+
const pickerActionLabel = widgetPicker?.action === "add" ? "Add Widget" : widgetPicker?.action === "insert" ? "Insert Widget" : "Change Widget Type";
|
|
56274
56582
|
if (customEditorWidget?.impl.renderEditor) {
|
|
56275
56583
|
return customEditorWidget.impl.renderEditor({
|
|
56276
56584
|
widget: customEditorWidget.widget,
|
|
@@ -56279,6 +56587,56 @@ var ItemsEditor = ({ widgets, onUpdate, onBack, lineNumber, settings }) => {
|
|
|
56279
56587
|
action: customEditorWidget.action
|
|
56280
56588
|
});
|
|
56281
56589
|
}
|
|
56590
|
+
if (showClearConfirm) {
|
|
56591
|
+
return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
|
|
56592
|
+
flexDirection: "column",
|
|
56593
|
+
children: [
|
|
56594
|
+
/* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
|
|
56595
|
+
bold: true,
|
|
56596
|
+
color: "yellow",
|
|
56597
|
+
children: "⚠ Confirm Clear Line"
|
|
56598
|
+
}, undefined, false, undefined, this),
|
|
56599
|
+
/* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
|
|
56600
|
+
marginTop: 1,
|
|
56601
|
+
flexDirection: "column",
|
|
56602
|
+
children: [
|
|
56603
|
+
/* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
|
|
56604
|
+
children: [
|
|
56605
|
+
"This will remove all widgets from Line",
|
|
56606
|
+
" ",
|
|
56607
|
+
lineNumber,
|
|
56608
|
+
"."
|
|
56609
|
+
]
|
|
56610
|
+
}, undefined, true, undefined, this),
|
|
56611
|
+
/* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
|
|
56612
|
+
color: "red",
|
|
56613
|
+
children: "This action cannot be undone!"
|
|
56614
|
+
}, undefined, false, undefined, this)
|
|
56615
|
+
]
|
|
56616
|
+
}, undefined, true, undefined, this),
|
|
56617
|
+
/* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
|
|
56618
|
+
marginTop: 2,
|
|
56619
|
+
children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
|
|
56620
|
+
children: "Continue?"
|
|
56621
|
+
}, undefined, false, undefined, this)
|
|
56622
|
+
}, undefined, false, undefined, this),
|
|
56623
|
+
/* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
|
|
56624
|
+
marginTop: 1,
|
|
56625
|
+
children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(ConfirmDialog, {
|
|
56626
|
+
inline: true,
|
|
56627
|
+
onConfirm: () => {
|
|
56628
|
+
onUpdate([]);
|
|
56629
|
+
setSelectedIndex(0);
|
|
56630
|
+
setShowClearConfirm(false);
|
|
56631
|
+
},
|
|
56632
|
+
onCancel: () => {
|
|
56633
|
+
setShowClearConfirm(false);
|
|
56634
|
+
}
|
|
56635
|
+
}, undefined, false, undefined, this)
|
|
56636
|
+
}, undefined, false, undefined, this)
|
|
56637
|
+
]
|
|
56638
|
+
}, undefined, true, undefined, this);
|
|
56639
|
+
}
|
|
56282
56640
|
return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
|
|
56283
56641
|
flexDirection: "column",
|
|
56284
56642
|
children: [
|
|
@@ -56297,6 +56655,10 @@ var ItemsEditor = ({ widgets, onUpdate, onBack, lineNumber, settings }) => {
|
|
|
56297
56655
|
color: "blue",
|
|
56298
56656
|
children: "[MOVE MODE]"
|
|
56299
56657
|
}, undefined, false, undefined, this),
|
|
56658
|
+
widgetPicker && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
|
|
56659
|
+
color: "cyan",
|
|
56660
|
+
children: `[${pickerActionLabel.toUpperCase()}]`
|
|
56661
|
+
}, undefined, false, undefined, this),
|
|
56300
56662
|
(settings.powerline.enabled || Boolean(settings.defaultSeparator)) && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
|
|
56301
56663
|
marginLeft: 2,
|
|
56302
56664
|
children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
|
|
@@ -56317,6 +56679,57 @@ var ItemsEditor = ({ widgets, onUpdate, onBack, lineNumber, settings }) => {
|
|
|
56317
56679
|
dimColor: true,
|
|
56318
56680
|
children: "↑↓ to move widget, ESC or Enter to exit move mode"
|
|
56319
56681
|
}, undefined, false, undefined, this)
|
|
56682
|
+
}, undefined, false, undefined, this) : widgetPicker ? /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
|
|
56683
|
+
flexDirection: "column",
|
|
56684
|
+
children: widgetPicker.level === "category" ? /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(jsx_dev_runtime8.Fragment, {
|
|
56685
|
+
children: [
|
|
56686
|
+
widgetPicker.categoryQuery.trim().length > 0 ? /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
|
|
56687
|
+
dimColor: true,
|
|
56688
|
+
children: "↑↓ select widget match, Enter apply, ESC clear/cancel"
|
|
56689
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
|
|
56690
|
+
dimColor: true,
|
|
56691
|
+
children: "↑↓ select category, type to search all widgets, Enter continue, ESC cancel"
|
|
56692
|
+
}, undefined, false, undefined, this),
|
|
56693
|
+
/* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
|
|
56694
|
+
children: [
|
|
56695
|
+
/* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
|
|
56696
|
+
dimColor: true,
|
|
56697
|
+
children: "Search: "
|
|
56698
|
+
}, undefined, false, undefined, this),
|
|
56699
|
+
/* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
|
|
56700
|
+
color: "cyan",
|
|
56701
|
+
children: widgetPicker.categoryQuery || "(none)"
|
|
56702
|
+
}, undefined, false, undefined, this)
|
|
56703
|
+
]
|
|
56704
|
+
}, undefined, true, undefined, this)
|
|
56705
|
+
]
|
|
56706
|
+
}, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(jsx_dev_runtime8.Fragment, {
|
|
56707
|
+
children: [
|
|
56708
|
+
/* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
|
|
56709
|
+
dimColor: true,
|
|
56710
|
+
children: "↑↓ select widget, type to search widgets, Enter apply, ESC back"
|
|
56711
|
+
}, undefined, false, undefined, this),
|
|
56712
|
+
/* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
|
|
56713
|
+
children: [
|
|
56714
|
+
/* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
|
|
56715
|
+
dimColor: true,
|
|
56716
|
+
children: [
|
|
56717
|
+
"Category:",
|
|
56718
|
+
" ",
|
|
56719
|
+
selectedPickerCategory ?? "(none)",
|
|
56720
|
+
" ",
|
|
56721
|
+
"| Search:",
|
|
56722
|
+
" "
|
|
56723
|
+
]
|
|
56724
|
+
}, undefined, true, undefined, this),
|
|
56725
|
+
/* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
|
|
56726
|
+
color: "cyan",
|
|
56727
|
+
children: widgetPicker.widgetQuery || "(none)"
|
|
56728
|
+
}, undefined, false, undefined, this)
|
|
56729
|
+
]
|
|
56730
|
+
}, undefined, true, undefined, this)
|
|
56731
|
+
]
|
|
56732
|
+
}, undefined, true, undefined, this)
|
|
56320
56733
|
}, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
|
|
56321
56734
|
flexDirection: "column",
|
|
56322
56735
|
children: [
|
|
@@ -56343,7 +56756,114 @@ var ItemsEditor = ({ widgets, onUpdate, onBack, lineNumber, settings }) => {
|
|
|
56343
56756
|
}, undefined, false, undefined, this)
|
|
56344
56757
|
]
|
|
56345
56758
|
}, undefined, true, undefined, this),
|
|
56346
|
-
/* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
|
|
56759
|
+
widgetPicker && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
|
|
56760
|
+
marginTop: 1,
|
|
56761
|
+
flexDirection: "column",
|
|
56762
|
+
children: widgetPicker.level === "category" ? widgetPicker.categoryQuery.trim().length > 0 ? topLevelSearchEntries.length === 0 ? /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
|
|
56763
|
+
dimColor: true,
|
|
56764
|
+
children: "No widgets match the search."
|
|
56765
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(jsx_dev_runtime8.Fragment, {
|
|
56766
|
+
children: [
|
|
56767
|
+
topLevelSearchEntries.map((entry, index) => {
|
|
56768
|
+
const isSelected = entry.type === selectedTopLevelSearchEntry?.type;
|
|
56769
|
+
return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
|
|
56770
|
+
flexDirection: "row",
|
|
56771
|
+
flexWrap: "nowrap",
|
|
56772
|
+
children: [
|
|
56773
|
+
/* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
|
|
56774
|
+
width: 3,
|
|
56775
|
+
children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
|
|
56776
|
+
color: isSelected ? "green" : undefined,
|
|
56777
|
+
children: isSelected ? "▶ " : " "
|
|
56778
|
+
}, undefined, false, undefined, this)
|
|
56779
|
+
}, undefined, false, undefined, this),
|
|
56780
|
+
/* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
|
|
56781
|
+
color: isSelected ? "green" : undefined,
|
|
56782
|
+
children: `${index + 1}. ${entry.displayName}`
|
|
56783
|
+
}, undefined, false, undefined, this)
|
|
56784
|
+
]
|
|
56785
|
+
}, entry.type, true, undefined, this);
|
|
56786
|
+
}),
|
|
56787
|
+
selectedTopLevelSearchEntry && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
|
|
56788
|
+
marginTop: 1,
|
|
56789
|
+
paddingLeft: 2,
|
|
56790
|
+
children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
|
|
56791
|
+
dimColor: true,
|
|
56792
|
+
children: selectedTopLevelSearchEntry.description
|
|
56793
|
+
}, undefined, false, undefined, this)
|
|
56794
|
+
}, undefined, false, undefined, this)
|
|
56795
|
+
]
|
|
56796
|
+
}, undefined, true, undefined, this) : pickerCategories.length === 0 ? /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
|
|
56797
|
+
dimColor: true,
|
|
56798
|
+
children: "No categories available."
|
|
56799
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(jsx_dev_runtime8.Fragment, {
|
|
56800
|
+
children: [
|
|
56801
|
+
pickerCategories.map((category, index) => {
|
|
56802
|
+
const isSelected = category === selectedPickerCategory;
|
|
56803
|
+
return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
|
|
56804
|
+
flexDirection: "row",
|
|
56805
|
+
flexWrap: "nowrap",
|
|
56806
|
+
children: [
|
|
56807
|
+
/* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
|
|
56808
|
+
width: 3,
|
|
56809
|
+
children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
|
|
56810
|
+
color: isSelected ? "green" : undefined,
|
|
56811
|
+
children: isSelected ? "▶ " : " "
|
|
56812
|
+
}, undefined, false, undefined, this)
|
|
56813
|
+
}, undefined, false, undefined, this),
|
|
56814
|
+
/* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
|
|
56815
|
+
color: isSelected ? "green" : undefined,
|
|
56816
|
+
children: `${index + 1}. ${category}`
|
|
56817
|
+
}, undefined, false, undefined, this)
|
|
56818
|
+
]
|
|
56819
|
+
}, category, true, undefined, this);
|
|
56820
|
+
}),
|
|
56821
|
+
selectedPickerCategory === "All" && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
|
|
56822
|
+
marginTop: 1,
|
|
56823
|
+
paddingLeft: 2,
|
|
56824
|
+
children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
|
|
56825
|
+
dimColor: true,
|
|
56826
|
+
children: "Search across all widget categories."
|
|
56827
|
+
}, undefined, false, undefined, this)
|
|
56828
|
+
}, undefined, false, undefined, this)
|
|
56829
|
+
]
|
|
56830
|
+
}, undefined, true, undefined, this) : pickerEntries.length === 0 ? /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
|
|
56831
|
+
dimColor: true,
|
|
56832
|
+
children: "No widgets match the current category/search."
|
|
56833
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(jsx_dev_runtime8.Fragment, {
|
|
56834
|
+
children: [
|
|
56835
|
+
pickerEntries.map((entry, index) => {
|
|
56836
|
+
const isSelected = entry.type === selectedPickerEntry?.type;
|
|
56837
|
+
return /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
|
|
56838
|
+
flexDirection: "row",
|
|
56839
|
+
flexWrap: "nowrap",
|
|
56840
|
+
children: [
|
|
56841
|
+
/* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
|
|
56842
|
+
width: 3,
|
|
56843
|
+
children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
|
|
56844
|
+
color: isSelected ? "green" : undefined,
|
|
56845
|
+
children: isSelected ? "▶ " : " "
|
|
56846
|
+
}, undefined, false, undefined, this)
|
|
56847
|
+
}, undefined, false, undefined, this),
|
|
56848
|
+
/* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
|
|
56849
|
+
color: isSelected ? "green" : undefined,
|
|
56850
|
+
children: `${index + 1}. ${entry.displayName}`
|
|
56851
|
+
}, undefined, false, undefined, this)
|
|
56852
|
+
]
|
|
56853
|
+
}, entry.type, true, undefined, this);
|
|
56854
|
+
}),
|
|
56855
|
+
selectedPickerEntry && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
|
|
56856
|
+
marginTop: 1,
|
|
56857
|
+
paddingLeft: 2,
|
|
56858
|
+
children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
|
|
56859
|
+
dimColor: true,
|
|
56860
|
+
children: selectedPickerEntry.description
|
|
56861
|
+
}, undefined, false, undefined, this)
|
|
56862
|
+
}, undefined, false, undefined, this)
|
|
56863
|
+
]
|
|
56864
|
+
}, undefined, true, undefined, this)
|
|
56865
|
+
}, undefined, false, undefined, this),
|
|
56866
|
+
!widgetPicker && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
|
|
56347
56867
|
marginTop: 1,
|
|
56348
56868
|
flexDirection: "column",
|
|
56349
56869
|
children: widgets.length === 0 ? /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Text, {
|
|
@@ -56910,7 +57430,7 @@ var PowerlineSeparatorEditor = ({
|
|
|
56910
57430
|
} else if (key.backspace && cursorPos > 0) {
|
|
56911
57431
|
setHexInput(hexInput.slice(0, cursorPos - 1) + hexInput.slice(cursorPos));
|
|
56912
57432
|
setCursorPos(cursorPos - 1);
|
|
56913
|
-
} else if (input && /[0-9a-fA-F]/.test(input) && hexInput.length < 4) {
|
|
57433
|
+
} else if (shouldInsertInput(input, key) && /[0-9a-fA-F]/.test(input) && hexInput.length < 4) {
|
|
56914
57434
|
setHexInput(hexInput.slice(0, cursorPos) + input.toUpperCase() + hexInput.slice(cursorPos));
|
|
56915
57435
|
setCursorPos(cursorPos + 1);
|
|
56916
57436
|
}
|
|
@@ -58186,7 +58706,7 @@ var TerminalWidthMenu = ({ settings, onUpdate, onBack }) => {
|
|
|
58186
58706
|
} else if (key.backspace) {
|
|
58187
58707
|
setThresholdInput(thresholdInput.slice(0, -1));
|
|
58188
58708
|
setValidationError(null);
|
|
58189
|
-
} else if (key.delete) {} else if (input && /\d/.test(input)) {
|
|
58709
|
+
} else if (key.delete) {} else if (shouldInsertInput(input, key) && /\d/.test(input)) {
|
|
58190
58710
|
const newValue = thresholdInput + input;
|
|
58191
58711
|
if (newValue.length <= 2) {
|
|
58192
58712
|
setThresholdInput(newValue);
|
|
@@ -58732,6 +59252,7 @@ var StatusJSONSchema = exports_external.looseObject({
|
|
|
58732
59252
|
total_lines_added: exports_external.number().optional(),
|
|
58733
59253
|
total_lines_removed: exports_external.number().optional()
|
|
58734
59254
|
}).optional(),
|
|
59255
|
+
agent: exports_external.object({ name: exports_external.string().optional() }).optional(),
|
|
58735
59256
|
context_window: exports_external.object({
|
|
58736
59257
|
context_window_size: exports_external.number().nullable().optional(),
|
|
58737
59258
|
total_input_tokens: exports_external.number().nullable().optional(),
|
|
@@ -59838,9 +60359,14 @@ function floorToHour(timestamp) {
|
|
|
59838
60359
|
}
|
|
59839
60360
|
|
|
59840
60361
|
// src/ccstatusline.ts
|
|
59841
|
-
var COMPACT_THRESHOLD =
|
|
59842
|
-
|
|
59843
|
-
|
|
60362
|
+
var COMPACT_THRESHOLD = 100;
|
|
60363
|
+
var TEAM_LEAD_DEFAULT_WIDTH = 60;
|
|
60364
|
+
function shouldUseCompactMode(width, data) {
|
|
60365
|
+
if (width !== null && width > 0 && width < COMPACT_THRESHOLD)
|
|
60366
|
+
return true;
|
|
60367
|
+
if (data.agent?.name === "team-lead")
|
|
60368
|
+
return true;
|
|
60369
|
+
return false;
|
|
59844
60370
|
}
|
|
59845
60371
|
async function readStdin() {
|
|
59846
60372
|
if (process.stdin.isTTY) {
|
|
@@ -59885,18 +60411,20 @@ async function renderMultipleLines(data) {
|
|
|
59885
60411
|
blockMetrics = getBlockMetrics();
|
|
59886
60412
|
}
|
|
59887
60413
|
const terminalWidth = getTerminalWidth();
|
|
60414
|
+
const compact = shouldUseCompactMode(terminalWidth, data);
|
|
60415
|
+
const compactWidth = compact ? terminalWidth !== null && terminalWidth > 0 ? terminalWidth >= 80 ? Math.floor(terminalWidth / 2) - 4 : terminalWidth - 6 : TEAM_LEAD_DEFAULT_WIDTH : null;
|
|
60416
|
+
const effectiveWidth = compactWidth ?? terminalWidth;
|
|
59888
60417
|
const context = {
|
|
59889
60418
|
data,
|
|
59890
60419
|
tokenMetrics,
|
|
59891
60420
|
sessionDuration,
|
|
59892
60421
|
blockMetrics,
|
|
59893
|
-
terminalWidth,
|
|
60422
|
+
terminalWidth: effectiveWidth,
|
|
59894
60423
|
isPreview: false
|
|
59895
60424
|
};
|
|
59896
60425
|
const preRenderedLines = preRenderAllWidgets(lines, settings, context);
|
|
59897
|
-
|
|
59898
|
-
|
|
59899
|
-
renderCompactOutput(preRenderedLines, settings, terminalWidth - 6);
|
|
60426
|
+
if (compact && compactWidth) {
|
|
60427
|
+
renderCompactOutput(preRenderedLines, settings, compactWidth);
|
|
59900
60428
|
} else {
|
|
59901
60429
|
const preCalculatedMaxWidths = calculateMaxWidthsFromPreRendered(preRenderedLines, settings);
|
|
59902
60430
|
let globalSeparatorIndex = 0;
|