docs: Slash menu item grouping & ordering (BLO-1009)#2700
docs: Slash menu item grouping & ordering (BLO-1009)#2700matthewlipski wants to merge 3 commits intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (1)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughAdds a docs clarification for Slash Menu item ordering and grouping, plus a new interactive example that filters and reorders default Slash Menu groups (shows “Basic blocks” and “Headings” with ordering control). Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related issues
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@docs/content/docs/react/components/suggestion-menus.mdx`:
- Around line 106-109: The snippet assumes Heading 1 exists but findIndex can
return -1; update the logic around headingIndex (result of
getDefaultReactSlashMenuItems(...)) so you only call items.splice(headingIndex +
1, 0, insertHelloWorldItem(editor)) when headingIndex !== -1, and otherwise
append or insert the new item in a safe fallback location (e.g.,
items.push(insertHelloWorldItem(editor))) to avoid inserting at index 0
unexpectedly; reference getDefaultReactSlashMenuItems, headingIndex,
insertHelloWorldItem, and items.splice when making the change.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: e92bdd3f-96bb-4b90-a0a7-36038e3c43d1
📒 Files selected for processing (1)
docs/content/docs/react/components/suggestion-menus.mdx
@blocknote/ariakit
@blocknote/code-block
@blocknote/core
@blocknote/mantine
@blocknote/react
@blocknote/server-util
@blocknote/shadcn
@blocknote/xl-ai
@blocknote/xl-docx-exporter
@blocknote/xl-email-exporter
@blocknote/xl-multi-column
@blocknote/xl-odt-exporter
@blocknote/xl-pdf-exporter
commit: |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@examples/03-ui-components/19-suggestion-menus-grouping-ordering/index.html`:
- Line 1: Add the HTML5 doctype declaration before the root <html> element to
prevent quirks mode; update the top of the file so the very first line is the
doctype declaration (<!DOCTYPE html>) placed immediately before the existing
<html lang="en"> tag.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: db57bdae-3f9b-49fe-8ace-fd4c19e5094f
📒 Files selected for processing (10)
docs/content/docs/react/components/suggestion-menus.mdxexamples/03-ui-components/19-suggestion-menus-grouping-ordering/.bnexample.jsonexamples/03-ui-components/19-suggestion-menus-grouping-ordering/README.mdexamples/03-ui-components/19-suggestion-menus-grouping-ordering/index.htmlexamples/03-ui-components/19-suggestion-menus-grouping-ordering/main.tsxexamples/03-ui-components/19-suggestion-menus-grouping-ordering/package.jsonexamples/03-ui-components/19-suggestion-menus-grouping-ordering/src/App.tsxexamples/03-ui-components/19-suggestion-menus-grouping-ordering/tsconfig.jsonexamples/03-ui-components/19-suggestion-menus-grouping-ordering/vite.config.tsplayground/src/examples.gen.tsx
✅ Files skipped from review due to trivial changes (6)
- examples/03-ui-components/19-suggestion-menus-grouping-ordering/README.md
- examples/03-ui-components/19-suggestion-menus-grouping-ordering/.bnexample.json
- examples/03-ui-components/19-suggestion-menus-grouping-ordering/vite.config.ts
- examples/03-ui-components/19-suggestion-menus-grouping-ordering/main.tsx
- docs/content/docs/react/components/suggestion-menus.mdx
- examples/03-ui-components/19-suggestion-menus-grouping-ordering/tsconfig.json
Summary
This PR adds docs for how to group & order slash menu items, as well as an example which includes only the "Basic blocks" & "Headings" groups, which are swapped around from the default ordering.
Closes #2432
Rationale
This functionality is supported, but it's not immediately clear to developers how to actually do it.
Changes
Impact
N/A
Testing
N/A
Screenshots/Video
N/A
Checklist
Additional Notes
N/A
Summary by CodeRabbit