Commit 2c7a94c
authored
refactor(tui): prompt deep-module PR 1 — frame snapshot + height budgets (#218)
* chore(tasks): record delegation-lane and verification lessons
* docs: prohibit deferring applicable fixes
* test(tui): characterize prompt compatibility contract
* docs(tui): design content rendering standardization
* docs(tui): plan content rendering standardization
* refactor(tui): snapshot prompt delegates once per frame
* fix(tui): keep prompt scenes within terminal height
Add prompting/renderer.py with PromptSceneBudget and a priority-ordered
row allocator (modal > input > footer > pinned > body > status >
shortcuts). Rendering is unchanged for scenes that fit; on overflow the
scene is clipped tail-first per priority, pinned allocation is
zero-safe, and the interactive preview no longer derives a competing
body budget.
* test(tui): cover mid-turn terminal shrink in PTY layout e2e
Resize the live PTY through heights 12/8/6/4 during a running turn and
assert the redrawn frame stays within the new geometry, never
fossilizes the input card, and the turn still completes after the size
is restored.
* chore(tasks): record codex-lane operating contract lessons
* fix(tui): refresh shell-mode footer budget and strengthen resize assertion
Shell-mode rendering never set _prompt_footer_row_budget, so
_fit_toolbar_to_terminal clipped the bottom toolbar against a stale
agent-mode value (or the initial 0, hiding the footer entirely in a
pure shell session). Refresh it every shell render. Replace a
trivially-true pyte row-count assertion in the resize e2e with a
width-overflow check.
* fix(tui): refresh shell-mode update-notice frame snapshot
The per-frame _prompt_frame_update_notice snapshot was refreshed only by
the agent render path and never cleared with the frame, so shell frames
suppressed a live update notice (initial None) or replayed a stale
agent-mode notice after a mode switch. Refresh the snapshot in the shell
render like the agent path and reset it in _clear_prompt_frame.
* test(tui): cover after-render update-notice snapshot cleanup
Extract the after_render frame-clear closure into a named
_clear_prompt_frame_snapshot method so the lifecycle cleanup is directly
testable, and assert a completed frame leaves _prompt_frame_update_notice
as None.1 parent b5cfe09 commit 2c7a94c
15 files changed
Lines changed: 2477 additions & 132 deletions
File tree
- docs/superpowers
- plans
- specs
- src/pythinker_code/ui/shell
- prompting
- visualize
- tasks
- tests
- e2e
- ui_and_conv
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
44 | 49 | | |
45 | 50 | | |
46 | 51 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| 28 | + | |
27 | 29 | | |
28 | 30 | | |
29 | 31 | | |
| |||
0 commit comments