Skip to content

bump tiptap editor#295

Merged
softmarshmallow merged 1 commit intomainfrom
modules/tiptap
Apr 18, 2025
Merged

bump tiptap editor#295
softmarshmallow merged 1 commit intomainfrom
modules/tiptap

Conversation

@softmarshmallow
Copy link
Member

@softmarshmallow softmarshmallow commented Apr 18, 2025

Summary by CodeRabbit

  • New Features

    • Added a new rich text editor component to the UI, now accessible below the tags section with enhanced tooltip support.
    • Enabled code block editing support within the editor.
  • Bug Fixes

    • Improved image upload and loading feedback in the editor, and enhanced image element attributes for better accessibility.
  • Style

    • Applied consistent formatting, quote usage, and semicolon placement across all editor components and styles.
    • Improved CSS for strike-through text and attribute selectors.
  • Documentation

    • Updated documentation to reflect the latest synchronization status with the upstream editor kit.
  • Chores

    • Upgraded editor dependencies to the latest versions and updated package configuration.

@codesandbox
Copy link

codesandbox bot commented Apr 18, 2025

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

@vercel
Copy link

vercel bot commented Apr 18, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
blog ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 18, 2025 8:52am
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 18, 2025 8:52am
grida 🔄 Building (Inspect) Visit Preview 💬 Add feedback Apr 18, 2025 8:52am
legacy-www ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 18, 2025 8:52am
5 Skipped Deployments
Name Status Preview Comments Updated (UTC)
code ⬜️ Ignored (Inspect) Apr 18, 2025 8:52am
legacy ⬜️ Ignored (Inspect) Apr 18, 2025 8:52am
backgrounds ⬜️ Skipped (Inspect) Apr 18, 2025 8:52am
sites ⬜️ Skipped (Inspect) Apr 18, 2025 8:52am
viewer ⬜️ Skipped (Inspect) Apr 18, 2025 8:52am

@coderabbitai
Copy link

coderabbitai bot commented Apr 18, 2025

Walkthrough

This update introduces a new rich text editor component to the development UI page and re-enables code block functionality in the minimal tiptap editor kit. The package dependencies for @tiptap libraries are upgraded, and new dependencies for code block highlighting are added. Numerous files across the editor kit are reformatted for consistent code style, including switching to double quotes, adding semicolons, and improving readability. Several import paths for utility functions are updated. The code block extension is uncommented and made active throughout the kit, and minor logic improvements are made to certain components, notably in image view handling and selection decorations. No breaking changes to exported APIs are introduced.

Changes

