Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@dipto-metaforktech
Copy link

@dipto-metaforktech dipto-metaforktech commented Nov 18, 2025

Summary by CodeRabbit

  • Chores

    • Removed Vercel deployment configuration file containing scheduled cron task definitions and function settings for API endpoints
  • Refactor

    • Enhanced rich text editor toolbar with improved command execution flow for text formatting (Bold, Italic, Heading levels, Link operations) and updated extension configuration type handling for better compatibility

@vercel
Copy link
Contributor

vercel bot commented Nov 18, 2025

@dipto-metaforktech is attempting to deploy a commit to the Dub Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 18, 2025

Walkthrough

This PR deletes Vercel cron configuration, updates type handling in the rich-text editor's extension system with a type assertion, and modifies toolbar action handlers to focus the editor while commenting out formatting commands (bold, italic, heading, link modifications).

Changes

Cohort / File(s) Summary
Configuration Removal
apps/web/vercel.json
Deleted entire Vercel configuration file containing cron schedule definitions for /api/cron/* endpoints and function maxDuration settings.
Rich-Text Editor Type Handling
packages/ui/src/rich-text-area/rich-text-provider.tsx
Modified extensions option to use type casting (as any) for array construction, enabling TypeScript compatibility with mixed/conditional extension configurations.
Rich-Text Editor Toolbar Actions
packages/ui/src/rich-text-area/rich-text-toolbar.tsx
Replaced formatting command chains (toggleBold, toggleItalic, toggleHeading, setLink, unsetLink) with editor.commands.focus() calls; commented out actual content-modification logic for Bold, Italic, Heading 1, Heading 2, and Link handlers.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Rich-text toolbar actions: Multiple formatting commands are disabled/commented out—verify intentionality (temporary state, feature pause, or refactor-in-progress)
  • Type assertion in provider: Confirm that as any cast is appropriate and doesn't mask type safety issues with extension definitions
  • Vercel config deletion: Clarify reasoning for removing all scheduled cron jobs—potential impact on background tasks and integrations

Possibly related PRs

  • Rich text messages and bounties #3067: Directly modifies the same rich-text editor files (rich-text-provider.tsx and rich-text-toolbar.tsx), indicating related work on editor extensions and toolbar behavior.

Suggested reviewers

  • steven-tey

Poem

🐰 A hop, a type cast, and focus we keep,
Cron jobs sleep while toolbars take a leap,
Extensions align with a as any friend,
Bold dreams are paused, but not quite at their end! ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Title check ❓ Inconclusive The title 'rich text editor : errors fixed' is vague and generic. It mentions the component but provides no specific information about what errors were fixed or what changes were made. Revise the title to be more specific about the actual changes, such as 'Simplify rich text editor toolbar actions' or describe the specific errors being addressed.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

📝 Customizable high-level summaries are now available in beta!

You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.

  • Provide your own instructions using the high_level_summary_instructions setting.
  • Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example instruction:

"Divide the high-level summary into five sections:

  1. 📝 Description — Summarize the main change in 50–60 words, explaining what was done.
  2. 📓 References — List relevant issues, discussions, documentation, or related PRs.
  3. 📦 Dependencies & Requirements — Mention any new/updated dependencies, environment variable changes, or configuration updates.
  4. 📊 Contributor Summary — Include a Markdown table showing contributions:
    | Contributor | Lines Added | Lines Removed | Files Changed |
  5. ✔️ Additional Notes — Add any extra reviewer context.
    Keep each section concise (under 200 words) and use bullet or numbered lists for clarity."

Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later.


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

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

Copy link
Contributor

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
packages/ui/src/rich-text-area/rich-text-toolbar.tsx (1)

153-169: Critical: Link insertion and removal is completely disabled.

Both setLink() and unsetLink() commands are commented out. Users cannot add or remove links from selected text. The link button is rendered and can be clicked, but the prompt appears without any effect on the editor.

Restore the functionality:

       const url = window.prompt("Link URL", previousUrl);

       if (!url?.trim()) {
-        editor.commands.focus();
-        editor.commands.extendMarkRange("link");
-        // editor.commands.unsetLink();
+        editor.chain().focus().extendMarkRange("link").unsetLink().run();
         return;
       }

-      editor.commands.focus();
-      editor.commands.extendMarkRange("link");
-      // editor.commands.setLink({ href: url });
+      editor.chain().focus().extendMarkRange("link").setLink({ href: url }).run();
packages/ui/src/rich-text-area/rich-text-provider.tsx (1)

125-200: I need to inspect the actual file to verify the review comment's accuracy and the recommended fix.

I need to examine the actual file to verify the review comment's accuracy and the recommended fix.

Based on my verification using web searches and documentation, I can now provide a definitive assessment of the review comment.

Critical: as any suppresses type safety instead of fixing the underlying issue.

The use of as any type assertion for TipTap extensions is acknowledged as "not a great solution" but is used as a workaround. The extensions array with conditional spreading creates type inference challenges that TipTap reports as type assignment errors.

The recommended solution aligns with TipTap best practices. The issue stems from the extensions property expected by useEditor being a straightforward array of extensions, not a complex conditional array. Removing the as any assertion and properly typing the array is the correct approach.

Recommended solution:

Remove the as any assertion and the wrapping parentheses. The extensions array should be:

-     extensions: ([
+     extensions: [
        ...(markdown ? [Markdown] : []),
        StarterKit.configure({
          heading: features.includes("headings")
            ? {
                levels: [1, 2],
              }
            : false,
          bold: features.includes("bold") ? undefined : false,
          italic: features.includes("italic") ? undefined : false,
          link: features.includes("links") ? undefined : false,
        }),
        Placeholder.configure({
          placeholder,
          emptyEditorClass:
            "before:content-[attr(data-placeholder)] before:float-left before:text-content-muted before:h-0 before:pointer-events-none",
        }),

        // Images
        ...(features.includes("images") && handleImageUpload
          ? [
              Image.configure({
                inline: false,
                HTMLAttributes: {
                  class: "rounded-lg max-w-full h-auto",
                },
              }),
              FileHandler.configure({
                allowedMimeTypes: [
                  "image/png",
                  "image/jpeg",
                  "image/gif",
                  "image/webp",
                ],
                onDrop: (currentEditor, files, pos) => {
                  files.forEach((file) =>
                    handleImageUpload(file, currentEditor, pos),
                  );
                },
                onPaste: (currentEditor, files, htmlContent) => {
                  if (htmlContent) return false;
                  files.forEach((file) =>
                    handleImageUpload(
                      file,
                      currentEditor,
                      currentEditor.state.selection.anchor,
                    ),
                  );
                },
              }),
            ]
          : []),
        ...(features.includes("variables") && variables
          ? [
              Mention.extend({
                renderHTML({ node }: { node: any }) {
                  return [
                    "span",
                    {
                      class:
                        "px-1 py-0.5 bg-blue-100 text-blue-700 rounded font-semibold",
                      "data-type": "mention",
                      "data-id": node.attrs.id,
                    },
                    `{{${node.attrs.id}}}`,
                  ];
                },
                renderText({ node }: { node: any }) {
                  return `{{${node.attrs.id}}}`;
                },
              }).configure({
                suggestion: suggestions(variables),
              }),
            ]
          : []),
-     ] as any),
+     ],

If TypeScript errors persist after this change, the actual type mismatch needs investigation. Check that TipTap package versions are compatible and consider adding an explicit type annotation if needed.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c852964 and cce6c3f.

📒 Files selected for processing (3)
  • apps/web/vercel.json (0 hunks)
  • packages/ui/src/rich-text-area/rich-text-provider.tsx (2 hunks)
  • packages/ui/src/rich-text-area/rich-text-toolbar.tsx (3 hunks)
💤 Files with no reviewable changes (1)
  • apps/web/vercel.json

Comment on lines +56 to +70
onClick={() => {
editor?.commands.focus();
// editor?.commands.toggleBold();
}}
/>
)}
{features?.includes("italic") && (
<RichTextToolbarButton
icon={TextItalic}
label="Italic"
isActive={editorState?.isItalic}
onClick={() => editor?.chain().focus().toggleItalic().run()}
onClick={() => {
editor?.commands.focus();
// editor?.commands.toggleItalic();
}}
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Critical: Bold and Italic formatting is completely disabled.

The toggleBold() and toggleItalic() commands are commented out. Users can click these buttons, but no formatting will be applied. The buttons only focus the editor without performing any text formatting.

This breaks core rich text editor functionality and should not be merged.

Root cause analysis needed:

If these commands were commented out due to errors, the underlying issue must be diagnosed and fixed properly:

  1. Verify the StarterKit configuration in rich-text-provider.tsx correctly enables bold/italic
  2. Check if the commands exist on the editor instance
  3. Ensure TipTap extensions are properly initialized

Restore the functionality:

       {features?.includes("bold") && (
         <RichTextToolbarButton
           icon={TextBold}
           label="Bold"
           isActive={editorState?.isBold}
           onClick={() => {
-            editor?.commands.focus();
-            // editor?.commands.toggleBold();
+            editor?.chain().focus().toggleBold().run();
           }}
         />
       )}
       {features?.includes("italic") && (
         <RichTextToolbarButton
           icon={TextItalic}
           label="Italic"
           isActive={editorState?.isItalic}
           onClick={() => {
-            editor?.commands.focus();
-            // editor?.commands.toggleItalic();
+            editor?.chain().focus().toggleItalic().run();
           }}
         />
       )}

Please share the error messages that led to commenting out these commands so the actual issue can be addressed.


🏁 Script executed:

#!/bin/bash
# Locate and inspect the rich-text-toolbar.tsx file
fd -t f "rich-text-toolbar.tsx" --exec cat {} \;

Length of output: 5512


🏁 Script executed:

#!/bin/bash
# Locate and inspect the rich-text-provider.tsx file for configuration
fd -t f "rich-text-provider.tsx" --exec cat {} \;

Length of output: 7058


🏁 Script executed:

#!/bin/bash
# Search for any error messages or context around disabled commands
rg -n "toggleBold|toggleItalic|toggleHeading|setLink|unsetLink" -B2 -A2 --type=tsx --type=ts

Length of output: 27


🏁 Script executed:

#!/bin/bash
# Check for TipTap configuration and extension imports
rg -n "StarterKit|extensions|@tiptap" -C2 --type=tsx --type=ts

Length of output: 27


Critical: Formatting commands are disabled across all toolbar buttons.

The toggleBold(), toggleItalic(), toggleHeading(), unsetLink(), and setLink() commands are commented out throughout the file. The editor will focus but apply no formatting—buttons will appear functional with active/inactive states while users see no text changes.

The StarterKit configuration in rich-text-provider.tsx is correct, so the issue is purely in the disabled command calls:

  • Bold (line 57)
  • Italic (line 67)
  • Heading 1 (line 77)
  • Heading 2 (line 85)
  • Link unset (line 136)
  • Link set (line 141)

Restore all formatting commands using the standard TipTap command chain pattern:

-            editor?.commands.focus();
-            // editor?.commands.toggleBold();
+            editor?.chain().focus().toggleBold().run();

Apply the same pattern to all disabled commands (toggleItalic, toggleHeading, setLink, unsetLink).

📝 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
onClick={() => {
editor?.commands.focus();
// editor?.commands.toggleBold();
}}
/>
)}
{features?.includes("italic") && (
<RichTextToolbarButton
icon={TextItalic}
label="Italic"
isActive={editorState?.isItalic}
onClick={() => editor?.chain().focus().toggleItalic().run()}
onClick={() => {
editor?.commands.focus();
// editor?.commands.toggleItalic();
}}
onClick={() => {
editor?.chain().focus().toggleBold().run();
}}
/>
)}
{features?.includes("italic") && (
<RichTextToolbarButton
icon={TextItalic}
label="Italic"
isActive={editorState?.isItalic}
onClick={() => {
editor?.commands.focus();
// editor?.commands.toggleItalic();
}}
🤖 Prompt for AI Agents
In packages/ui/src/rich-text-area/rich-text-toolbar.tsx around lines 56–70 (and
the other specified lines: bold 57, italic 67, heading1 77, heading2 85, unset
link 136, set link 141), the formatting commands are commented out so buttons
only focus the editor; restore the TipTap command chain calls. Replace the
commented calls with the standard pattern using editor?.chain().focus()...
.run(): e.g. use editor?.chain().focus().toggleBold().run(),
editor?.chain().focus().toggleItalic().run(),
editor?.chain().focus().toggleHeading({ level: 1 }).run(),
editor?.chain().focus().toggleHeading({ level: 2 }).run(),
editor?.chain().focus().unsetLink().run(), and for setting links use
editor?.chain().focus().extendMarkRange().setLink({ href: url }).run() (getting
url from the existing input/prompt logic).

Comment on lines +79 to +91
onClick={() => {
editor?.commands.focus();
// editor?.commands.toggleHeading({ level: 1 });
}}
/>
<RichTextToolbarButton
icon={Heading2}
label="Heading 2"
isActive={editorState?.isHeading2}
onClick={() =>
editor?.chain().focus().toggleHeading({ level: 2 }).run()
}
onClick={() => {
editor?.commands.focus();
// editor?.commands.toggleHeading({ level: 2 });
}}
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Critical: Heading formatting is completely disabled.

The toggleHeading() commands for both heading levels are commented out. Users cannot create headings, making the heading buttons non-functional.

Restore the functionality:

           <RichTextToolbarButton
             icon={Heading1}
             label="Heading 1"
             isActive={editorState?.isHeading1}
             onClick={() => {
-              editor?.commands.focus();
-              // editor?.commands.toggleHeading({ level: 1 });
+              editor?.chain().focus().toggleHeading({ level: 1 }).run();
             }}
           />
           <RichTextToolbarButton
             icon={Heading2}
             label="Heading 2"
             isActive={editorState?.isHeading2}
             onClick={() => {
-              editor?.commands.focus();
-              // editor?.commands.toggleHeading({ level: 2 });
+              editor?.chain().focus().toggleHeading({ level: 2 }).run();
             }}
           />
📝 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
onClick={() => {
editor?.commands.focus();
// editor?.commands.toggleHeading({ level: 1 });
}}
/>
<RichTextToolbarButton
icon={Heading2}
label="Heading 2"
isActive={editorState?.isHeading2}
onClick={() =>
editor?.chain().focus().toggleHeading({ level: 2 }).run()
}
onClick={() => {
editor?.commands.focus();
// editor?.commands.toggleHeading({ level: 2 });
}}
<RichTextToolbarButton
icon={Heading1}
label="Heading 1"
isActive={editorState?.isHeading1}
onClick={() => {
editor?.chain().focus().toggleHeading({ level: 1 }).run();
}}
/>
<RichTextToolbarButton
icon={Heading2}
label="Heading 2"
isActive={editorState?.isHeading2}
onClick={() => {
editor?.chain().focus().toggleHeading({ level: 2 }).run();
}}
/>
🤖 Prompt for AI Agents
packages/ui/src/rich-text-area/rich-text-toolbar.tsx around lines 79 to 91: the
heading buttons have their toggleHeading calls commented out so they do nothing;
restore functionality by uncommenting and invoking
editor?.commands.toggleHeading({ level: 1 }) for the Heading 1 button and
editor?.commands.toggleHeading({ level: 2 }) for the Heading 2 button, keeping
the existing editor?.commands.focus() calls and null-safe checks to avoid
runtime errors if editor is undefined.

@dipto-metaforktech
Copy link
Author

It was a mistake wanted to changed in my forked of dub repo. Instead clicked here in the main repo

@dipto-metaforktech dipto-metaforktech deleted the dipto branch November 18, 2025 06:31
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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.

2 participants