Skip to content

build(chat): consume partial-markdown 0.5.3 — streaming table body rows#744

Merged
blove merged 3 commits into
mainfrom
feat/chat-consume-pm-0.5.3
Jul 6, 2026
Merged

build(chat): consume partial-markdown 0.5.3 — streaming table body rows#744
blove merged 3 commits into
mainfrom
feat/chat-consume-pm-0.5.3

Conversation

@blove

@blove blove commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Bumps @cacheplane/partial-markdown to 0.5.3 in libs/chat: while a table is streaming, an in-progress body row now renders as a streaming row inside the table (growing cell-by-cell, padded to header width) instead of momentarily closing the table and flashing as a raw-pipe paragraph (bare | / one pipe) or a spurious second header-only table (two+ pipes). Completes the streaming-table work begun in 0.5.2 (#739) and the finalize fix (#743). Library side: cacheplane/cacheplane#22, tag partial-markdown-v0.5.3.

  • New consumer anti-flicker test in streaming-markdown.table-stream.spec.ts — red on 0.5.2 (raw-pipe <p> at '|', 2 tables at '| x1 | y'), green on 0.5.3.
  • Surgical lockfile edit (3 spots, no regeneration). No chat component changes.

Chrome MCP live verification (required gate) — PASSED

Frame-sampled the DOM (MutationObserver, per-mutation) during live gpt-5-mini table streams on examples-chat (vite dep cache cleared and confirmed serving the 0.5.3 module). Across 6 streamed-table runs:

  • 0 frames with a second <table> (the 0.5.2 spurious-table artifact is gone)
  • 0 frames with a raw-pipe <p> alongside the table (the body-row paragraph flash is gone; pre-fix baseline showed 2 such frames)
  • Intact-content runs render table-every-frame from the first closed header cell; final tables correct (e.g. 4 cols × 12 rows).

Orthogonal finding (not this PR; filed separately)

The live gate exposed an intermittent, pre-existing streaming-accumulation bug: streamed deltas occasionally drop characters (captured: delimiter accumulated as ---:---:| while the final message had |---:|---|---:|), so the mid-stream content is invalid GFM and correctly renders as text until the final snapshot replaces it. Replaying the corrupted progression through the parser reproduces the paragraphs; clean content renders a table — proving it's upstream of partial-markdown. Tracked as a follow-up task.

🤖 Generated with Claude Code

blove and others added 3 commits July 5, 2026 19:34
Projection-only optimisticBlock branch: while a table is active, a partial
open-line row appends as a streaming body row instead of closing the table
and flickering as a paragraph / spurious 2nd table. Bare "|" projects as an
empty in-progress row. Chrome MCP live verification is a required gate.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
6 tasks: cacheplane body-row projection branch (TDD) + 0.5.3 release
(PR→tag→OIDC), then libs/chat consume with a body-row anti-flicker test,
a REQUIRED Chrome MCP live-stream verification gate, and merge on green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
threadplane Ready Ready Preview, Comment Jul 6, 2026 3:17am

Request Review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated approval: this PR received an intelligent (AI) code review. See the review comments on this PR.

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Claude finished @blove's task in 2m 33s —— View job


Code Review

  • Gather context
  • Read CLAUDE.md and repo guidelines
  • Read PR diff and changed files
  • Analyze test coverage
  • Review lockfile changes
  • Post findings

Summary

This is a clean, minimal consume-PR: version bump in libs/chat/package.json, a surgical 3-spot lockfile edit, and one new anti-flicker test. No Angular component changes. The approach matches the stated design (projection-only fix in the library, consumer test as a red→green regression guard). Overall: LGTM with two minor notes.


Findings

1. Dead grow() call before the loop (minor — see inline comment)

streaming-markdown.table-stream.spec.ts line 103 calls grow('| A | B |\n| - | - |\n') before the loop, but the first iteration immediately overwrites the content — no assertion fires between the two. Either drop it or add an assertion to make the intent explicit (e.g. verify the committed header renders correctly before the partial-row steps begin). Fix this →

2. Test asserts absence of artifacts but not presence of body-row content (minor)

The loop checks table count === 1 and no raw-pipe <p>, which is exactly the right anti-flicker guard. However, for steps like '| x1 | y', the spec calls for the partial row to appear inside the table's <tbody>. A complementary positive assertion like el.querySelectorAll('tbody tr').length >= 1 at those steps would confirm the row content is actually projected (not just that the second table disappeared). Low priority — the library-side unit tests own the structural output; this consumer test's primary role is the anti-flicker gate. But it would make the test self-documenting about what the "fix" actually produces.

3. Lockfile integrity hash — verification note (informational)

The surgical lockfile edit correctly updates all three spots (root deps, libs/chat block, node_modules resolved block). The new SHA-512 for 0.5.3 (sha512-XlvjGVsEY7tA3Q4eSY0EiP3FmKkzv5VwFWCmmqvnvf1/dYy+YjQXmDg1mqtFWk4iNyjMMd7aBtGiY+lEuZPmLQ==) has the correct length and format. I wasn't able to run npm view @cacheplane/partial-markdown@0.5.3 dist.integrity in this environment to cross-check it against the registry, but the PR author's documented process (pack-and-replace from the live npm tarball) is the right approach. A reviewer with npm access can do a quick npm view @cacheplane/partial-markdown@0.5.3 dist.integrity to confirm.


No issues found in

  • libs/chat/package.json: range bump ^0.5.2 → ^0.5.3 correct, no other deps affected.
  • Lockfile: exactly 3 spots changed as claimed, no stray regeneration artifacts, node count intact.
  • Doc files: plan/spec docs are agentic work artifacts, not public docs — their local repo paths (~/repos/cacheplane) are expected in that context.
  • Public API: no changes to @threadplane/chat's exported surface.
  • Angular/RxJS: no component changes, no subscription or change-detection concerns introduced.


it('streams body rows inside the table — no paragraph, no second table (0.5.3)', () => {
host.streaming.set(true);
grow('| A | B |\n| - | - |\n');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This initial grow is dead code — the first loop iteration immediately replaces the content with '| A | B |\n| - | - |\n' + '|', so no assertion fires against this intermediate state. You could either drop it or add an assertion here (e.g. expect(el.querySelectorAll('table').length).toBe(1)) if the intent was to verify the committed header+delimiter state before the partial rows begin.

Suggested change
grow('| A | B |\n| - | - |\n');
grow('| A | B |\n| - | - |\n');
expect(el.querySelectorAll('table').length, 'committed header renders as table').toBe(1);

@blove blove merged commit 9b93953 into main Jul 6, 2026
59 checks passed
@blove blove deleted the feat/chat-consume-pm-0.5.3 branch July 6, 2026 03:22
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