File(s) Change Summary
editor/app/(dev)/ui/page.tsx Adds __RichTextEditor component and wraps AllComponentsPage in TooltipProvider, introducing a new rich text editor to the UI page.
editor/package.json Upgrades @tiptap dependencies to 2.11.7, adds @tiptap/extension-code-block-lowlight and lowlight, and removes pnpm overrides.
editor/kits/minimal-tiptap/README.md Appends last sync hash to document synchronization with upstream.
editor/kits/minimal-tiptap/components/section/five.tsx Uncomments code block action and LinkEditPopover in the section toolbar.
editor/kits/minimal-tiptap/hooks/use-minimal-tiptap.ts Re-enables CodeBlockLowlight extension in the editor.
editor/kits/minimal-tiptap/extensions/code-block-lowlight/code-block-lowlight.ts Removes enclosing comment, switches to double quotes, and reformats code.
editor/kits/minimal-tiptap/extensions/code-block-lowlight/index.ts Uncommented and reformatted export statement.
editor/kits/minimal-tiptap/extensions/index.ts Re-enables export of code block lowlight extension.
editor/kits/minimal-tiptap/components/image/image-edit-block.tsx
.../image-edit-dialog.tsx
.../section/four.tsx
.../section/three.tsx
.../section/two.tsx
.../extensions/file-handler/index.ts
.../extensions/image/hooks/use-drag-resize.ts
.../extensions/image/hooks/use-image-actions.ts
.../hooks/use-container-size.ts
.../hooks/use-theme.ts
.../hooks/use-throttle.ts
.../types.ts
Applies code style improvements: switches to double quotes, adds semicolons, and improves formatting for consistency and readability.
editor/kits/minimal-tiptap/components/bubble-menu/link-bubble-menu.tsx Adds explicit checks in shouldShow callback and applies code style updates.
editor/kits/minimal-tiptap/components/section/one.tsx Updates cn import path and refines type annotation for TextStyle.element.
editor/kits/minimal-tiptap/components/link/link-edit-block.tsx
.../shortcut-key.tsx
.../spinner.tsx
.../toolbar-button.tsx
.../toolbar-section.tsx
.../extensions/image/components/image-actions.tsx
.../extensions/image/components/image-overlay.tsx
.../extensions/image/components/resize-handle.tsx
Updates cn utility import path from "@/utils" to "@/utils/cn".
editor/kits/minimal-tiptap/extensions/color/color.ts
.../color/index.ts
.../horizontal-rule/horizontal-rule.ts
.../horizontal-rule/index.ts
.../link/index.ts
.../link/link.ts
.../reset-marks-on-enter/index.ts
.../reset-marks-on-enter/reset-marks-on-enter.ts
.../selection/index.ts
.../selection/selection.ts
.../unset-all-marks/index.ts
.../unset-all-marks/unset-all-marks.ts
Applies code style changes: switches to double quotes, adds semicolons, and improves formatting in extension files.
editor/kits/minimal-tiptap/extensions/image/components/image-view-block.tsx Updates cn import, removes error logging, refines loading UI logic, removes ESLint comment, and adds title/id to <img>.
editor/kits/minimal-tiptap/styles/index.css Switches import statements to double quotes and adds explicit styling for .ProseMirror s span.
editor/kits/minimal-tiptap/styles/partials/zoom.css Changes attribute selector quotes from single to double in CSS.
editor/kits/minimal-tiptap/utils.ts Applies code style improvements and minor logic refinement in getOutput.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant AllComponentsPage
  participant TooltipProvider
  participant __Tags
  participant __RichTextEditor
  participant MinimalTiptapEditor

  User->>AllComponentsPage: Load page
  AllComponentsPage->>TooltipProvider: Wraps content
  TooltipProvider->>__Tags: Render tags component
  TooltipProvider->>__RichTextEditor: Render new editor
  __RichTextEditor->>MinimalTiptapEditor: Render editor instance
Loading
sequenceDiagram
  participant MinimalTiptapEditor
  participant CodeBlockLowlight
  participant User

  User->>MinimalTiptapEditor: Types or interacts with editor
  MinimalTiptapEditor->>CodeBlockLowlight: Handles code block formatting and highlighting
Loading

Poem

In fields of code where tiptap grows,
New blocks of code now brightly glow.
With double quotes and lines aligned,
The rabbit hops, improvements find.
A rich text patch, a shining view—
The editor’s garden feels brand new!
🐇✨

Tip

⚡💬 Agentic Chat (Pro Plan, General Availability)
  • We're introducing multi-step agentic chat in review comments and issue comments, within and outside of PR's. This feature enhances review and issue discussions with the CodeRabbit agentic chat by enabling advanced interactions, including the ability to create pull requests directly from comments and add commits to existing pull requests.
✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@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: 1

🧹 Nitpick comments (1)
editor/kits/minimal-tiptap/components/bubble-menu/link-bubble-menu.tsx (1)

77-81: Consider adding a success indicator for link operations

