Repository navigation
feat(questions): Decision flag, findQuestionBlocks, host footer slot - #1664
Merged
Merged
Conversation
- core: parse 'Decision: when answered' (decisionOnAnswer) and
'Decision: [statement](https://...)' (decision) after the prompt; the
key never changes
- core: findQuestionBlocks(markdown) -> { key, directiveKind, startLine,
endLine, text } with the same -2/-3 de-dup as indexQuestionBlocks
- core: new markdown-structure subpath holds the block splitter's
structural rules (frontmatter, fences, math, directives, HTML blocks,
reference links), shared by ui's parser and findQuestionBlocks; a
parity test runs both over tricky fixtures
- ui: decision tag/row on question cards, renderQuestionFooter slot,
questionAnswers host prop, explicit save mode (onSaveQuestionAnswer)
- guide-viewer manifest CSS hash rotated (new card classes)
Optional Viewer prop (string or (question) => string), threaded through BlockRenderer to QuestionBlock. Default stays "Save answer"; the card never derives a label from decisionOnAnswer, since only the host records.
A resolved save cleared whatever draft was current, discarding an edit made while the promise was pending; now only the submitted draft is cleared. A draft edited back to the saved answer is dropped so a later host update shows.
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.
What
Decision: when answeredline after the prompt setsParsedQuestion.decisionOnAnswer; aDecision: [statement](https://...)line setsParsedQuestion.decision(the link wins over the flag). Both stay out ofcontext, otherDecision:values stay prose, and neither changes the question key.findQuestionBlocks(markdown)returns{ key, directiveKind, startLine, endLine, text }per question block, with the same-2/-3key de-dup asindexQuestionBlocks(one shared helper).@plannotator/core/markdown-structuresubpath. The block splitter's structural rules (frontmatter, code fences, display math, directives, HTML blocks, reference links) moved out of ui's parser soparseMarkdownToBlocksandfindQuestionBlocksshare one copy.questionBlockParity.test.tsruns both over fenced, nested, quoted, HTML, math, frontmatter, reference-link, CRLF and unclosed cases.Viewer->BlockRenderer->QuestionBlock): a decision tag and row on flagged or linked cards,renderQuestionFooterfor host actions (live in read-only cards too, so read-only now disables each input instead of the fieldset),questionAnswers(host-kept answers replace the annotation path), and an explicit save modeonSaveQuestionAnswer(draft in the card, Save answer / Cancel, no Skip).Why: upstream ask from Workspaces (answers kept beside the document, some answers become project decisions). Plannotator passes none of the new props; its cards only change by showing a Decision line when a block has one.
Left out on purpose: the record lines inside the block (
Other:,Answer:,Note:,Answered:) andwriteQuestionAnswer, dropped with the owner's answer on where answers live.