fix: correctly parse and route absolute anchor URLs in Interactive Book#557
fix: correctly parse and route absolute anchor URLs in Interactive Book#557RAJEEVTIWARI8052 wants to merge 3 commits intoCircuitVerse:masterfrom
Conversation
✅ Deploy Preview for cv-mobile-app-web ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
WalkthroughThe change updates Suggested labels
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
RAJEEVTIWARI8052
left a comment
There was a problem hiding this comment.
i have resolved the issue raised
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: fedeb22d-dfe5-49e0-bcd8-5e219816b655
⛔ Files ignored due to path filters (1)
pubspec.lockis excluded by!**/*.lock
📒 Files selected for processing (2)
lib/ui/views/ib/ib_page_view.dartpubspec.yaml
✅ Files skipped from review due to trivial changes (1)
- pubspec.yaml
|
Hey @JatsuAkaYashvant I have pushed the fixes for this issue. Could you please take a look when you have a free moment? Thanks! |
Fixes #556
###changes made in this PR:
startsWith) with robustUriparsing and path normalization in lib/ui/views/ib/ib_page_view.dart.Uri.decodeComponentextraction for internal Markdown anchor fragments (#) instead of incorrectly truncating the absolute URL string (href.substring(1)).isSameDocumentchecks and explicitly returning out of the logic blocks to satisfy static analysis and automated PR bot feedback.Why these changes were necessary:
The previous Interactive Book routing logic incorrectly assumed that any absolute URL corresponding to the current document could simply have its first character stripped (
href.substring(1)). This meant any internal same-page anchor link would be resolved to an invalid slug (e.g.,ttps://learn.circuitverse...) and fail to scroll. Furthermore, thestartsWithlogic suffered from prefix fallback errors (where/chapter-1could incorrectly flag/chapter-10as a self-link). By parsing the exact URI schemes, paths, and fragment identifiers, all Interactive Book navigation correctly scopes and scrolls precisely to specific headings.