While the link setting logic works correctly, consider adding a success toast or visual indicator when a link is successfully added or modified to improve user feedback.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between dbccfe5 and 173f3e1.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (46)
  • editor/app/(dev)/ui/page.tsx (2 hunks)
  • editor/kits/minimal-tiptap/README.md (1 hunks)
  • editor/kits/minimal-tiptap/components/bubble-menu/link-bubble-menu.tsx (1 hunks)
  • editor/kits/minimal-tiptap/components/image/image-edit-block.tsx (3 hunks)
  • editor/kits/minimal-tiptap/components/image/image-edit-dialog.tsx (2 hunks)
  • editor/kits/minimal-tiptap/components/link/link-edit-block.tsx (1 hunks)
  • editor/kits/minimal-tiptap/components/section/five.tsx (2 hunks)
  • editor/kits/minimal-tiptap/components/section/four.tsx (2 hunks)
  • editor/kits/minimal-tiptap/components/section/one.tsx (2 hunks)
  • editor/kits/minimal-tiptap/components/section/three.tsx (4 hunks)
  • editor/kits/minimal-tiptap/components/section/two.tsx (2 hunks)
  • editor/kits/minimal-tiptap/components/shortcut-key.tsx (1 hunks)
  • editor/kits/minimal-tiptap/components/spinner.tsx (1 hunks)
  • editor/kits/minimal-tiptap/components/toolbar-button.tsx (1 hunks)
  • editor/kits/minimal-tiptap/components/toolbar-section.tsx (1 hunks)
  • editor/kits/minimal-tiptap/extensions/code-block-lowlight/code-block-lowlight.ts (2 hunks)
  • editor/kits/minimal-tiptap/extensions/code-block-lowlight/index.ts (1 hunks)
  • editor/kits/minimal-tiptap/extensions/color/color.ts (1 hunks)
  • editor/kits/minimal-tiptap/extensions/color/index.ts (1 hunks)
  • editor/kits/minimal-tiptap/extensions/file-handler/index.ts (1 hunks)
  • editor/kits/minimal-tiptap/extensions/horizontal-rule/horizontal-rule.ts (1 hunks)
  • editor/kits/minimal-tiptap/extensions/horizontal-rule/index.ts (1 hunks)
  • editor/kits/minimal-tiptap/extensions/image/components/image-actions.tsx (1 hunks)
  • editor/kits/minimal-tiptap/extensions/image/components/image-overlay.tsx (1 hunks)
  • editor/kits/minimal-tiptap/extensions/image/components/image-view-block.tsx (3 hunks)
  • editor/kits/minimal-tiptap/extensions/image/components/resize-handle.tsx (1 hunks)
  • editor/kits/minimal-tiptap/extensions/image/hooks/use-drag-resize.ts (3 hunks)
  • editor/kits/minimal-tiptap/extensions/image/hooks/use-image-actions.ts (1 hunks)
  • editor/kits/minimal-tiptap/extensions/index.ts (1 hunks)
  • editor/kits/minimal-tiptap/extensions/link/index.ts (1 hunks)
  • editor/kits/minimal-tiptap/extensions/link/link.ts (2 hunks)
  • editor/kits/minimal-tiptap/extensions/reset-marks-on-enter/index.ts (1 hunks)
  • editor/kits/minimal-tiptap/extensions/reset-marks-on-enter/reset-marks-on-enter.ts (1 hunks)
  • editor/kits/minimal-tiptap/extensions/selection/index.ts (1 hunks)
  • editor/kits/minimal-tiptap/extensions/selection/selection.ts (1 hunks)
  • editor/kits/minimal-tiptap/extensions/unset-all-marks/index.ts (1 hunks)
  • editor/kits/minimal-tiptap/extensions/unset-all-marks/unset-all-marks.ts (1 hunks)
  • editor/kits/minimal-tiptap/hooks/use-container-size.ts (2 hunks)
  • editor/kits/minimal-tiptap/hooks/use-minimal-tiptap.ts (2 hunks)
  • editor/kits/minimal-tiptap/hooks/use-theme.ts (1 hunks)
  • editor/kits/minimal-tiptap/hooks/use-throttle.ts (1 hunks)
  • editor/kits/minimal-tiptap/styles/index.css (2 hunks)
  • editor/kits/minimal-tiptap/styles/partials/zoom.css (2 hunks)
  • editor/kits/minimal-tiptap/types.ts (1 hunks)
  • editor/kits/minimal-tiptap/utils.ts (2 hunks)
  • editor/package.json (3 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (2)
editor/kits/minimal-tiptap/extensions/file-handler/index.ts (2)
editor/kits/minimal-tiptap/utils.ts (3)
  • FileError (9-12)
  • FileValidationOptions (14-18)
  • filterFiles (201-231)
editor/kits/minimal-tiptap/hooks/use-minimal-tiptap.ts (1)
  • onValidationError (79-87)
editor/kits/minimal-tiptap/hooks/use-minimal-tiptap.ts (1)
editor/kits/minimal-tiptap/extensions/code-block-lowlight/code-block-lowlight.ts (1)
  • CodeBlockLowlight (4-15)
🪛 Biome (1.9.4)
editor/kits/minimal-tiptap/utils.ts

[error] 187-188: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

🔇 Additional comments (82)
editor/kits/minimal-tiptap/extensions/unset-all-marks/index.ts (1)

1-1: Align string quotes with project style

Switched to double quotes to maintain consistency across the codebase; there’s no functional impact.

editor/kits/minimal-tiptap/extensions/horizontal-rule/index.ts (1)

1-1: Consistent Export Quotes: Updated to use double quotes in the export path for stylistic consistency with the rest of the minimal-tiptap kit. No functional change introduced.

editor/kits/minimal-tiptap/extensions/selection/index.ts (1)

1-1: Consistent Export Quotes: Switched to double quotes for the export statement to align with the project’s formatting conventions. Functionality remains unchanged.

editor/kits/minimal-tiptap/extensions/unset-all-marks/unset-all-marks.ts (1)

6-7: Stylistic Formatting Only: Changed string literal to double quotes and added a trailing comma in the returned object. There is no change in logic or behavior of the Mod-\ keyboard shortcut.

editor/kits/minimal-tiptap/styles/index.css (2)

1-5: Consistent Import Quotes: Switched the @import statements to use double quotes for consistency with the codebase style. No functional impact.


176-178: Add Strikethrough Span Styling: Introduces a rule to apply line-through to spans within <s> tags in the editor. Verify that this selector matches the rendered DOM and does not conflict with other text-decoration styles.

editor/package.json (3)

76-90: Dependency Bumps and Additions Look Good: All @tiptap/* packages have been updated to ^2.11.7 and the @tiptap/extension-code-block-lowlight along with lowlight have been added. This aligns with the PR objective to re-enable code block highlighting.


243-244: Review pnpm Overrides Removal: The overrides section was cleared. Please confirm that no conflicting versions of prosemirror-model or prosemirror-view are introduced by this change.


76-90:

Details

✅ Verification successful

Verify CodeBlockLowlight Integration: Ensure the newly added @tiptap/extension-code-block-lowlight is correctly imported and invoked in your minimal-tiptap setup. You can run this script to confirm its usage:


🏁 Script executed:

#!/bin/bash
# Verify CodeBlockLowlight usage in minimal-tiptap hook
rg -n "CodeBlockLowlight" -A 2

Length of output: 1387


Integration Confirmed: CodeBlockLowlight is correctly configured

  • editor/kits/minimal-tiptap/extensions/code-block-lowlight/code-block-lowlight.ts imports and extends TiptapCodeBlockLowlight from @tiptap/extension-code-block-lowlight.
  • editor/kits/minimal-tiptap/hooks/use-minimal-tiptap.ts includes CodeBlockLowlight in the extensions array (lines 14 and 152).

No further changes required.

editor/kits/minimal-tiptap/extensions/image/components/image-overlay.tsx (1)

3-3: Consistent import for cn utility
The import path has been updated to "@/utils/cn" to match the standardized location of the cn helper. This change aligns with other components and has no adverse effects.

editor/kits/minimal-tiptap/components/toolbar-button.tsx (1)

9-9: Standardize cn utility import
Switching the import to "@/utils/cn" ensures uniform access to the cn helper across the minimal-tiptap kit. No functional changes here.

editor/kits/minimal-tiptap/components/link/link-edit-block.tsx (1)

6-6: Align cn import path
Updated to import cn from "@/utils/cn" for consistency with the rest of the codebase. The change is purely structural.

editor/kits/minimal-tiptap/extensions/image/components/image-actions.tsx (1)

7-7: Import path update for cn helper
Changed to "@/utils/cn" to standardize the utility import across components. No logic alterations introduced.

editor/kits/minimal-tiptap/components/spinner.tsx (1)

1-1: Correct cn utility import
The import has been redirected to "@/utils/cn", ensuring consistency with other modules that consume the cn function. All behavior remains unchanged.

editor/kits/minimal-tiptap/extensions/image/components/resize-handle.tsx (1)

2-2: Consistent utility import path
Updated the cn import to "@/utils/cn" to align with the standardized import location used across the minimal‑tiptap kit.

editor/kits/minimal-tiptap/extensions/color/index.ts (1)

1-1: Stylistic update only
Changed the comment to use double quotes. This is a non‑functional formatting change.

editor/kits/minimal-tiptap/extensions/link/index.ts (1)

1-1: Stylistic consistency
Standardized the export statement to use double quotes. No behavior change.

editor/kits/minimal-tiptap/components/toolbar-section.tsx (1)

6-6: Consistent utility import path
Refactored the cn import to "@/utils/cn" for uniformity with other components.

editor/kits/minimal-tiptap/components/shortcut-key.tsx (1)

2-2: Align import path with conventions
Updated the cn utility import to "@/utils/cn" to maintain consistency across the kit.

editor/kits/minimal-tiptap/extensions/reset-marks-on-enter/index.ts (1)

1-1: Stylistic consistency: standardized quotes.
Switched to double quotes for the export path to align with the project’s code style. No functional change introduced.

editor/kits/minimal-tiptap/README.md (1)

2-5: Documentation update: added upstream sync hash.
Appended the “last sync hash” reference (Aslam97/shadcn-minimal-tiptap@0c58459) for traceability with the original repo. Purely informational; no code impact.

editor/kits/minimal-tiptap/extensions/index.ts (1)

1-1: Re-enable code-block-lowlight export.
Uncommenting this line exposes the code-block-lowlight extension in the public API. Ensure that the corresponding dependency (@tiptap/extension-code-block-lowlight) is present and up‑to‑date in package.json.

editor/kits/minimal-tiptap/extensions/code-block-lowlight/index.ts (1)

1-1: Activate code-block-lowlight module.
Uncommented and switched to double quotes to export the extension from this index. Verify that code-block-lowlight.ts builds correctly and matches the updated package version.

editor/kits/minimal-tiptap/hooks/use-theme.ts (4)

1-1: Import formatting standardized.
Replaced single quotes with double quotes and added a semicolon for consistency. No change in module resolution or behavior.


4-4: State initialization formatting.
Added semicolon and applied the double-quote style in the useState call. Behavior of isDarkMode default remains the same.


7-22: useEffect block formatting.
Converted quotes to double quotes, added semicolons, and kept the event‑listener setup/cleanup intact. No logic modifications detected; the media query handling is unchanged.


24-27: Return and export formatting.
Ensured consistent semicolon usage and double-quote style on the default export. Hook API remains identical.

editor/kits/minimal-tiptap/extensions/image/hooks/use-image-actions.ts (1)

1-4: Stylistic import and formatting adjustments
These changes (double quotes, semicolons, and spacing) align the file with the project's code style conventions. No functional logic has been altered.

editor/kits/minimal-tiptap/components/section/one.tsx (2)

8-8: Standardize utility import path
Updating the cn import to "@/utils/cn" matches the path conventions used throughout the minimal-tiptap kit.


23-23: Refine intrinsic element type annotation
Switching to keyof React.JSX.IntrinsicElements enhances type accuracy for the element prop.

editor/kits/minimal-tiptap/hooks/use-throttle.ts (1)

1-1: Apply consistent styling across the throttle hook
The updates (quote styles, semicolons, spacing) do not affect hook logic and enforce unified formatting standards.

Also applies to: 7-8, 14-16, 18-24, 29-31, 33-33

editor/kits/minimal-tiptap/styles/partials/zoom.css (1)

43-45: Unified double quotes in CSS attribute selectors
Switching attribute selectors to use double quotes ensures consistency with the broader codebase style. Functional behavior remains unchanged.

Also applies to: 71-74

editor/kits/minimal-tiptap/hooks/use-minimal-tiptap.ts (2)

14-14: Re-enable CodeBlockLowlight extension
Uncommenting the import and inclusion restores code block syntax highlighting. Please verify that @tiptap/extension-code-block-lowlight and its lowlight peer dependency are installed at the expected versions and that code blocks render correctly in the editor.

Also applies to: 152-152


21-21: Reorder cn import
Moving cn closer to other utility imports is purely stylistic and aligns with the updated import ordering conventions.

editor/kits/minimal-tiptap/components/image/image-edit-dialog.tsx (7)

1-6: Consistent import formatting.
The type and value imports have been normalized to double quotes and include semicolons, matching the project style.


13-15: Dialog import cleaned up.
The DialogTrigger import now has a trailing comma and semicolon, aligning with surrounding imports.


18-18: Interface property terminator.
A semicolon was added to the editor property in the ImageEditDialogProps interface, ensuring consistent TypeScript syntax.


22-22: Hook declaration style.
The useState call is properly formatted with default value and semicolon, matching other components.


28-28: JSX attribute quoting.
The isActive prop uses double-quoted string "image", consistent with the rest of the JSX.


40-43: Dialog description accessibility.
The DialogDescription text and its sr-only class are correctly formatted and quoted, enhancing screen-reader support.


47-51: Component closing and export.
Added trailing semicolons on the closing ); and the named export line, which matches the surrounding modules.

editor/kits/minimal-tiptap/extensions/code-block-lowlight/code-block-lowlight.ts (3)

1-2: Import statements normalized.
Both imports now use double quotes and the formatting is consistent with other extensions.


11-13: HTMLAttributes formatting.
The class: "block-node", entry has a trailing comma and correct indentation.


17-18: Default export semicolon.
The export default CodeBlockLowlight; line now ends with a semicolon, aligning with project conventions.

editor/kits/minimal-tiptap/extensions/horizontal-rule/horizontal-rule.ts (3)

5-5: Import styling update.
The HorizontalRule import now uses double quotes and is unprefixed by a comment, reactivating the extension.


10-13: Keyboard shortcut mapping style.
The "Mod-Alt--" keybinding and the type: this.name object are now formatted with double quotes and trailing commas.


18-19: Export formatting.
The named export now has a trailing semicolon and consistent indentation.

editor/kits/minimal-tiptap/types.ts (4)

1-3: Type imports standardized.
All import type lines now use double quotes, maintaining uniformity in the type declaration module.


6-9: LinkProps formatting.
Added semicolons after each property and switched to double quotes for consistency.


12-15: ShouldShowProps interface cleanup.
Properties and delimiters are now semicolon-terminated and uniformly indented.


21-27: FormatAction interface alignment.
All fields use trailing commas where appropriate and parameter types are consistently quoted.

editor/kits/minimal-tiptap/extensions/reset-marks-on-enter/reset-marks-on-enter.ts (2)

1-5: Import and extension declaration.
The Extension import and name field use double quotes and semicolons, matching the rest of the kit.


10-25: Keyboard shortcut handler formatting.
The addKeyboardShortcuts block—including key mapping, condition checks, and commands—uses consistent double quotes, trailing commas, and semicolons without altering logic.

editor/kits/minimal-tiptap/components/section/five.tsx (2)

23-32: Successfully re-enabled code block functionality.

The code block format action has been properly uncommented and restored in the formatActions array, which aligns with the PR objective of re-enabling code block functionality. The implementation includes all necessary properties: value, label, icon, action handlers, active state checking, execution validation, and keyboard shortcuts.


70-70: LinkEditPopover component successfully re-enabled.

The LinkEditPopover component has been uncommented, making it properly render alongside the ImageEditDialog and ToolbarSection components. This complements the editor's link editing capabilities.

editor/kits/minimal-tiptap/components/section/three.tsx (1)

1-218: Verify intent: Entire file appears to be commented out.

The entire file has been wrapped in a block comment. Is this intentional? The AI summary mentioned only stylistic changes to this file, but commenting out the whole component would remove its functionality entirely.

If this was accidental, please remove the opening /* on line 1 and the closing */ on line 218.

editor/kits/minimal-tiptap/extensions/link/link.ts (1)

1-100: Successful code style improvements.

The changes in this file are purely stylistic and align with the project's updated formatting standards:

  • Single quotes replaced with double quotes
  • Added trailing commas in objects and arrays
  • Added semicolons
  • Improved multiline return formatting

These changes maintain the original functionality while improving code consistency.

editor/kits/minimal-tiptap/extensions/color/color.ts (1)

1-22: Confirm intent: Color extension remains commented out.

The file has been updated to use block comment syntax, but the Color extension remains commented out and inactive. This is in contrast to the CodeBlockLowlight extension which was re-enabled in this PR according to the summary.

Is it intentional to keep this extension disabled while enabling the CodeBlockLowlight extension?

editor/kits/minimal-tiptap/hooks/use-container-size.ts (1)

1-55: Code style standardization looks good.

The changes to this file are purely stylistic, with consistent formatting applied throughout (double quotes, semicolons, improved indentation). The hook's functionality remains unchanged.

editor/kits/minimal-tiptap/components/section/two.tsx (1)

1-129: Consistent formatting improvements.

The formatting standardization (double quotes, semicolons, better spacing) makes the code more readable while preserving all functionality of the SectionTwo component.

editor/kits/minimal-tiptap/extensions/selection/selection.ts (2)

24-26: Good improvement for read-only mode handling.

Adding this condition prevents selection decorations from being displayed when the editor is not editable, which is the correct behavior for read-only mode.


1-41: Formatting standardization looks good.

The consistent application of double quotes and semicolons throughout the file improves readability and maintains style consistency with the rest of the codebase.

editor/kits/minimal-tiptap/extensions/image/components/image-view-block.tsx (3)

6-6: Import path update looks good.

Updated the import path for the cn utility function from a general utils import to a specific path, which is good for code organization.


245-245: Improved loading spinner logic.

The condition for displaying the loading spinner has been refined to only show when the image is actively being uploaded to the server (isServerUploading), rather than the previous broader condition. This provides a more accurate representation of the current state.


284-285: Enhanced image accessibility.

Adding title and id attributes to the <img> element improves accessibility and semantic markup. The title provides additional context on hover, and the id ensures the image can be uniquely identified.

editor/kits/minimal-tiptap/components/bubble-menu/link-bubble-menu.tsx (3)

1-6: LGTM: Import statement formatting is consistent

The consistent use of double quotes and semicolons aligns with the broader style standardization across the codebase.


19-23: State initialization looks good

The state initialization is properly structured with consistent formatting.


41-43: Improved conditional logic

The logic is now more explicit by clearly returning false when the editor is not active on a link or not editable, making the intention clearer without changing functionality.

editor/app/(dev)/ui/page.tsx (3)

4-5: LGTM: Added necessary imports for rich text editor integration

The imports for MinimalTiptapEditor and TooltipProvider are correctly added to support the new rich text editor component.


10-22: Good UI structure with TooltipProvider

The TooltipProvider properly wraps the entire application to ensure tooltips work correctly throughout the UI components, including the newly added rich text editor.


64-70: New rich text editor component looks good

The implementation of the __RichTextEditor component follows the consistent pattern of other UI components in this file.

Consider adding customization props to the MinimalTiptapEditor component to demonstrate different configurations:

 function __RichTextEditor() {
   return (
     <div className="grid gap-4">
-      <MinimalTiptapEditor />
+      <label>Rich Text Editor</label>
+      <MinimalTiptapEditor 
+        placeholder="Start typing or paste content here..."
+      />
     </div>
   );
 }
editor/kits/minimal-tiptap/components/section/four.tsx (4)

1-6: Import statements look good

The updated import statements with consistent formatting improve code readability.


19-25: Improved SVG formatting

The SVG element is now properly formatted with consistent attributes and spacing.


29-44: List action definitions look good

The list actions are properly formatted with consistent indentation and formatting.


79-81: Component exports are well structured

Adding the displayName property and using a default export provides better debugging support and more flexible import options.

editor/kits/minimal-tiptap/extensions/file-handler/index.ts (3)

15-23: Improved destructuring format

The improved formatting of the destructuring assignment makes the code more readable.


72-81: File paste handling looks good

The code for handling pasted files is well structured with proper validation and error handling.


94-116: Extension configuration is properly structured

The FileHandler extension is well configured with proper options and plugin initialization.

editor/kits/minimal-tiptap/extensions/image/hooks/use-drag-resize.ts (1)

1-172: Formatting-only changes approved — All modifications (quote style, semicolons, trailing commas, and indentation) in this hook are purely stylistic; there are no logic, control‑flow, or API changes.

editor/kits/minimal-tiptap/components/image/image-edit-block.tsx (1)

1-95: Formatting-only changes approved — The updates here (double quotes, semicolons, JSX spacing) are purely for code style consistency. No functional behavior was altered.

editor/kits/minimal-tiptap/utils.ts (2)

187-188: False positive: optional chaining not necessary — The guard if (matches && matches[1]) already ensures safety before accessing matches[1]. Converting to optional chaining risks assigning undefined to str and changing the logic.

🧰 Tools
🪛 Biome (1.9.4)

[error] 187-188: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)


