Skip to content

chore: Clean up custom components in examples (BLO-869)#2705

Open
matthewlipski wants to merge 1 commit intomainfrom
example-components-inline
Open

chore: Clean up custom components in examples (BLO-869)#2705
matthewlipski wants to merge 1 commit intomainfrom
example-components-inline

Conversation

@matthewlipski
Copy link
Copy Markdown
Collaborator

@matthewlipski matthewlipski commented May 4, 2026

Summary

This PR cleans up custom components in examples for UI elements. Specifically, any components passed to XYZControllers that are defined inline are extracted, e.g.

// Old
export function App() {
  ...

  return (
    <BlockNoteView ... >
      <FormattingToolbarController
        formattingToolbar={() => ...}
      </FormattingToolbarController>
    </BlockNoteView>
  )
}

// New
function CustomFormattingToolbar() {
  ...
}

export function App() {
  ...

  return (
    <BlockNoteView ... >
      <FormattingToolbarController
        formattingToolbar={CustomFormattingToolbar}
      </FormattingToolbarController>
    </BlockNoteView>
  )
}

Closes #941

Rationale

Makes things slightly more legible for people looking at examples in the docs.

Changes

See above.

Impact

N/A

Testing

N/A

Screenshots/Video

N/A

Checklist

  • Code follows the project's coding standards.
  • Unit tests covering the new feature have been added.
  • All existing tests pass.
  • The documentation has been updated to reflect the new feature

Additional Notes

N/A

Summary by CodeRabbit

  • Refactor
    • Reorganized UI component examples to use dedicated custom components instead of inline implementations for toolbars, menus, and editor controls across formatting, side menu, link toolbar, and AI features.
    • Improved component composition patterns throughout example applications.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 4, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
blocknote Ready Ready Preview May 4, 2026 4:27pm
blocknote-website Ready Ready Preview May 4, 2026 4:27pm

Request Review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 4, 2026

📝 Walkthrough

Walkthrough

This PR refactors UI component wiring across nine example applications. Inline render functions and wrapper components are replaced with dedicated components or helpers passed to controllers via props, consolidating component composition patterns.

Changes

UI Component Wiring Refactor

Layer / File(s) Summary
Component Extraction
examples/03-ui-components/02-formatting-toolbar-buttons/src/App.tsx, examples/03-ui-components/03-formatting-toolbar-block-type-items/src/App.tsx, examples/03-ui-components/04-side-menu-buttons/src/App.tsx, examples/03-ui-components/05-side-menu-drag-handle-items/src/App.tsx, examples/03-ui-components/11-uppy-file-panel/src/App.tsx, examples/03-ui-components/16-link-toolbar-buttons/src/App.tsx, examples/06-custom-schema/03-font-style/src/App.tsx, examples/06-custom-schema/05-alert-block-full-ux/src/App.tsx
New dedicated components (CustomFormattingToolbar, CustomSideMenu, CustomLinkToolbar, FormattingToolbarWithAI) are extracted to encapsulate toolbar/menu rendering logic with their button sets and custom items.
Controller Wiring
examples/03-ui-components/0[2-5]/src/App.tsx, examples/03-ui-components/11/src/App.tsx, examples/03-ui-components/16/src/App.tsx, examples/06-custom-schema/0[3,5]/src/App.tsx
Controllers (FormattingToolbarController, SideMenuController, LinkToolbarController) are updated to receive component references via props (e.g., formattingToolbar={CustomFormattingToolbar}) instead of inline render functions.
Helper Functions & Inline Controllers
examples/09-ai/0[1-7]/src/App.tsx
AI examples refactored to use SuggestionMenuController and FormattingToolbarController directly with new helper functions (getSlashMenuItemsWithAI()) that compose default and AI-enhanced menu items, replacing prior dedicated wrapper components.
Cleanup
examples/09-ai/0[1-7]/src/App.tsx
Old FormattingToolbarWithAI and SuggestionMenuWithAI wrapper component definitions removed; their functionality now provided by inline controllers and helper functions or extracted components.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Suggested reviewers

  • nperez0111

Poem

🐰 Components now stand tall and clear,
No more inline render functions here!
Controllers hold their props with care,
While helpers weave the AI air.
A cleaner view, refactored well—
BlockNote's toolbars now compel!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main refactoring: extracting and cleaning up custom components in example code files.
Description check ✅ Passed The description covers all major sections: summary with code examples, rationale, changes, impact, testing, and a relevant checklist with appropriate items marked.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch example-components-inline

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
Review rate limit: 6/8 reviews remaining, refill in 8 minutes and 48 seconds.

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

