ispbills-icli 8.6.2 → 8.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/tui/components.js +17 -4
package/package.json
CHANGED
package/src/tui/components.js
CHANGED
|
@@ -117,17 +117,30 @@ export function TabBar({ active = 'session', cols = 80, mode = 'ask' }) {
|
|
|
117
117
|
const modeBadge = mode !== 'ask'
|
|
118
118
|
? ` ${mode === 'autopilot' ? '⚡ AUTO' : mode === 'shell' ? '⌘ SHELL' : '📋 PLAN'}`
|
|
119
119
|
: '';
|
|
120
|
+
const badgeLen = modeBadge ? modeBadge.length + 2 : 0;
|
|
121
|
+
const available = cols - 2 - badgeLen; // -2 for paddingX={1}
|
|
122
|
+
|
|
123
|
+
// §11: clip tab labels when terminal is narrow (~50 cols)
|
|
124
|
+
// Full: [Session] Devices Customers Alarms = ~42 chars
|
|
125
|
+
// Short: [Ses] Dev Cus Alm = ~26 chars
|
|
126
|
+
const fullWidth = TABS.reduce((sum, t, i) => {
|
|
127
|
+
const w = t.id === active ? t.label.length + 2 : t.label.length;
|
|
128
|
+
return sum + (i > 0 ? 3 : 0) + w;
|
|
129
|
+
}, 0);
|
|
130
|
+
const abbreviated = fullWidth > available;
|
|
131
|
+
|
|
120
132
|
return html`
|
|
121
133
|
<${Box} width=${cols} backgroundColor="blue">
|
|
122
134
|
<${Box} paddingX=${1} flexGrow=${1}>
|
|
123
135
|
${TABS.map((t, i) => {
|
|
124
136
|
const on = t.id === active;
|
|
137
|
+
const lbl = abbreviated ? t.label.slice(0, 3) : t.label;
|
|
125
138
|
return html`
|
|
126
139
|
<${Box} key=${t.id}>
|
|
127
140
|
${i > 0 ? html`<${Text} backgroundColor="blue"> <//>` : null}
|
|
128
141
|
${on
|
|
129
|
-
? html`<${Text} color="white" bold backgroundColor="blue">[${
|
|
130
|
-
: html`<${Text} color="white" dimColor backgroundColor="blue">${
|
|
142
|
+
? html`<${Text} color="white" bold backgroundColor="blue">[${lbl}]<//>`
|
|
143
|
+
: html`<${Text} color="white" dimColor backgroundColor="blue">${lbl}<//>`}
|
|
131
144
|
<//>`;
|
|
132
145
|
})}
|
|
133
146
|
<//>
|
|
@@ -280,7 +293,7 @@ export function ShellOutput({ command, output, cols = 80, ts, code = 0 }) {
|
|
|
280
293
|
ts=${ts}
|
|
281
294
|
rightLabel=${code === 0 ? '' : `exit ${code}`}
|
|
282
295
|
/>
|
|
283
|
-
<${Box} paddingX=${
|
|
296
|
+
<${Box} paddingX=${1} flexDirection="column">
|
|
284
297
|
<${Text} color=${C.warning}>$ ${command}<//>
|
|
285
298
|
<${Text}>${output || '(no output)'}<//>
|
|
286
299
|
<//>
|
|
@@ -509,7 +522,7 @@ export function Thinking({ label = 'Working', startedAt }) {
|
|
|
509
522
|
}, []);
|
|
510
523
|
const secs = startedAt ? Math.max(0, Math.round((Date.now() - startedAt) / 1000)) : 0;
|
|
511
524
|
return html`
|
|
512
|
-
<${Box} marginTop=${1} paddingX=${
|
|
525
|
+
<${Box} marginTop=${1} paddingX=${1}>
|
|
513
526
|
<${Text} color=${C.warning}><${Spinner} type=${spinnerType()} /><//>
|
|
514
527
|
<${Text} color=${C.warning} bold> ${label}<//>
|
|
515
528
|
<${Text} color=${C.muted}>… (${secs}s ${midDot()}esc to interrupt)<//>
|