Repository navigation
fix(questions): plain-bullet choices keep their wrapped lines - #1699
Merged
Merged
Conversation
A plain-bullet choice that wrapped onto indented lines was cut at its first line, and the rest of it was pushed into the context above the options. Plain bullets now continue the way CommonMark reads a list item (indented lines, lazy unindented lines, an indented paragraph after a blank line), and those lines leave the context when the bullets become the choices. Bullets that stay prose (a text question, or a question with task-list choices) are unchanged. A plain bullet with a bold name set off by punctuation (- **Name:** prose) takes the name as its label and the rest as its description. A label over the 200-char answer cap is cut at its first sentence so it can still show as picked. The Recommended: line now wraps like a paragraph too, and a recommendation whose first sentence names a choice marks it. Task-list choices split exactly as before.
… renderers A table in a question card's context rendered as one paragraph of pipes: the card ran its context through the small callout prose renderer, which knows paragraphs and flat lists only. The context now goes through the document's own parser and BlockRenderer (new QuestionContext), so tables, lists, code fences, quotes, headings and images look as they do in the document, at the card's scale. - The context blocks carry no data-block-id, so a selection or pinpoint inside them still resolves to the card and its context part, and an annotation anchors to the card's block id (checked: a comment on a context table cell saves on the card's block and restores after reload). - blockTargeting checks the question card before the code / math / table branches, which would otherwise take the whole card for a table or code block now that its context can contain one. - The parser keeps each context line's indentation (less what every line shares), so wrapped list items, nested lists and code fences survive. Also, from the plain-bullet fix: a parenthesis after a bold choice name stays in the label (**Name** (detail) is one label).
… renderer - Recommended: a reason on its own line after the recommendation stays context, as on main. Only a genuine wrap (the line ends without sentence punctuation and the next starts in lower case, and starts no other block) continues it. A choice is matched on the Recommended: line first, then on the wrapped text; only an unmatched recommendation becomes the suggested answer. - Task-list labels are never cut. Plain-bullet labels never collide: a cut label, then a bold-name label, falls back to the uncut, then the plain split when two bullets would share it. A recommendation may name a cut label's full form. - A bold name is ** only, so __init__: constructor stays one label. - Bullet continuation compares indentation with the bullet's content column, so an indented body (a question inside a list item) still ends a bullet at a quote, table or heading. - Shared context indentation is removed in columns (tabs included). - useActiveSection observes headings that have a block id only, so a heading in a question's context cannot freeze the TOC's active section.
Owner
Author
|
Review fixes pushed (70a1616):
New tests cover each item. Typecheck is clean. Known limit of the conservative rule: a wrapped recommendation whose next line starts with a capital (Q1 |
… drop a replaced recommendation's wrap - A recommendation may name a plain bullet by its first line or that line's dash-split label, as main matched it, even after wrapped or lazy lines join the bullet's text. - A recommendation's wrapped lines stay in the context until the end; when a later Recommended: line replaces it, they remain there instead of vanishing.
…new DOM test in CI - QuestionContext styled its renderers with Tailwind arbitrary variants, which every bundle scanning packages/ui/components generated, so the guides.show viewer CSS (and its pinned manifest) changed though the viewer never renders a question card. The same rules now ship as one stylesheet React hoists once (<style href precedence>). Rendering is pixel-identical (Q1-Q8 screenshots byte-identical) and the viewer manifest is in sync. - Add packages/ui/hooks/useActiveSection.test.tsx to the DOM_TESTS step.
This was referenced Oct 5, 2026
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Target: 0.28.2. Two owner reports from a live pando-ops review, one commit each. No version bump.
1. Plain-bullet choices keep their wrapped lines
A
:::questionwhose choices are plain bullets that wrap onto indented lines was cut at the first line, and the rest of each choice was pushed into the context above the options:One per session: "ramos · cloud-3", "ramos · cloud-4". Each agent shows. Its continuation (as its own machine …) was in the context.One per session(label) followed by the full description. The context holds only the prose.Cause:
parseQuestionBlockattached indented continuation lines to task-list choices (- [ ]) but not to plain bullets. This was present since #1637.question-textblock, or a block that already has task-list choices), they stay in the context.- **One per session:** …,- **a. It stops.** …) uses the name as the label and the rest as the description.**Fast** modeand**Name** (detail)stay one label.Recommended:line now wraps like a paragraph. Before, its second and later lines were dumped into the context (Q1, Q2, Q3, Q6 and Q8 of the same file ended their context with a fragment of the recommendation). A recommendation whose first sentence names a choice (one per session. Answer: per session / per person.) marks that choice.QUESTION_AUTHORING_GUIDEis unchanged.2. Question context renders full block markdown
A table in a question's context rendered as one paragraph of pipes. The card used the small callout prose renderer, which handles only paragraphs and flat lists.
QuestionContextcomponent runs the context through the document's ownparseMarkdownToBlocksandBlockRenderer. Tables, lists, code fences, quotes, headings and images look as they do in the document, at the card's 13px muted scale. This adds no new renderer and makes no@plannotator/uiAPI change.data-block-id. A selection or pinpoint inside them still resolves to the card and itsdata-question-part="context"part.blockTargetingnow checks the question card before the code, math and table branches. Without this, a card whose context holds a table or code fence would be taken for a table or code block.Checked in Chromium with the built app: a comment on a table cell inside a question's context saves on the card's block id, and its highlight restores after a reload.
Screenshots
Headless Chromium, built app,
plannotator annotateon the owner's QUESTIONS.md. Saved locally in~/plannotator-shots/question-cards-0.28.2/:before-q{1,2,4,5}.png/after-q{1,2,4,5}.png: Q1 and Q4 show full choices, Q2 and Q5 show real tables, and the Q2 suggested answer is complete.after-q-table-annotated.png,after-q-table-restored.png: a comment on a context table cell, before and after a reload.Tests
packages/core/question-block.test.ts: the reported block (both options in full, context free of continuation lines), a wrapped recommendation, recommendation matching by label and by the whole joined text, lazy continuation and its end at a new block, multi-paragraph bullets, the bold-name rule, the over-long label, plain bullets that stay in the context (text question, and a question with task-list choices), task-list behavior unchanged, and context markdown fidelity (table, code indentation, nested list, shared indent removed).packages/ui/components/blocks/QuestionBlock.test.tsx(DOM): the context renders a real table, bold text, list items with their wrapped line, a code fence and a blockquote, with no innerdata-block-id.packages/ui/utils/blockTargeting.blocks.test.tsx(DOM): a card with a table and code in its context is still one card of parts, and a table cell or code line resolves to the context part.bun run typecheckis clean.DOM_TESTS=1 bun test packages/core packages/ui packages/editorpasses except for failures that are unrelated to this change:DocBadgesfails only in the full run (it passes alone and also failed with only the core change), and the live paste-service E2E tests need the network.Not changed and out of scope: plain bullets that are information rather than options (Q1 and Q7 of the file) still become choices under the existing plain-bullet rule. The Questions panel shows a bold prompt with literal
**.