@matthewlipski matthewlipski requested a review from nperez0111 May 4, 2026 16:29
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 4, 2026

Open in StackBlitz

@blocknote/ariakit

npm i https://pkg.pr.new/@blocknote/ariakit@2705

@blocknote/code-block

npm i https://pkg.pr.new/@blocknote/code-block@2705

@blocknote/core

npm i https://pkg.pr.new/@blocknote/core@2705

@blocknote/mantine

npm i https://pkg.pr.new/@blocknote/mantine@2705

@blocknote/react

npm i https://pkg.pr.new/@blocknote/react@2705

@blocknote/server-util

npm i https://pkg.pr.new/@blocknote/server-util@2705

@blocknote/shadcn

npm i https://pkg.pr.new/@blocknote/shadcn@2705

@blocknote/xl-ai

npm i https://pkg.pr.new/@blocknote/xl-ai@2705

@blocknote/xl-docx-exporter

npm i https://pkg.pr.new/@blocknote/xl-docx-exporter@2705

@blocknote/xl-email-exporter

npm i https://pkg.pr.new/@blocknote/xl-email-exporter@2705

@blocknote/xl-multi-column

npm i https://pkg.pr.new/@blocknote/xl-multi-column@2705

@blocknote/xl-odt-exporter

npm i https://pkg.pr.new/@blocknote/xl-odt-exporter@2705

@blocknote/xl-pdf-exporter

npm i https://pkg.pr.new/@blocknote/xl-pdf-exporter@2705

commit: 0e7041d

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 7

🧹 Nitpick comments (1)
examples/03-ui-components/05-side-menu-drag-handle-items/src/App.tsx (1)

16-18: 💤 Low value

Update the inline comment to reflect that both components are now extracted.

The comment only mentions defining the drag handle menu in a separate component, but this PR also extracts CustomSideMenu for the same reason. Readers may miss the rationale for the outer component.