1-232: Formatting-only changes approved — All edits (quotes, semicolons, line breaks) are stylistic; the utility functions’ logic and public API remain unchanged.

🧰 Tools
🪛 Biome (1.9.4)

[error] 187-188: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

Comment on lines +44 to +51
const [validFiles, errors] = filterFiles(
Array.from(dataTransfer.files),
{
allowedMimeTypes,
maxFileSize,
allowBase64: options.allowBase64,
}
);
Copy link

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Consider enhancing error handling for file validation

While the formatting improvements are good, the error handling in the file validation could be enhanced to provide more specific error messages to the user.

According to the use-minimal-tiptap.ts file, error messages are currently generic. Consider expanding to show specific error reasons:


🏁 Script executed:

#!/bin/bash
# Check current implementation of error handling
rg -A 5 "onValidationError" editor/kits/minimal-tiptap/hooks/

Length of output: 1222


🏁 Script executed:

#!/bin/bash
# Locate the filterFiles implementation and inspect its error object structure
rg -A 20 "export function filterFiles" -n editor/kits/minimal-tiptap/extensions/file-handler/index.ts

Length of output: 103


🏁 Script executed:

#!/bin/bash
# List files in the file-handler extension directory
fd -t f editor/kits/minimal-tiptap/extensions/file-handler

