Repository navigation
fix(markdown): a table indented under a list item shows as a table - #209
Conversation
Agents indent a table under the list item it belongs to. The list read every indented line as the item's text, so the header, separator and rows ran together into one line of pipes. An indented table now ends the list and shows as its own block, as an indented fence already does.
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: devswha/herdr-web-ui/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review. 📝 SummarySummary by CodeRabbit
WalkthroughMarkdown parsing now recognizes tables indented beneath list items as separate blocks. The parser preserves surrounding list blocks, the following ordered list’s start number, and inline-code parsing for bracketed table-cell values. ChangesIndented table parsing
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Low Merge Risk: ⚪ Minimal · up to The change renders indented tables separately while preserving surrounding lists and numbering. No actionable merge-blocking issue was identified; merge after normal checks pass. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 2 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
# Conflicts: # CHANGELOG.md
Fixes the client findings from the pre-release adversarial review of `main` (before v0.3.36). Server findings are in a separate PR. ## Findings, fixes and tests 1. **Edge swipe vs. text (P2, #187)**: `src/lib/edgeSwipe.ts` - The drawer swipe no longer arms on an input, textarea, select or contenteditable target, or while a non-collapsed selection exists. A selection that begins mid-stroke releases the stroke back to the page until the drawer has moved (after that the stroke stays the drawer's, as specified). - Test: 3 new `edgeSwipe.test.ts` cases (text field with the drawer open and closed, selection at start, selection mid-stroke) fail without the fix. A 4th case covers the stroke after the drawer moved, and it passes either way. 2. **Indented table ends its list (P2, #209)**: `src/lib/markdown.ts`, `src/components/Markdown.tsx` - A list item now holds the blocks indented under its text, in order (`ListItem.blocks`: nested lists, tables, and paragraphs of text after them), replacing `children`. The table renders inside the `<li>` through the same `Blocks` → escaped table path as a top-level table. There is no new HTML path; the only `dangerouslySetInnerHTML` in `Markdown.tsx` is the existing KaTeX one. So `1.`-numbered items keep counting after a table and nested siblings stay nested. - Side effects: a nested list after a blank line nests in its item. Two nested lists under one item (e.g. `-` then `1.`) no longer overwrite each other. Text after an item's table or nested list renders below it, and a quote or rule there ends the list as before. - #209's structural assertion (`list, table, list, list`) encoded the reported bug, so it now expects one list with the table inside the nested item. Its content assertions (cells, inline code, "Example:") are unchanged. - Tests: new `markdown.test.ts` cases for repeated `1.` numbering (parse + rendered HTML, one `<ol>`), nested sibling after a table, table/list order, two nested lists, text after a table, and a quote after a table all fail without the fix. An escaping case (`<script>`, `<img onerror>` in a cell inside an item) is a guard and passes either way. - Left as is: an indented code fence still ends the list (unchanged behavior, possible follow-up). 3. **Suggestion survives Send now (P2, #198/#213)**: `src/components/PaneTerminal.tsx` - The suggestion is now cleared in `sendComposerText` once the socket accepts the submission, so the composer, quick replies and the queue's Send now all clear it. (A send the socket refuses no longer clears it.) - Test: `scripts/ui-regression.ts` queues a message, paints a Claude suggestion, delays every later prompt read by 5 s, clicks Send now and requires the placeholder to go within 2.5 s. It fails without the fix. 4. **Stale provider looks normal in the top panel (P3, #206)**: `src/components/UsageMeters.tsx/.css` - A panel row with a problem dims its value, bar and window as the footer chip does, and shows the reason under them. It has an icon (`aria-hidden`) and the same sentence the open panel uses, in `--status-blocked` for expired/failed and `--text-dim` for rate-limited/locked. The text is part of the button's accessible name. No new i18n strings. - Test: `scripts/usage-regression.ts` checks the two problem rows, their texts, the single error-colored one, the accessible name and the dimming. It fails without the fix. ## Checks - `bun run generate:types --check`, `typecheck`, `test:unit` (626 pass), `build`, `test:ui` (all PASS, on an isolated herdr test session) - Each fix was reverted and its tests confirmed failing - Codex (gpt-6-astra) adversarial review of the diff: the one real finding was text after a table rendering above it, now fixed. It also flagged that a selection after the drawer moved doesn't release the stroke, which the spec puts out of scope. A second pass compared 5,408 list shapes against `origin/main` and found no content loss, no hangs and no regressions. ## Screenshots (390×844) The markdown shot comes from a static fixture of the real `Markdown` component (before: `main`, after: this branch). The usage panel shot is from `test:ui`'s evidence run. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
## Change Installed apps are on v0.3.35. This PR prepares v0.3.36. The app and plugin versions go up together, and the Unreleased notes move under the dated release heading. It also fixes the CHANGELOG: the #187 entries (edge swipe, Hide keyboard) had been placed in the already released 0.3.34 section. They now sit under Added in 0.3.36, merged with #217's text-selection fix for the swipe. Entries that had no PR link now have one. This release includes: - **Added:** - Left-edge drawer swipe and keyboard dismissal on phones (#187) - Opt-in color palettes and agent icons, with Amber staying the default (#188) - Claude's suggested next prompt in the composer (#198) - Plan meters at the top of the sidebar as an option (#206) - **Fixed:** - A fallback card for blocked screens no reader knows (#205) - Ctrl+Shift+↑/↓ typing into the terminal (#215) - Attach-held races (#207) - Plugin `stop` returning before the server is gone (#210) - A table inside a list (#209) - Queued messages showing only under the chat lens (#213) - Quick replies column on wide screens (#212) - A clear message for Windows hosts (#208) - **Pre-release review:** an adversarial review of everything since v0.3.35 found these problems, fixed in #216 (server) and #217 (client): - Fallback menu inference typed digits into a following prompt and cut off wrapped labels. - The held-attach timeout unlocked input after a refusal. - The suggestion read could delay prompt polling. - `stop` misread zombie processes. - The swipe stole text selection. - Ordered-list numbering restarted after a table. - A stale suggestion survived Send now. - The top usage panel hid provider failures. ## Validation - `bun scripts/release-notes.ts 0.3.36` passes. - Fast checks and Integration and browser must pass before the squash merge. After the merge, publish with `gh workflow run release.yml --ref main -f version=0.3.36`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
Change
Agents often indent a table under the list item it belongs to:
The chat's list parser read every line indented under an item as more of the item's text. The table's header, separator and rows ran together into one line of pipes after "Example (…):".
An indented table now ends the list and shows as its own table block, the way an indented code fence already does. Items after the table start a new list. A numbered list keeps its numbering, since a list already starts from its own number after a break.
startsTable()now holds the header-plus-separator test thatstartsBlockandparseMarkdowneach had inline.Validation
src/lib/markdown.test.tscase, using the shape above: a numbered item, a nested item, then an indented table and more items. It expects list, table, list, list, with the table's cells (inline code included) andstart: 2on the numbered list after it. It fails onmainand passes here.bun run test:unit572 pass,tsc --noEmitclean.