summaryrefslogtreecommitdiff
path: root/plugins/code-modernization/hooks/host.ts
diff options
context:
space:
mode:
authorMorgan Lunt <morganl@anthropic.com>2026-09-24 20:52:27 -0700
committerMorgan Lunt <morganl@anthropic.com>2026-09-24 20:52:27 -0700
commit51b1ae9e20486d62b839ed9f37e1cfc7d55bf85c (patch)
treeeb31cc4964d84b4a82b8032452739fe1e9b37d3f /plugins/code-modernization/hooks/host.ts
parent5b8ec4b30f45b5e8b4c8a6efd63719730cf1a5ad (diff)
code-modernization: make the live pane work below 144 columns and show the proof
Found by exercising the pane against the real outputs of finished runs: - Below 144 columns the engine holds an unasked pane back; the pane ignored that, so it drew no pane, no show bar, and the panel command "hid" a pane that was never there. - A symlinked legacy/<name> lists as another kind of entry, so the source link that preflight now creates was never recognized as a system. - Uplift and reimagine next steps were placeholders with no button. - The refresh debounce was starved while agents ran, so the map froze. - Hostile lines in the brief, rules and baseline could take seconds to match; lines are now capped. The rule-review ledger is validated on read and merged on save, and keeps a reviewer's note. - A baseline with no row read as "the baseline had 0"; one-module baseline totals now count as that module's row. New: a verdict chip with words on every built module, a verify-first next step, and a readable palette that follows the terminal theme. 140 engine tests pass and the type check is clean.
Diffstat (limited to 'plugins/code-modernization/hooks/host.ts')
-rw-r--r--plugins/code-modernization/hooks/host.ts8
1 files changed, 7 insertions, 1 deletions
diff --git a/plugins/code-modernization/hooks/host.ts b/plugins/code-modernization/hooks/host.ts
index c315fecf..9190a4cc 100644
--- a/plugins/code-modernization/hooks/host.ts
+++ b/plugins/code-modernization/hooks/host.ts
@@ -12,6 +12,12 @@ import type {
import type { ReaderFs } from './reader/fs'
/**
+ * What `$.ui.open` answers: drawn, or open but held back undrawn (unasked, on a terminal narrower than the engine docks a
+ * pane on) with the reason. A build that answers nothing has drawn it, as far as anyone can tell.
+ */
+export type OpenResult = { isPlaced: boolean; reason?: string } | void
+
+/**
* The engine as `session.start` bound it from its `$`: every later hook,
* timer and button press reaches the engine through this, so the rest of
* the module is plain functions over a small interface a test can stand in for.
@@ -28,7 +34,7 @@ export type Host = {
status: (text: string | undefined) => void
toast: (text: string, timeoutMs?: number) => void
log: (text: string) => void
- openPane: (pane: PaneOpenArgs) => Promise<void>
+ openPane: (pane: PaneOpenArgs) => Promise<OpenResult>
closePane: (pane: PaneCloseArgs) => Promise<void>
registerCommand: (spec: CommandSpec) => Promise<unknown>
fillPrompt: (input: PromptFillArgs) => Promise<{ isFilled: boolean }>