# Display the start of index.ts to locate filterFiles implementation
sed -n '1,200p' editor/kits/minimal-tiptap/extensions/file-handler/index.ts

Length of output: 3369


🏁 Script executed:

#!/bin/bash
# Display FileError type and filterFiles implementation
sed -n '1,200p' editor/kits/minimal-tiptap/utils/index.ts

Length of output: 142


🏁 Script executed:

#!/bin/bash
# Find where FileValidationOptions is defined
rg -n "export type FileValidationOptions" -n .

# Find where FileError is defined
rg -n "export type FileError" -n .

# Locate the filterFiles implementation
rg -n "function filterFiles" -n .

Length of output: 266


Enhance File Validation Error Messaging

The current implementation in use-minimal-tiptap.ts always shows a generic “Image validation error”. Since filterFiles returns a FileError.reason, we can surface that to users for clearer feedback.

Locations to update:

  • editor/kits/minimal-tiptap/hooks/use-minimal-tiptap.ts → inside both onValidationError handlers (for drop and paste)

Suggested diff:

--- a/editor/kits/minimal-tiptap/hooks/use-minimal-tiptap.ts
+++ b/editor/kits/minimal-tiptap/hooks/use-minimal-tiptap.ts
@@ onValidationError(errors: any[]) {
-   errors.forEach((error) => {
-     toast.error("Image validation error");
-   });
+   errors.forEach((error) => {
+     toast.error("File validation error", {
+       position: "bottom-right",
+       description: error.reason,
+     });
+   });

This change will display each specific failure reason (e.g., unsupported type, too large) instead of a blanket message.

Committable suggestion skipped: line range outside the PR's diff.

@softmarshmallow softmarshmallow merged commit 1119a00 into main Apr 18, 2025
11 of 12 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Jan 28, 2026
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.

1 participant