Repository navigation
Inbox: show a markdown choice label's words, not its markdown, in folded lines and answer rows - #2219
Open
backnotprop wants to merge 8 commits into
Open
backnotprop wants to merge 8 commits into
backnotprop wants to merge 8 commits into
Conversation
…r rows A choice label is the agent's inline markdown ([15% off](forecast-15.html), inline code, bold). The live card draws it as markdown, but the folded line, the answers a sent reply carried, the reply box's answers, the open questions Draft, a replaced card's unsent pick and decision mode's stamp showed the raw markdown. They now show the label's words (plainLabel). The reply the agent reads and read_thread keep each label exactly as written.
Review of #2219: plainLabel no longer drops <...> text (Array<string>, Result<T, E>), reads a backslash escape as its character (\*, \+), reads a link whose address holds parentheses or whose text holds brackets as its text, an autolink as its address, and a picture with no alt as its file name. cleanInline drops tags only without keepTags, so prompts and bodies read as before. Decision mode's swipe hint says the labels' words (swipeHint); a swipe still commits the label as written.
# Conflicts: # packages/inbox/decisions/DecisionCard.tsx # tests/e2e/playwright.config.ts
…nk-labels # Conflicts: # packages/inbox/folding.ts
…nk-labels # Conflicts: # tests/e2e/playwright.config.ts
This was referenced Oct 27, 2026
…nk-labels # Conflicts: # packages/core/inbox-folding.ts
This branch has not been deployed
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.
Problem
An Inbox question's choice label is the agent's inline markdown, for example
- [ ] [15% off](forecast-15.html). The live question card renders it as markdown, and the link opens the attached file. Every other place that shows a pick as plain text showed the raw markdown instead:[15% off](forecast-15.html),**Email**,`push`. This was seen in a 0.28.31 Inbox capture.Fix
These surfaces now show the label's words ("15% off"). Each one is a plain-text line or row, and most sit inside a button, so a link cannot go there. The new helper
plainLabelinpackages/inbox/folding.tsproduces the words. It reusescleanInlineand matches what the live card shows:<…>text stays (Array<string>,Result<T, E>).cleanInlinedrops tags only withoutkeepTags, so prompts and message bodies read as before.\\*,\\+).folding.tsanswerWordsSentAnswers)ReplacedQuestion.tsxpickWords(viasentReply.ts)ReplyAnswers)pickWordspickWordspickWordsdecisions/model.tsanswerWordsdecisions/model.tsswipeHint(a swipe still commits the raw label)Only picked choice labels change. Other and free-text answers are the person's own words and still show exactly as typed.
Unchanged on purpose:
composeInboxReplyBody,Answer: [15% off](forecast-15.html)) and MCPread_threadstill carry each label exactly as written, so agents match answers to their choices as before. The fix touches display helpers only; stored answers and agent-facing output are untouched. The e2e checks both the reply body andread_thread.shared/inbox/search.ts).This keeps the change local to
folding.ts,ReplacedQuestion.tsxanddecisions/model.ts, so it merges cleanly iffolding.tsmoves to@plannotator/core.Tests
folding.test.ts: the folded snippet,snippetTextandplainLabel.decisionsModel.test.ts: decision modeanswerWords. The stored answer keeps the label.packages/inbox/choiceLabels.test.tsx, added to the test.yml DOM list. It covers the folded lines and their aria-labels, the sent answers, the live card's link and code, the open questions Draft, the reply-box answers, and the replaced card's pick. Its 5 cases cover 6 surfaces. Four fail on the old code; the live-card case passes on both, because it guards behavior that already worked.tests/e2e/inbox-choice-labels.spec.ts, registered in the Playwright config. It runs against the compiled binary throughplannotator inbox mcp. It covers the folded lines with their tooltip and aria-label, the sent answers, the live card link opening the attachment, the open questions Draft, the reply-box answers, the agent's reply body andread_thread, and a phone layout.Run locally:
bun run typecheck: pass.DOM_TESTS=1 bun test --isolateover the test.yml list): 2908 pass, 0 fail.bun test packages/inbox packages/core/question-block.test.ts: 549 pass.__CLI_VERSION__="0.0.0-dev"):inbox-choice-labels,inbox-thread-folding,inbox-replaced,inbox-open-questions,inbox-decision-modeandinbox-picks-composingall pass, 30 tests.