mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-08 16:39:42 +02:00
test: drive the phase-2 verbs end to end under a pty
The fake API server grows the routes the dashboard now calls (terminal tail, input, approvals answer, search, away digest, plan usage on status), and the new cases assert on what the server RECEIVED rather than on the frame: the prompt arrives as one line ending in a carriage return, and the answers as the exact action and option digit. Also covered: the tail refreshing in place, the search overlay selecting a live session, the digest rendering, one bell for an item announced twice, and the 409 path reported as "no longer on screen". The plan-usage chip is punctuated with the glyph tier's separator, so an ASCII terminal no longer gets a stray middle dot in the header. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
+9
-3
@@ -58,6 +58,7 @@ import {
|
||||
TuiClient,
|
||||
type TuiApprovalAnswer,
|
||||
type TuiEventStream,
|
||||
type TuiPlanUsage,
|
||||
type TuiQuickStartOptions,
|
||||
type TuiTmuxSession,
|
||||
} from './tui-client.js';
|
||||
@@ -664,7 +665,7 @@ class TuiApp {
|
||||
...(server.hostname ? { hostname: server.hostname } : {}),
|
||||
...(server.instance ? { instance: server.instance } : {}),
|
||||
...(server.version ? { version: server.version } : {}),
|
||||
...(server.planUsage ? { planUsage: formatPlanUsage(server.planUsage) } : {}),
|
||||
...(server.planUsage ? { planUsage: this.planUsageChip(server.planUsage) } : {}),
|
||||
});
|
||||
} else {
|
||||
this.model.setConnection('degraded');
|
||||
@@ -689,13 +690,18 @@ class TuiApp {
|
||||
});
|
||||
}
|
||||
|
||||
/** The chip, punctuated with the glyph tier's own separator. */
|
||||
private planUsageChip(usage: TuiPlanUsage): string {
|
||||
return formatPlanUsage(usage, ` ${this.glyphs.separator} `);
|
||||
}
|
||||
|
||||
// ── Data ───────────────────────────────────────────────────────────────────
|
||||
|
||||
private subscribe(): void {
|
||||
this.stream = this.client.subscribeEvents({
|
||||
onInit: (state) => {
|
||||
if (state.version) this.model.setHeader({ version: state.version });
|
||||
if (state.planUsage) this.model.setHeader({ planUsage: formatPlanUsage(state.planUsage) });
|
||||
if (state.planUsage) this.model.setHeader({ planUsage: this.planUsageChip(state.planUsage) });
|
||||
this.paint();
|
||||
},
|
||||
onResync: () => this.scheduleRefresh(),
|
||||
@@ -704,7 +710,7 @@ class TuiApp {
|
||||
// changes which group its row is in), and one code path cannot double-ring.
|
||||
onApproval: () => this.scheduleRefresh(),
|
||||
onPlanUsage: (usage) => {
|
||||
this.model.setHeader({ planUsage: formatPlanUsage(usage) });
|
||||
this.model.setHeader({ planUsage: this.planUsageChip(usage) });
|
||||
this.paint();
|
||||
},
|
||||
onStatus: (status, detail) => {
|
||||
|
||||
Reference in New Issue
Block a user