ENG-2273 Scroll to and highlight the matched line when previewing a tagged result - #1490
Merged
trangdoan982 merged 4 commits intoSep 30, 2026
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
Contributor
There was a problem hiding this comment.
Devin Review found 3 potential issues.
2 flags not posted on this PR by your GitHub settings — view them in Devin Review. (Configure)
trangdoan982
added this pull request to stack #1496
September 28, 2026 15:07
trangdoan982
force-pushed
the
eng-2273-scroll-to-and-highlight-the-matched-line-when-previewing-a
branch
from
September 28, 2026 15:08
12dfa6b to
6eff267
Compare
mdroidian
approved these changes
Sep 30, 2026
Base automatically changed from
eng-2272-show-candidate-nodes-as-results-in-advanced-node-search
to
main
September 30, 2026 15:22
…agged result Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Entire-Checkpoint: 01M3J54Y422F140AV66BB5NYM8
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Entire-Checkpoint: 01M3J5CM30EQJKV9EHB765CWV0
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Entire-Checkpoint: 01M3J5KSWXQJWTYT3PWBJ2GQS2
…witch race Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Entire-Checkpoint: 01M3J6HQZKQ6DYSAAWQW3F5CAH
trangdoan982
force-pushed
the
eng-2273-scroll-to-and-highlight-the-matched-line-when-previewing-a
branch
from
September 30, 2026 15:24
6eff267 to
672317e
Compare
trangdoan982
deleted the
eng-2273-scroll-to-and-highlight-the-matched-line-when-previewing-a
branch
September 30, 2026 16:40
This branch was previously 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.
https://entire.io/gh/DiscourseGraphs/discourse-graph/trails/30
Reviewer brief
Stacked on #1489 (ENG-2272). Merge that first; this PR targets its branch.
MarkdownRenderer.renderhas no source-line-to-DOM mapping.metadataCachesection, in order. I checked this live in Obsidian 1.13.7.locateTaggedLinemaps the line to a section index, then to a list item or table row.flowchart TD A["Candidate selected<br/>(file, tagLine.line)"] --> B["PreviewPane render effect<br/>MarkdownRenderer.render + waitForImages"] B --> C["Scroll effect, keyed on renderedFile + line<br/>(same-note switch doesn't re-render)"] C --> D["locateTaggedLine(sections, listItems, line)<br/>taggedLineLocator.ts"] D --> E{"Cache offsets match the text<br/>and block/item counts match?"} E -- yes --> F["container.children[blockIndex]<br/>→ Nth li / tr"] E -- no --> G["Fallback: unique exact, then unique containing<br/>match on renderedLineText (p, li, h*, tr)"] F --> H["scrollIntoView center<br/>+ .dg-search-preview-flash"] G --> H G -- "none or several" --> I["scrollTop = 0"]The diagram shows how a candidate's source line becomes a scroll target in
apps/obsidian/src/utils/taggedLineLocator.ts.Verification
pnpm ci:validatepasses on the final head.apps/obsidian/src/utils/__tests__/taggedLineLocator.test.ts. They coverlocateTaggedLineandrenderedLineText. To rerun:pnpm -C apps/obsidian test:unit.dg-obsidian-cdp-verifyskill. All 19 scenarios pass on the final tree.pcentered and flashedP, scrollTop 1589, flashedliLI, 3349##heading, first resulth2H2, 5113pP, 1965li, not its parentLI"level2 B", 2112LI"level3 C", 2122trTR, 2635DIV.callout, 2424[[link|alias]],**bold**,_italic_,`code`pP, 3290LI2147,P3325trTRpPScreenshots, one per scenario:
Not verified:
--text-highlight-bg.https://www.loom.com/edit/6cd21e7aa52941e8949b1ba6add92d9e
Scope check
$scope-checkagainst ENG-2273 and the final diff.Done When: Results with no tagged line, and lines that can't be located, reset the preview to the top (scrollTop = 0).Standards check
$dg-pr-adherence-checkagainst the final diff and PR metadata.Local delegated full review
$dg-delegated-full-reviewwhen no other full-review workflow is available.It found one low-severity issue: a line that couldn't be located kept the previous scroll position. That's fixed in e6715c0. Devin's three review findings are fixed in 12dfa6b.
🤖 Generated with Claude Code