♿️(frontend) enable blocknote heading ids for toc anchors#2449
Conversation
31750f0 to
5a926bb
Compare
|
Size Change: +1 B (0%) Total Size: 4.34 MB 📦 View Changed
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (4)
WalkthroughThe PR enables BlockNote's native heading ID attribute by passing Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/frontend/apps/e2e/__tests__/app-impress/doc-table-content.spec.ts`:
- Around line 44-48: The current assertions for link1, link2, and link3 only
verify that their href attributes follow the fragment format pattern /^#.+/, but
do not validate that these fragments actually resolve to existing elements on
the page. Modify the test to extract the actual href value from each link
element and then verify that an element with the corresponding ID exists on the
page using the page locator, ensuring the anchor targets are real and functional
end-to-end.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: b3ac5839-1fba-48ef-96b2-816858c1bcac
📒 Files selected for processing (4)
CHANGELOG.mdsrc/frontend/apps/e2e/__tests__/app-impress/doc-table-content.spec.tssrc/frontend/apps/impress/src/features/docs/doc-editor/components/BlockNoteEditor.tsxsrc/frontend/apps/impress/src/features/docs/doc-table-content/components/Heading.tsx
| cellTextColor: true, | ||
| headers: true, | ||
| }, | ||
| setIdAttribute: true, |
Use setIdAttribute and link TOC entries to native block ids.
5a926bb to
09f9568
Compare
Purpose
Follow-up to #2390: complete table of contents anchor navigation by linking TOC entries to native BlockNote block
ids.replaced TOC
<button>entries with<a>links, buthref="#heading-{blockId}"had no matching target in the DOM. BlockNote suggested usingsetIdAttribute: trueinstead of manual DOM manipulation.Proposal
setIdAttribute: trueon BlockNote editor and readerhref="#{blockId}"(native block id)getElementById(blockId)instead of[data-id]doc-table-contente2e tests for newhrefformat