docs/solutions/logic-errors/2026-04-09-block-discussion-summaries-must-include-inline-void-text.md
BlockSuggestionCard rendered its Delete: summary from ResolvedSuggestion.text, but the summary builder only concatenated text leaves and block suggestion tokens.
That meant inline void suggestion elements such as mentions, dates, and inline equations vanished from the summary even though they were visibly part of the deleted content.
Hello Ada!, leaving Hello !Teach block-discussion-index.ts how to extract display text from inline suggestion elements before the block-suggestion branch:
const getInlineSuggestionElementText = (node: TElement) => {
if (typeof node.value === 'string' && node.value.length > 0) {
return node.value;
}
if (typeof node.date === 'string' && node.date.length > 0) {
return formatSuggestionDateText(node.date);
}
if (
typeof (node as TElement & { texExpression?: unknown }).texExpression ===
'string' &&
(node as TElement & { texExpression: string }).texExpression.length > 0
) {
return (node as TElement & { texExpression: string }).texExpression;
}
};
Then, when a suggestion entry is an element and matches the current suggestion id, append that inline text into text or newText based on suggestion type.
Do not add a separate summary protocol for this. The discussion layer should reuse the inline void node's existing display-facing properties instead of introducing another configuration surface just for summaries.
Inline void elements do not contribute text leaves the same way normal inline text does, so leaf-only aggregation undercounts what the user actually deleted.
By mapping the element itself to its visible label, the resolved suggestion summary matches what the editor shows on screen.
These checks passed:
bun test apps/www/src/registry/ui/block-discussion-index.spec.tsx
bun test packages/suggestion/src/lib/withSuggestion.spec.tsx
pnpm install
pnpm turbo build --filter=./apps/www
pnpm turbo typecheck --filter=./apps/www
pnpm lint:fix
Browser check:
dev-browser --connect http://127.0.0.1:9222http://localhost:3001/docs/discussion opens and reports title Discussion - Platevalue, date, or texExpressiondocs/solutions/logic-errors/2026-04-08-suggestion-delete-backward-must-mark-inline-voids.md