Skip to content

fix(table): decorate resumed history tables lazily on scroll - #260

Open
jinwei233 wants to merge 1 commit into
dnouri:masterfrom
jinwei233:fix/history-table-jit-render
Open

fix(table): decorate resumed history tables lazily on scroll#260
jinwei233 wants to merge 1 commit into
dnouri:masterfrom
jinwei233:fix/history-table-jit-render

Conversation

@jinwei233

Copy link
Copy Markdown

What

Register table decoration with jit-lock so older tables in resumed sessions become prettified when they scroll into view. Resumed history still eagerly processes only the hot tail, preserving load performance.

How

  • Add pi-coding-agent--jit-decorate-tables.
  • Expand arbitrary jit-lock chunks to complete tree-sitter pipe_table bounds before decoration.
  • Reuse the existing decoration path, preserving fenced-code, header-only, prettify-toggle, and user raw-toggle behavior.
  • Register the function alongside pi-coding-agent--restore-tool-properties.
  • Correct history postprocessing docstrings.

Testing

  • 55/55 table ERT tests pass on the upstream master baseline.
  • Includes four regression tests for normal regions, partial-table chunks, no-table regions, and raw-toggle preservation.
  • git diff --check passes.

Resumed sessions eagerly decorate only the hot tail, so tables above it
stayed raw Markdown forever -- fontification recovers via jit-lock on
scroll, but table decoration had no such hook.

Register pi-coding-agent--jit-decorate-tables with jit-lock so pipe tables
are decorated on the same redisplay pass that fontifies each region as it
scrolls into view. jit-lock chunks can bisect a table, so the region is
expanded to whole tree-sitter pipe_table extents before decorating; the
existing decoration path is reused so fenced-code skipping, header-only
deferral, the prettify toggle, and the raw-toggle guard all still apply.

No load-time cost: work happens only on redisplay of visible regions.
Adds four ERT tests; correct two history-path docstrings.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant