Conversation
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
5 Skipped Deployments
|
WalkthroughThis 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 Changes
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
sequenceDiagram
participant MinimalTiptapEditor
participant CodeBlockLowlight
participant User
User->>MinimalTiptapEditor: Types or interacts with editor
MinimalTiptapEditor->>CodeBlockLowlight: Handles code block formatting and highlighting
Poem
Tip ⚡💬 Agentic Chat (Pro Plan, General Availability)
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
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 operationsWhile 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
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis 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 styleSwitched 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 theMod-\keyboard shortcut.editor/kits/minimal-tiptap/styles/index.css (2)
1-5: Consistent Import Quotes: Switched the@importstatements to use double quotes for consistency with the codebase style. No functional impact.
176-178: Add Strikethrough Span Styling: Introduces a rule to applyline-throughto 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.7and the@tiptap/extension-code-block-lowlightalong withlowlighthave been added. This aligns with the PR objective to re-enable code block highlighting.
243-244: Review pnpm Overrides Removal: Theoverridessection was cleared. Please confirm that no conflicting versions ofprosemirror-modelorprosemirror-vieware introduced by this change.
76-90:Details
✅ Verification successful
Verify CodeBlockLowlight Integration: Ensure the newly added
@tiptap/extension-code-block-lowlightis 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 2Length of output: 1387
Integration Confirmed: CodeBlockLowlight is correctly configured
- editor/kits/minimal-tiptap/extensions/code-block-lowlight/code-block-lowlight.ts imports and extends
TiptapCodeBlockLowlightfrom@tiptap/extension-code-block-lowlight.- editor/kits/minimal-tiptap/hooks/use-minimal-tiptap.ts includes
CodeBlockLowlightin 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 forcnutility
The import path has been updated to"@/utils/cn"to match the standardized location of thecnhelper. This change aligns with other components and has no adverse effects.editor/kits/minimal-tiptap/components/toolbar-button.tsx (1)
9-9: Standardizecnutility import
Switching the import to"@/utils/cn"ensures uniform access to thecnhelper across the minimal-tiptap kit. No functional changes here.editor/kits/minimal-tiptap/components/link/link-edit-block.tsx (1)
6-6: Aligncnimport path
Updated to importcnfrom"@/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 forcnhelper
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: Correctcnutility import
The import has been redirected to"@/utils/cn", ensuring consistency with other modules that consume thecnfunction. All behavior remains unchanged.editor/kits/minimal-tiptap/extensions/image/components/resize-handle.tsx (1)
2-2: Consistent utility import path
Updated thecnimport 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 thecnimport 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 thecnutility 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 thecode-block-lowlightextension in the public API. Ensure that the corresponding dependency (@tiptap/extension-code-block-lowlight) is present and up‑to‑date inpackage.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 thatcode-block-lowlight.tsbuilds 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 theuseStatecall. Behavior ofisDarkModedefault remains the same.
7-22:useEffectblock 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 thecnimport to"@/utils/cn"matches the path conventions used throughout the minimal-tiptap kit.
23-23: Refine intrinsic element type annotation
Switching tokeyof React.JSX.IntrinsicElementsenhances type accuracy for theelementprop.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-enableCodeBlockLowlightextension
Uncommenting the import and inclusion restores code block syntax highlighting. Please verify that@tiptap/extension-code-block-lowlightand itslowlightpeer dependency are installed at the expected versions and that code blocks render correctly in the editor.Also applies to: 152-152
21-21: Reordercnimport
Movingcncloser 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.
TheDialogTriggerimport now has a trailing comma and semicolon, aligning with surrounding imports.
18-18: Interface property terminator.
A semicolon was added to theeditorproperty in theImageEditDialogPropsinterface, ensuring consistent TypeScript syntax.
22-22: Hook declaration style.
TheuseStatecall is properly formatted with default value and semicolon, matching other components.
28-28: JSX attribute quoting.
TheisActiveprop uses double-quoted string"image", consistent with the rest of the JSX.
40-43: Dialog description accessibility.
TheDialogDescriptiontext and itssr-onlyclass 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.
Theclass: "block-node",entry has a trailing comma and correct indentation.
17-18: Default export semicolon.
Theexport 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.
TheHorizontalRuleimport now uses double quotes and is unprefixed by a comment, reactivating the extension.
10-13: Keyboard shortcut mapping style.
The"Mod-Alt--"keybinding and thetype: this.nameobject 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.
Allimport typelines now use double quotes, maintaining uniformity in the type declaration module.
6-9:LinkPropsformatting.
Added semicolons after each property and switched to double quotes for consistency.
12-15:ShouldShowPropsinterface cleanup.
Properties and delimiters are now semicolon-terminated and uniformly indented.
21-27:FormatActioninterface 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.
TheExtensionimport andnamefield use double quotes and semicolons, matching the rest of the kit.
10-25: Keyboard shortcut handler formatting.
TheaddKeyboardShortcutsblock—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
SectionTwocomponent.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
cnutility 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
titleandidattributes to the<img>element improves accessibility and semantic markup. Thetitleprovides additional context on hover, and theidensures 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 consistentThe consistent use of double quotes and semicolons aligns with the broader style standardization across the codebase.
19-23: State initialization looks goodThe state initialization is properly structured with consistent formatting.
41-43: Improved conditional logicThe 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 integrationThe imports for MinimalTiptapEditor and TooltipProvider are correctly added to support the new rich text editor component.
10-22: Good UI structure with TooltipProviderThe 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 goodThe implementation of the
__RichTextEditorcomponent 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 goodThe updated import statements with consistent formatting improve code readability.
19-25: Improved SVG formattingThe SVG element is now properly formatted with consistent attributes and spacing.
29-44: List action definitions look goodThe list actions are properly formatted with consistent indentation and formatting.
79-81: Component exports are well structuredAdding 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 formatThe improved formatting of the destructuring assignment makes the code more readable.
72-81: File paste handling looks goodThe code for handling pasted files is well structured with proper validation and error handling.
94-116: Extension configuration is properly structuredThe 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 guardif (matches && matches[1])already ensures safety before accessingmatches[1]. Converting to optional chaining risks assigningundefinedtostrand 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)
| const [validFiles, errors] = filterFiles( | ||
| Array.from(dataTransfer.files), | ||
| { | ||
| allowedMimeTypes, | ||
| maxFileSize, | ||
| allowBase64: options.allowBase64, | ||
| } | ||
| ); |
There was a problem hiding this comment.
💡 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.tsLength 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.tsLength of output: 3369
🏁 Script executed:
#!/bin/bash
# Display FileError type and filterFiles implementation
sed -n '1,200p' editor/kits/minimal-tiptap/utils/index.tsLength 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 bothonValidationErrorhandlers (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.
Summary by CodeRabbit
New Features
Bug Fixes
Style
Documentation
Chores