✏️ Suggested update
-// To avoid rendering issues, it's good practice to define your custom drag
-// handle menu in a separate component, instead of inline within the `sideMenu`
-// prop of `SideMenuController`.
+// To avoid rendering issues, it's good practice to define custom UI components
+// in separate functions rather than inline within controller props like
+// `SideMenuController`'s `sideMenu` prop.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@examples/03-ui-components/05-side-menu-drag-handle-items/src/App.tsx` around
lines 16 - 18, Update the inline comment so it explains that both
CustomDragHandleMenu and CustomSideMenu are extracted into separate components
to avoid rendering issues; find the comment near the SideMenuController usage
and replace the current note about only the drag handle with a concise line
stating that both the drag handle menu (CustomDragHandleMenu) and the outer side
menu (CustomSideMenu) are defined as separate components to prevent
re-rendering/mounting problems when used in the sideMenu prop of
SideMenuController.
🤖 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/11-uppy-file-panel/src/App.tsx`:
- Around line 19-23: The splice call uses items.findIndex((c) => c.key ===
"replaceFileButton") which can return -1 and cause Array.splice(-1, ...) to
replace the last toolbar item; change the logic to first store the result (e.g.,
const idx = items.findIndex(...)) and only call items.splice(idx, 1,
<FileReplaceButton key={"fileReplaceButton"} />) when idx !== -1 (no-op
otherwise) so you only replace when the "replaceFileButton" key actually exists.

In `@examples/09-ai/01-minimal/src/App.tsx`:
- Around line 102-117: Update the stale inline comments that say "(defined
below)" to "(defined above)" for the AI integrations inside the App component:
change the comments referencing FormattingToolbarWithAI and
getSlashMenuItemsWithAI to indicate they are defined above the App function
(they currently appear below the comment), and scan other modified files in this
PR for the same incorrect "(defined below)" phrasing and correct them to
"(defined above)" so documentation comments accurately point to the
function/component locations.

In `@examples/09-ai/02-playground/src/App.tsx`:
- Around line 146-150: The comment above FormattingToolbarController is stale —
it says "defined below" but FormattingToolbarWithAI is defined above App; update
the comment to reflect that (e.g., change "(defined below)" to "(defined above)"
or remove the parenthetical). Locate the comment near the
FormattingToolbarController usage and adjust the text so it correctly references
FormattingToolbarWithAI's actual position relative to App.

In `@examples/09-ai/03-custom-ai-menu-items/src/App.tsx`:
- Around line 145-149: The comment above the FormattingToolbarController
mentions "(defined below)" but FormattingToolbarWithAI is declared earlier;
update the comment near FormattingToolbarController (used in App) to either
remove the parenthetical or change it to "(defined above)" so it correctly
reflects that FormattingToolbarWithAI is defined above the App component; locate
references to FormattingToolbarController and FormattingToolbarWithAI to edit
that inline comment.

In `@examples/09-ai/04-with-collaboration/src/App.tsx`:
- Around line 195-199: Update the inline comment that says "(defined below)"
since FormattingToolbarWithAI is defined above App now; find the comment near
FormattingToolbarController and change the phrasing to reflect that the custom
toolbar (FormattingToolbarWithAI) is defined earlier (e.g., "(defined above)")
or remove the positional note, ensuring it references FormattingToolbarWithAI
and FormattingToolbarController so reviewers can locate it.

In `@examples/09-ai/06-client-side-transport/src/App.tsx`:
- Around line 116-120: Update the stale comment referencing the toolbar
placement: in the comment above FormattingToolbarController that mentions
"FormattingToolbarWithAI (defined below)", change the phrasing to reflect the
actual location (e.g., "(defined above)" or remove the parenthetical entirely)
so it correctly refers to the FormattingToolbarWithAI declaration now located
above the App component; locate the comment near the FormattingToolbarController
usage in the App component and adjust it accordingly.

In `@examples/09-ai/07-server-persistence/src/App.tsx`:
- Around line 131-135: Update the in-file comment that mentions the custom
toolbar location: change the phrase "(defined below)" to "(defined above)" (or
remove the location qualifier) to reflect that FormattingToolbarWithAI is
declared earlier in the file; look for the comment surrounding the
FormattingToolbarController usage and the symbol FormattingToolbarWithAI to make
the edit.

---

Nitpick comments:
In `@examples/03-ui-components/05-side-menu-drag-handle-items/src/App.tsx`:
- Around line 16-18: Update the inline comment so it explains that both
CustomDragHandleMenu and CustomSideMenu are extracted into separate components
to avoid rendering issues; find the comment near the SideMenuController usage
and replace the current note about only the drag handle with a concise line
stating that both the drag handle menu (CustomDragHandleMenu) and the outer side
menu (CustomSideMenu) are defined as separate components to prevent
re-rendering/mounting problems when used in the sideMenu prop of
SideMenuController.
🪄 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: 6dfd304d-5d65-4ece-a353-02c44f60c569

📥 Commits

Reviewing files that changed from the base of the PR and between d8c6b78 and 0e7041d.

📒 Files selected for processing (14)
  • examples/03-ui-components/02-formatting-toolbar-buttons/src/App.tsx
  • examples/03-ui-components/03-formatting-toolbar-block-type-items/src/App.tsx
  • examples/03-ui-components/04-side-menu-buttons/src/App.tsx
  • examples/03-ui-components/05-side-menu-drag-handle-items/src/App.tsx
  • examples/03-ui-components/11-uppy-file-panel/src/App.tsx
  • examples/03-ui-components/16-link-toolbar-buttons/src/App.tsx
  • examples/06-custom-schema/03-font-style/src/App.tsx
  • examples/06-custom-schema/05-alert-block-full-ux/src/App.tsx
  • examples/09-ai/01-minimal/src/App.tsx
  • examples/09-ai/02-playground/src/App.tsx
  • examples/09-ai/03-custom-ai-menu-items/src/App.tsx
  • examples/09-ai/04-with-collaboration/src/App.tsx
  • examples/09-ai/06-client-side-transport/src/App.tsx
  • examples/09-ai/07-server-persistence/src/App.tsx

Comment on lines +19 to +23
items.splice(
items.findIndex((c) => c.key === "replaceFileButton"),
1,
<FileReplaceButton key={"fileReplaceButton"} />,
);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

findIndex returning -1 causes the last toolbar item to be silently replaced.

When "replaceFileButton" is absent from the items array (e.g., the cursor is on a paragraph or heading block rather than a file/image block), findIndex returns -1. Array.prototype.splice(-1, 1, …) interprets -1 as the last index, so the last toolbar item is removed and <FileReplaceButton /> is inserted in its place instead.

🐛 Proposed fix — guard against missing key
-  items.splice(
-    items.findIndex((c) => c.key === "replaceFileButton"),
-    1,
-    <FileReplaceButton key={"fileReplaceButton"} />,
-  );
+  const replaceIdx = items.findIndex((c) => c.key === "replaceFileButton");
+  if (replaceIdx !== -1) {
+    items.splice(replaceIdx, 1, <FileReplaceButton key={"fileReplaceButton"} />);
+  }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
items.splice(
items.findIndex((c) => c.key === "replaceFileButton"),
1,
<FileReplaceButton key={"fileReplaceButton"} />,
);
const replaceIdx = items.findIndex((c) => c.key === "replaceFileButton");
if (replaceIdx !== -1) {
items.splice(replaceIdx, 1, <FileReplaceButton key={"fileReplaceButton"} />);
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@examples/03-ui-components/11-uppy-file-panel/src/App.tsx` around lines 19 -
23, The splice call uses items.findIndex((c) => c.key === "replaceFileButton")
which can return -1 and cause Array.splice(-1, ...) to replace the last toolbar
item; change the logic to first store the result (e.g., const idx =
items.findIndex(...)) and only call items.splice(idx, 1, <FileReplaceButton
key={"fileReplaceButton"} />) when idx !== -1 (no-op otherwise) so you only
replace when the "replaceFileButton" key actually exists.

Comment on lines +102 to +117
{/* We disabled the default formatting toolbar with `formattingToolbar=false`
and replace it for one with an "AI button" (defined below).
(See "Formatting Toolbar" in docs)
*/}
<FormattingToolbarWithAI />
<FormattingToolbarController formattingToolbar={FormattingToolbarWithAI} />

{/* We disabled the default SlashMenu with `slashMenu=false`
and replace it for one with an AI option (defined below).
{/* We disabled the default SlashMenu with `slashMenu=false`
and replace it for one with an AI option (defined below).
(See "Suggestion Menus" in docs)
*/}
<SuggestionMenuWithAI editor={editor} />
<SuggestionMenuController
triggerCharacter="/"
getItems={async (query) =>
filterSuggestionItems(getSlashMenuItemsWithAI(editor), query)
}
/>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Stale (defined below) references in both comments — direction is now inverted.

Both FormattingToolbarWithAI (line 31) and getSlashMenuItemsWithAI (line 40) are defined above the App function. The new comments still say (defined below) for each, which will mislead doc readers looking in the wrong direction. The same applies to all other files changed in this PR.

✏️ Proposed fix
-        {/* We disabled the default formatting toolbar with `formattingToolbar=false`
-        and replace it for one with an "AI button" (defined below).
+        {/* We disabled the default formatting toolbar with `formattingToolbar=false`
+        and replace it for one with an "AI button" (defined above).
         (See "Formatting Toolbar" in docs)
         */}
