Commit b26897f
authored
fix(tui): render thinking preview markdown and stabilize activity rows (#200)
* fix(tui): render thinking preview markdown
* fix(tui): bound thinking-preview comment regex
* fix(tui): keep activity rows visually stable
* docs(tui): changelog and design for clean activity rendering
* perf(tui): cache rendered thinking-preview markdown across live ticks
The markdown render + regex parse for the thinking preview can run many times
per second on Live refresh ticks when no new content has arrived. Introduce
a cache key (the preview string) so markdown parsing only runs when the
pending thinking text actually changes, not on every spinner animation.
Includes tests verifying cache behavior and output equivalence.
* test(tui): freeze clock in thinking-preview cache equivalence test
The output-equivalence test compared full Console.export_text() across two
compose() calls, whose status line embeds elapsed time and token rate. Freeze
time.monotonic so the two renders are deterministic and only the cached preview
governs the comparison; guards against a rare timing-boundary flake.1 parent 595aa49 commit b26897f
8 files changed
Lines changed: 754 additions & 11 deletions
File tree
- docs
- en/release-notes
- superpowers
- plans
- specs
- src/pythinker_code/ui/shell/visualize
- tests/ui_and_conv
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
18 | 22 | | |
19 | 23 | | |
20 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
20 | 24 | | |
21 | 25 | | |
22 | 26 | | |
| |||
0 commit comments