Skip to content

fix(chat): dispatch table rows through row component (0.0.24)#197

Merged
blove merged 5 commits into
mainfrom
claude/fix-table-row-rendering-0.0.24
May 5, 2026
Merged

fix(chat): dispatch table rows through row component (0.0.24)#197
blove merged 5 commits into
mainfrom
claude/fix-table-row-rendering-0.0.24

Conversation

@blove
Copy link
Copy Markdown
Contributor

@blove blove commented May 5, 2026

Summary

PR opened to fix the table-row dispatch bug caught by live browser smoke testing in ~/tmp/ngaf against published `@ngaf/chat@0.0.23`. The branch grew during continued live smoke as Chrome inspection caught 3 additional bugs that all fold into this 0.0.24 release.

Fixes

  1. Table row dispatch (root cause: `MarkdownTableComponent` used `<chat-md-children [parent]="row">` which walked row.children directly, skipping the `` wrapper). Cells appeared bare under ``/``, the `IS_HEADER_ROW` DI provider never ran, and all cells rendered as default ``. Fix imports `MarkdownTableRowComponent` and dispatches each row directly.

  2. Citation marker without URL rendered `<a href="">` — a clickable link to nowhere. Fix splits the resolved branch into "with URL" (renders ``) and "without URL" (renders `<span class="chat-citation-marker--no-url">`). Switched from `[href]` property binding to `[attr.href]` for explicit attribute removal.

  3. Sources panel didn't render Pandoc-only citations — when citations come from `[^id]:` defs in message content (no provider metadata), inline markers resolved correctly via the markdown sidecar but `` never appeared. Fix optionally injects `CitationsResolverService` and merges markdown-sidecar defs into the panel's citation list, with `Message.citations` taking precedence by id.

  4. Task-list checkbox layout — checkbox rendered on a separate line above the text because ` >

    ` is block-level. Fix uses flexbox on `.chat-md-list-item--task` and collapses the inner `

    ` margin so tight tasks read as a single line. Multi-paragraph task items still flow correctly (flex-wrap enabled).

Synchronized version bump

All 16 `@ngaf/*` libraries → `0.0.24`.

Test plan

  • `npx nx run chat:test` green (regression tests for all 4 bugs)
  • `npx nx run chat:lint` green
  • Live Chrome re-validation against 0.0.24 once published

MarkdownTableComponent template used <chat-md-children [parent]="row">
which walked the row's children (cells) directly under <thead>/<tbody>,
skipping the <chat-md-table-row> wrapper entirely. Result: bare cells
appeared under thead/tbody and the row component (with its IS_HEADER_ROW
DI plumbing) was never instantiated, so cells couldn't tell whether to
render <th> or <td>.

Caught by live browser smoke testing in ~/tmp/ngaf — Chrome inspection
showed the parser produced 3 row nodes but the rendered DOM had zero
<chat-md-table-row> elements. Fixed by importing MarkdownTableRowComponent
and dispatching each row through it directly.

Synchronized version bump to 0.0.24 across all 16 @Ngaf libs.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 5, 2026

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

Project Deployment Actions Updated (UTC)
cacheplane Ready Ready Preview, Comment May 5, 2026 6:28pm

Request Review

blove added 4 commits May 5, 2026 11:19
Live Chrome smoke caught: when a Pandoc citation def has a bare URL (no
<autolink> brackets), mdDefToCitation returns Citation { url: undefined }.
Prior template used [href]="r.citation.url ?? null" which Angular
serialized as href="" — a broken anchor that renders as a clickable link
that goes nowhere.

Fix: split the resolved branch into "with URL" (renders <a>) and
"without URL" (renders <span class="chat-citation-marker--no-url">).
The span shows the bracket marker but is non-interactive, matching the
unresolved fallback's contract.

Also switched from [href] property binding to [attr.href] for explicit
attribute removal when null.

Regression test pins both branches.
Live Chrome smoke caught: when citations come from Pandoc-formatted
[^id]: defs in message content (no provider metadata in
additional_kwargs.citations), inline markers resolved correctly via the
markdown sidecar but the sources panel under the message never rendered
— defeating the click-to-source affordance.

Fix: ChatCitationsComponent now optionally injects CitationsResolverService
and merges markdown-sidecar defs (via mdDefToCitation) into its citations
list, with Message.citations taking precedence by id. Behavior matches
the same precedence as inline-marker resolution.

Two new regression tests pin both behaviors: markdown-only citations
appear in the panel; Message.citations wins on id overlap.
Live Chrome smoke caught: checkbox rendered on a separate line above the
task text because <chat-md-paragraph> > <p> is block-level, pushing the
content below the input. Now uses flexbox on the .chat-md-list-item--task
container to align checkbox + content baseline, and collapses the inner
<p> margin so tight tasks read as a single line.

Multi-paragraph task items (sub-lists, additional paragraphs) still flow
correctly because flex-wrap is enabled and only direct children flex.
Live Chrome smoke caught: prior fix collapsed margin on ALL paragraphs
inside task items, so multi-paragraph content ran together with no
visible break (e.g. "write reportCoral reefs are diverse..." running
into the next block when the model emitted prose immediately after a
task item without a blank line).

Refined: only the FIRST paragraph of a task item collapses its margin
(so it aligns inline with the checkbox). Subsequent blocks keep normal
vertical spacing.
@blove blove merged commit a06f3c2 into main May 5, 2026
14 checks passed
@blove blove deleted the claude/fix-table-row-rendering-0.0.24 branch May 5, 2026 18:33
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