Skip to content

fix: scroll to headings in Inbox Markdown attachments - #2316

Merged
backnotprop merged 1 commit into
backnotprop:mainfrom
utpalsinghdev:fix/2229-inbox-heading-anchors
Oct 29, 2026
Merged

backnotprop merged 1 commit into
backnotprop:mainfrom
utpalsinghdev:fix/2229-inbox-heading-anchors

Conversation

@utpalsinghdev

Copy link
Copy Markdown
Contributor

Summary

Heading links in Inbox Markdown attachments were intercepted without scrolling because the attachment Viewer had no scroll viewport.

Pass the attachment’s scroll container through the existing ScrollViewportProvider. Scope anchor lookup to the current Viewer so a matching heading in the thread cannot shadow the attachment’s target.

Add browser coverage for side-by-side, full-screen, and phone-sized layouts, including duplicate headings, encoded Unicode anchors, missing targets, and preserving the Inbox route. Update the attachment guide.

Closes #2229

Verification

Reproduced both the original failure and the duplicate-heading case before fixing them.

  • bun run typecheck passed.
  • bunx playwright test -c tests/e2e/playwright.config.ts inbox-markdown-anchors.spec.ts inbox-attachments.spec.ts annotate-bundle-back-scroll.spec.ts passed all 20 tests.
  • 64 related DOM tests passed, covering shared Viewer navigation, scroll viewports, linked-document restoration, and attachment behavior.
  • bun run --cwd packages/ui smoke:package passed.
  • guides.show viewer build, size budgets, manifest generation, and core typecheck passed.
  • 25 CI guard and bridge tests passed.
  • git diff --check passed.
  • Tested in Brave on macOS. Heading navigation worked side-by-side, full-screen, and at a 390 px viewport, including duplicate thread headings, encoded Unicode anchors, back-to-top links, and missing targets. Anchor clicks preserved the Inbox route.

Validation was scoped to the affected behavior and shared UI dependencies.

Provide the attachment scroll viewport to the Markdown Viewer.
Resolve anchors within the current Viewer so duplicate heading IDs
in the thread cannot prevent navigation.

Add browser coverage for attachment layouts and anchor edge cases.

Closes backnotprop#2229
@backnotprop backnotprop added the ci:full Run the heavy CI tier on this PR (added by the merge script) label Oct 29, 2026
@backnotprop
backnotprop merged commit 6a58119 into backnotprop:main Oct 29, 2026
82 of 83 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:full Run the heavy CI tier on this PR (added by the merge script)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Inbox: heading-anchor links in Markdown attachments do not scroll to existing targets

2 participants