Repository navigation
fix: show a callout's title text while its marker is concealed - #593
Merged
Merged
Conversation
…after the marker as untitled
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
With the caret outside a callout,
> [!WARNING] Titleused to hide its whole marker row, so the title text appeared nowhere. Now only the marker part is hidden: from the first>through[!TYPE], any+/-fold suffix and the whitespace after it. The title stays on screen as the callout's title row. Untitled callouts behave as before (whole row hidden).Changes
callout.ts: a newcalloutConcealSpancomputes{from, to, hidesLine}once from the marker grammar (matchCalloutMarkernow returns where the marker ends, andcalloutTypeForLinedelegates to it).calloutMarkerConcealis that span plus the selection check.callout-marker-conceal.ts: records come fromcalloutConcealSpan. OneDecoration.replacecovers exactly the span, and the exclusion zone is that same span. The zero-height line class is added only when the whole row is hidden (hidesLine).block-style.ts: the line-skip check is nowlineInExclusionZone(new inshared.ts), so a row is skipped only when a zone covers it whole. The-opencorner migrates only when the marker row is hidden, so a titled row keeps its corner, outer gap andquoll-callout-markerheader class.theme.ts: comments only.>instead, and the 0-3 spaces of indent before it stay visible. Body rows keep that indent too (blockquote-reveal hides only the>), so this keeps the title aligned with the body. The untitled whole-row case still starts at the line start. Any whitespace the marker grammar accepts (including a no-break space) counts as "no title".Related
> [!WARNING] タイトルtitle shows nowhere while the caret is outside the calloutTest Plan
cm-decoration-callout-marker-conceal.test.ts:>, title start) for> [!WARNING] タイトル,>[!NOTE] Title,> [!NOTE] Title, a tab-separated marker,[!WARNING]+ heads up,[!WARNING]- heads up,**title**and a no-break-space-separated title.**title**full-stack mount does not throw, and the DOM row showstitlewithout[!TIP].>-line edits, so these take the structural full-rebuild arm;cm-decoration-block-style.test.ts: a titled row keeps-open/-outer-open/quoll-callout-marker, and the body row does not take the corner. A whole-line zone skips the row, a partial zone does not. This replaces the old "line-start-in-zone" pin, which encoded the behaviour this PR changes on purpose.test/webview-browser/callout-title-row.browser.test.ts:+,-and bold title.[!or**, has rounded top corners and top padding, and that the body row is not top-rounded.> [!NOTE] Title: the title and the body text share the same left x.mainsource, 4/5 browser tests and 14 unit tests went red (the untitled contrast case stays green on purpose).pnpm compile,pnpm lintand the full vitest suite (parallel-checks) pass.