Skip to content

fix(doc-page): restore deep-link scrolling and show AsciiDoc section anchor icons#484

Merged
rdmueller merged 1 commit into
LLM-Coding:mainfrom
raifdmueller:fix/doc-page-anchor-links
May 15, 2026
Merged

fix(doc-page): restore deep-link scrolling and show AsciiDoc section anchor icons#484
rdmueller merged 1 commit into
LLM-Coding:mainfrom
raifdmueller:fix/doc-page-anchor-links

Conversation

@raifdmueller
Copy link
Copy Markdown
Contributor

@raifdmueller raifdmueller commented May 15, 2026

Summary

Two related fixes for the long-form workflow pages (brownfield, spec-driven-development, brownfield-experiment-report, etc.):

  1. Deep links now scroll to the section. URLs like /brownfield#phase-0-5-socratic-code-theory-recovery landed on the page but the SPA's "Loading…" shell destroyed the pre-rendered IDs before the async fragment fetch completed. After the fragment is injected we re-scroll to window.location.hash.
  2. Headings get a visible § anchor icon on hover. Asciidoctor already emits <a class="anchor"> before each heading (we set sectanchors:true), but the link was invisible. Now it fades in on hover, matching the default Asciidoctor stylesheet. scroll-margin-top keeps the target heading clear of the sticky header.

Test plan

  • Build + preview locally
  • Open /brownfield#phase-0-5-socratic-code-theory-recovery directly → scrolls to the section
  • Hover any <h2> / <h3> in /brownfield, /spec-driven-development, /brownfield-experiment-report§ icon appears, clicking it updates the URL hash and re-scrolls

🤖 Generated with Claude Code

Summary by CodeRabbit

Release Notes

  • Fehlerbehebungen

    • Deep-Link-Navigation wird nach dem Laden von Dokumentationen korrekt wiederhergestellt und zum entsprechenden Abschnitt gescrollt
  • Neue Funktionen

    • Verbesserte Scroll-Position beim Anspringen von Überschriften für einheitliche Darstellung
    • Anker-Links zeigen beim Hover und Focus ein interaktives Kettensymbol mit angepassten Styling-Effekten

Review Change Stack

…anchor icons

Two related fixes for the long-form workflow pages (brownfield, spec-driven-development, brownfield-experiment-report, etc.):

1. Deep links like /brownfield#phase-0-5-socratic-code-theory-recovery
   landed on the page but did not scroll to the section. The pre-rendered
   HTML has the section IDs, so the browser jumps there initially — but
   then the SPA boots, doc-page.js replaces #doc-content with a fresh
   "Loading..." shell, and the scroll target is destroyed. After the
   async fragment fetch completes, we now re-scroll to the URL hash.

2. Asciidoctor already emits <a class="anchor" href="#id"> before each
   heading (sectanchors:true is set in render-docs.js), but the link was
   invisible. Add the AsciiDoc-standard § symbol that fades in on heading
   hover, so readers can grab a link to any section. scroll-margin-top
   keeps the heading from disappearing behind the sticky header when the
   user follows such a link.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 15, 2026

Caution

Review failed

Pull request was closed or merged during review

Walkthrough

Der PR erweitert die Dokumentationsseite mit Deep-Link-Navigationsunterstützung: Der geladene JavaScript-Code decodiert URL-Hash-Fragmente und scrollt die entsprechenden Überschriften nach dem Einfügen von Dokumentations-HTML in den Ansichtsbereich, während neue CSS-Regeln Anker mit konsistenten Scrollmargen und visuellen Hover-Effekten stylen.

Changes

Deep-Link Navigation und Anker-Styling

Layer / File(s) Zusammenfassung
Hash-basiertes Scrolling und Anker-Styling
website/src/components/doc-page.js, website/src/styles/main.css
Nach dem Laden der Dokumentations-HTML wird loadDocContent() die URL-Hash dekodiert, das Ziel-Element im DOM findet und mit scrollIntoView() anspringt. CSS-Regeln für h1h6 setzen scroll-margin-top, um konsistente Scrollpositionen zu erreichen. a.anchor-Links werden mit initialem Verbergen des §-Symbols, Sichtbarkeit bei Hover/Focus und entsprechenden Stiländerungen konfiguriert.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • LLM-Coding/Semantic-Anchors#200: Beide PRs passen die window.location.hash-Interaktion mit Scrolling an, indem das PR die Hash-Ziel-Scrolling nach dynamischem Einfügen von Dokumentations-HTML wiederherstellt, während die andere PR unbeabsichtigte Hash-getriebene Neurenderer beim Schließen des Anker-Modals verhindert.
  • LLM-Coding/Semantic-Anchors#114: Die loadDocContent()-Änderung in doc-page.js dieses PRs (Wiederherstellung von Hash-basiertem Deep-Linking nach Einfügen der Dokument-HTML) steht in direkter Verbindung zu dem abgerufenen PR, der die Dokument-Laden-Logik auf vorgerenderte .html-Dateien statt Client-seitiges AsciiDoc-Rendering umgestellt hat.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Der Titel fasst die zwei Hauptänderungen des Changesets präzise zusammen: Deep-Link-Scrolling-Wiederherstellung und AsciiDoc-Anker-Icons.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@rdmueller rdmueller merged commit 2b2c2bc into LLM-Coding:main May 15, 2026
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants