Skip to content

fix(note): write a prompt item's label in italics where its button would go - #181

Merged
sigma merged 1 commit into
mainfrom
ticket-168
Nov 10, 2026
Merged

sigma merged 1 commit into
mainfrom
ticket-168

Conversation

@sigma

@sigma sigma commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

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:

 ##### ⬜ canary
-^canary-send
+*send to qm-e2e/canary* ^canary-send            ← render (item_upsert), no command id
+*send to x* <!-- qm pane=w1:p1 --> ^canary-send  ← splice (SetDispatch) on a bare ^id
+[▶ send to x](obsidian://…) ^canary-send        ← same item, vault with a command id
  • Renderer.Item writes the label (its own, or send to <to>) as the last line of the paragraph, marker or not, so the paragraph never starts with <!--.
  • SetDispatch splices 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.
  • The parser reads the label back as the item's 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.
  • Spec §4.1 documents the shape.

Evidence

  • Before: worklog send on 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).
  • After: TestSendPromptOnlyItem sends such an item and asserts the note holds *send to IaC* <!-- qm pane=wX/p9 --> ^send-bare and still parses; TestSetDispatchOnBareID pins the splice and the refusal; TestSetDispatchMatchesRender pins render/splice parity; TestLabelWithoutButton pins the round trip and the button reappearing with a command id.
  • Gates: just check (697 tests) and just flake-check green.

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.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

…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.
@sigma
sigma merged commit 53f2869 into main Nov 10, 2026
2 checks passed
@sigma
sigma deleted the ticket-168 branch November 10, 2026 16:20
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.

A send's pane marker breaks the note on a prompt item without a ▶ button

1 participant