-        {/* We disabled the default SlashMenu with `slashMenu=false`
-        and replace it for one with an AI option (defined below).
+        {/* We disabled the default SlashMenu with `slashMenu=false`
+        and replace it for one with an AI option (defined above).
         (See "Suggestion Menus" in docs)
         */}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{/* We disabled the default formatting toolbar with `formattingToolbar=false`
and replace it for one with an "AI button" (defined below).
(See "Formatting Toolbar" in docs)
*/}
<FormattingToolbarWithAI />
<FormattingToolbarController formattingToolbar={FormattingToolbarWithAI} />
{/* We disabled the default SlashMenu with `slashMenu=false`
and replace it for one with an AI option (defined below).
{/* We disabled the default SlashMenu with `slashMenu=false`
and replace it for one with an AI option (defined below).
(See "Suggestion Menus" in docs)
*/}
<SuggestionMenuWithAI editor={editor} />
<SuggestionMenuController
triggerCharacter="/"
getItems={async (query) =>
filterSuggestionItems(getSlashMenuItemsWithAI(editor), query)
}
/>
{/* We disabled the default formatting toolbar with `formattingToolbar=false`
and replace it for one with an "AI button" (defined above).
(See "Formatting Toolbar" in docs)
*/}
<FormattingToolbarController formattingToolbar={FormattingToolbarWithAI} />
{/* We disabled the default SlashMenu with `slashMenu=false`
and replace it for one with an AI option (defined above).
(See "Suggestion Menus" in docs)
*/}
<SuggestionMenuController
triggerCharacter="/"
getItems={async (query) =>
filterSuggestionItems(getSlashMenuItemsWithAI(editor), query)
}
/>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@examples/09-ai/01-minimal/src/App.tsx` around lines 102 - 117, Update the
stale inline comments that say "(defined below)" to "(defined above)" for the AI
integrations inside the App component: change the comments referencing
FormattingToolbarWithAI and getSlashMenuItemsWithAI to indicate they are defined
above the App function (they currently appear below the comment), and scan other
modified files in this PR for the same incorrect "(defined below)" phrasing and
correct them to "(defined above)" so documentation comments accurately point to
the function/component locations.

Comment on lines +146 to +150
{/* We disabled the default formatting toolbar with `formattingToolbar=false`
and replace it for one with an "AI button" (defined below).
(See "Formatting Toolbar" in docs)
*/}
<FormattingToolbarWithAI />
<FormattingToolbarController formattingToolbar={FormattingToolbarWithAI} />
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Stale (defined below) in the changed toolbar comment.

FormattingToolbarWithAI is now defined at line 37, above App. The updated comment at line 147 still says (defined below).

✏️ Proposed fix
-        {/* We disabled the default formatting toolbar with `formattingToolbar=false`
-        and replace it for one with an "AI button" (defined below).
+        {/* We disabled the default formatting toolbar with `formattingToolbar=false`
+        and replace it for one with an "AI button" (defined above).
         (See "Formatting Toolbar" in docs)
         */}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{/* We disabled the default formatting toolbar with `formattingToolbar=false`
and replace it for one with an "AI button" (defined below).
(See "Formatting Toolbar" in docs)
*/}
<FormattingToolbarWithAI />
<FormattingToolbarController formattingToolbar={FormattingToolbarWithAI} />
{/* We disabled the default formatting toolbar with `formattingToolbar=false`
and replace it for one with an "AI button" (defined above).
(See "Formatting Toolbar" in docs)
*/}
<FormattingToolbarController formattingToolbar={FormattingToolbarWithAI} />
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@examples/09-ai/02-playground/src/App.tsx` around lines 146 - 150, The comment
above FormattingToolbarController is stale — it says "defined below" but
FormattingToolbarWithAI is defined above App; update the comment to reflect that
(e.g., change "(defined below)" to "(defined above)" or remove the
parenthetical). Locate the comment near the FormattingToolbarController usage
and adjust the text so it correctly references FormattingToolbarWithAI's actual
position relative to App.

Comment on lines +145 to +149
{/* We disabled the default formatting toolbar with `formattingToolbar=false`
and replace it for one with an "AI button" (defined below).
(See "Formatting Toolbar" in docs)
*/}
<FormattingToolbarWithAI />
<FormattingToolbarController formattingToolbar={FormattingToolbarWithAI} />
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Stale (defined below) in the changed toolbar comment.

FormattingToolbarWithAI is now at line 77, above App. Line 146 still says (defined below).

✏️ Proposed fix
-        {/* We disabled the default formatting toolbar with `formattingToolbar=false`
-        and replace it for one with an "AI button" (defined below).
+        {/* We disabled the default formatting toolbar with `formattingToolbar=false`
+        and replace it for one with an "AI button" (defined above).
         (See "Formatting Toolbar" in docs)
         */}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{/* We disabled the default formatting toolbar with `formattingToolbar=false`
and replace it for one with an "AI button" (defined below).
(See "Formatting Toolbar" in docs)
*/}
<FormattingToolbarWithAI />
<FormattingToolbarController formattingToolbar={FormattingToolbarWithAI} />
{/* We disabled the default formatting toolbar with `formattingToolbar=false`
and replace it for one with an "AI button" (defined above).
(See "Formatting Toolbar" in docs)
*/}
<FormattingToolbarController formattingToolbar={FormattingToolbarWithAI} />
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@examples/09-ai/03-custom-ai-menu-items/src/App.tsx` around lines 145 - 149,
The comment above the FormattingToolbarController mentions "(defined below)" but
FormattingToolbarWithAI is declared earlier; update the comment near
FormattingToolbarController (used in App) to either remove the parenthetical or
change it to "(defined above)" so it correctly reflects that
FormattingToolbarWithAI is defined above the App component; locate references to
FormattingToolbarController and FormattingToolbarWithAI to edit that inline
comment.

Comment on lines +195 to +199
{/* We disabled the default formatting toolbar with `formattingToolbar=false`
and replace it for one with an "AI button" (defined below).
(See "Formatting Toolbar" in docs)
*/}
<FormattingToolbarWithAI />
<FormattingToolbarController formattingToolbar={FormattingToolbarWithAI} />
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Stale (defined below) in the changed toolbar comment.

FormattingToolbarWithAI is now at line 62, above App. Line 196 still says (defined below).

✏️ Proposed fix
-        {/* We disabled the default formatting toolbar with `formattingToolbar=false`
-        and replace it for one with an "AI button" (defined below).
+        {/* We disabled the default formatting toolbar with `formattingToolbar=false`
+        and replace it for one with an "AI button" (defined above).
         (See "Formatting Toolbar" in docs)
         */}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{/* We disabled the default formatting toolbar with `formattingToolbar=false`
and replace it for one with an "AI button" (defined below).
(See "Formatting Toolbar" in docs)
*/}
<FormattingToolbarWithAI />
<FormattingToolbarController formattingToolbar={FormattingToolbarWithAI} />
{/* We disabled the default formatting toolbar with `formattingToolbar=false`
and replace it for one with an "AI button" (defined above).
(See "Formatting Toolbar" in docs)
*/}
<FormattingToolbarController formattingToolbar={FormattingToolbarWithAI} />
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@examples/09-ai/04-with-collaboration/src/App.tsx` around lines 195 - 199,
Update the inline comment that says "(defined below)" since
FormattingToolbarWithAI is defined above App now; find the comment near
FormattingToolbarController and change the phrasing to reflect that the custom
toolbar (FormattingToolbarWithAI) is defined earlier (e.g., "(defined above)")
or remove the positional note, ensuring it references FormattingToolbarWithAI
and FormattingToolbarController so reviewers can locate it.

