Repository navigation
fix(note): write a prompt item's label in italics where its button would go - #181
Merged
Merged
Conversation
…uld go A vault without Obsidian Shell commands settings renders no ▶ button, so a prompt item's paragraph held only ^<id>: a dispatch marker written there started the line, CommonMark read an HTML block, not a paragraph, and the engine's parse check refused the write, leaving the pane unrecorded (#168). An item with a prompt now ends its paragraph with its button label in italics where the button goes, its own or send to <to>, marker or not, so the paragraph never starts with <!--. SetDispatch writes the same label before a marker spliced onto a bare ^<id> paragraph, and refuses when there is no label to write; the renderer likewise refuses a marker with no line of prose, button or label to end. The parser reads the label back as the item's, not body text, so it round-trips and renders as a button again once the vault has a command id. Spec §4.1 documents the shape.
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.
Summary
Fixes #168, as decided.
On a vault without Obsidian Shell commands settings an item with a prompt rendered no ▶ button, so its paragraph held only
^<id>— and a dispatch marker written there started the line, which CommonMark reads as an HTML block, not a paragraph. The engine's parse check refused the write, so a send left its pane unrecorded.The label now goes where the button would go, in italics, in every writer:
Renderer.Itemwrites the label (its own, orsend to <to>) as the last line of the paragraph, marker or not, so the paragraph never starts with<!--.SetDispatchsplices the same label before a marker recorded on an item whose paragraph is only^<id>, and refuses when there is no label (no prompt, no prose) to write; the renderer likewise refuses a marker with no line of prose, button or label to end.Button, cut from its body (cost/route/tier reads untouched), so it round-trips byte for byte and renders as a button again once the vault has a command id.Evidence
worklog sendon a prompt-only item in a button-less vault —the note does not parse: line 114: a ##### work item needs a paragraph ending with ^<item-id> right under it(issue body).TestSendPromptOnlyItemsends such an item and asserts the note holds*send to IaC* <!-- qm pane=wX/p9 --> ^send-bareand still parses;TestSetDispatchOnBareIDpins the splice and the refusal;TestSetDispatchMatchesRenderpins render/splice parity;TestLabelWithoutButtonpins the round trip and the button reappearing with a command id.just check(697 tests) andjust flake-checkgreen.Merge Danger
Door: two-way.
Blast Radius: note rendering for prompt items; vaults with a Shell commands id see no change (
[▶ label](…)as before), and every existing note still parses — the italic form only appears where no button was rendered at all.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.