Comment on lines +116 to +120
{/* We disabled the default formatting toolbar with `formattingToolbar=false`
and replace it for one with an "AI button" (defined below).
(See "Formatting Toolbar" in docs)
*/}
<FormattingToolbarWithAI />
<FormattingToolbarController formattingToolbar={FormattingToolbarWithAI} />
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Stale (defined below) in the changed toolbar comment.

FormattingToolbarWithAI is now at line 32, above App. Line 117 still says (defined below).

✏️ Proposed fix
-        {/* We disabled the default formatting toolbar with `formattingToolbar=false`
-        and replace it for one with an "AI button" (defined below).
+        {/* We disabled the default formatting toolbar with `formattingToolbar=false`
+        and replace it for one with an "AI button" (defined above).
         (See "Formatting Toolbar" in docs)
         */}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{/* We disabled the default formatting toolbar with `formattingToolbar=false`
and replace it for one with an "AI button" (defined below).
(See "Formatting Toolbar" in docs)
*/}
<FormattingToolbarWithAI />
<FormattingToolbarController formattingToolbar={FormattingToolbarWithAI} />
{/* We disabled the default formatting toolbar with `formattingToolbar=false`
and replace it for one with an "AI button" (defined above).
(See "Formatting Toolbar" in docs)
*/}
<FormattingToolbarController formattingToolbar={FormattingToolbarWithAI} />
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@examples/09-ai/06-client-side-transport/src/App.tsx` around lines 116 - 120,
Update the stale comment referencing the toolbar placement: in the comment above
FormattingToolbarController that mentions "FormattingToolbarWithAI (defined
below)", change the phrasing to reflect the actual location (e.g., "(defined
above)" or remove the parenthetical entirely) so it correctly refers to the
FormattingToolbarWithAI declaration now located above the App component; locate
the comment near the FormattingToolbarController usage in the App component and
adjust it accordingly.

Comment on lines +131 to +135
{/* We disabled the default formatting toolbar with `formattingToolbar=false`
and replace it for one with an "AI button" (defined below).
(See "Formatting Toolbar" in docs)
*/}
<FormattingToolbarWithAI />
<FormattingToolbarController formattingToolbar={FormattingToolbarWithAI} />
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Stale (defined below) in the changed toolbar comment.

FormattingToolbarWithAI is now at line 30, above App. Line 132 still says (defined below).

✏️ Proposed fix
-        {/* We disabled the default formatting toolbar with `formattingToolbar=false`
-        and replace it for one with an "AI button" (defined below).
+        {/* We disabled the default formatting toolbar with `formattingToolbar=false`
+        and replace it for one with an "AI button" (defined above).
         (See "Formatting Toolbar" in docs)
         */}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@examples/09-ai/07-server-persistence/src/App.tsx` around lines 131 - 135,
Update the in-file comment that mentions the custom toolbar location: change the
phrase "(defined below)" to "(defined above)" (or remove the location qualifier)
to reflect that FormattingToolbarWithAI is declared earlier in the file; look
for the comment surrounding the FormattingToolbarController usage and the symbol
FormattingToolbarWithAI to make the edit.

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.

Clean up inline components in examples

1 participant