Skip to content

Conversation

@patelajay745
Copy link

@patelajay745 patelajay745 commented Nov 1, 2025

#277 Solved this copying issue.

Now it will open fallback popup on double click.

Please check Video for reference.

Screen.Recording.2025-11-01.at.11.02.28.AM.mov

Summary by cubic

Refactored the email editor’s TextMenu and Variable node behavior to fix the copy/select issue so users can reliably select and copy text and variables. Addresses issue #277.

  • Bug Fixes
    • Simplified BubbleMenu show logic with stricter checks to prevent it from appearing during quick selections.
    • Kept BubbleMenu hidden on non-text nodes (image, logo, spacer, variable, link, button) to avoid interfering with copy.
    • Variable popover now opens on double-click, uses local isEditing, and closes cleanly when dismissed, so single-click selection/copy works as expected.

Written for commit 1f9274f. Summary will update automatically on new commits.

Summary by CodeRabbit

  • New Features

    • Variable editing: double-click variables to open an inline popover for editing fallback values; submit to close the editor.
  • Improvements

    • Text formatting menu: minor UI/style consistency tweaks (no change to existing controls or behavior).

@vercel
Copy link

vercel bot commented Nov 1, 2025

@patelajay745 is attempting to deploy a commit to the kmkoushik's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 1, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

Changes touch three files. .env.example had the NEXT_PUBLIC_IS_CLOUD=true line removed and re-added (no functional change) and a newline artifact. TextMenu.tsx includes import/type adjustments, whitespace/formatting and minor stylistic code changes without altering behavior or public APIs. variable.tsx adds an isEditing state to VariableComponent to control a Popover, enabling double-click to enter edit mode and closing on submit, plus small signature/formatting tweaks.

Pre-merge checks and finishing touches

❌ 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%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The pull request title "refactor: update TextMenu and Variable nodes to ensure copy action wo…" is directly related to the changeset's primary objective. The PR's goal is to fix a copying/select issue (issue #277) by refactoring the TextMenu and Variable nodes, which is exactly what the title communicates. The actual changes align with this intent: the variable.tsx file introduces an isEditing state that controls when the popover opens (on double-click rather than single-click), allowing single-click selection and copy operations to work properly. Although the title is truncated, it clearly identifies the affected components and the core purpose of the refactoring.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f7e80c0 and 1f9274f.

📒 Files selected for processing (2)
  • packages/email-editor/src/menus/TextMenu.tsx (12 hunks)
  • packages/email-editor/src/nodes/variable.tsx (6 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/email-editor/src/nodes/variable.tsx
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/general.mdc)

Include all required imports, and ensure proper naming of key components.

Files:

  • packages/email-editor/src/menus/TextMenu.tsx
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx}: TypeScript-first: use .ts/.tsx for source code (avoid JavaScript source files)
Use 2-space indentation and semicolons (Prettier 3 enforces these)
Adhere to @usesend/eslint-config; fix all ESLint warnings (CI fails on warnings)
Do not use dynamic imports; always place imports at the top of the module

Files:

  • packages/email-editor/src/menus/TextMenu.tsx
**/*.{ts,tsx,md}

📄 CodeRabbit inference engine (AGENTS.md)

Format code with Prettier 3 (run pnpm format)

Files:

  • packages/email-editor/src/menus/TextMenu.tsx
**/*.{tsx,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

Name React component files in PascalCase (e.g., AppSideBar.tsx)

Files:

  • packages/email-editor/src/menus/TextMenu.tsx
🔇 Additional comments (3)
packages/email-editor/src/menus/TextMenu.tsx (3)

1-34: LGTM: Import organization is clean.

The addition of Editor and EditorState types aligns with the type annotations used throughout the file. Import formatting follows project conventions.


254-281: Previous critical issue has been resolved.

The setTimeout-based debouncing flagged by previous reviewers has been removed. The current synchronous shouldShow implementation correctly follows TipTap's BubbleMenuProps contract and properly hides the menu on non-text nodes (image, logo, spacer, variable, link, button) as intended.

Note: The PR description mentions "Debounces BubbleMenu visibility," but the current code contains no debouncing logic. This is actually beneficial, as the previous debouncing implementation was fundamentally broken. If debouncing is still desired, consider using TipTap's built-in updateDelay option in tippyOptions instead.


97-113: LGTM: Formatting changes improve consistency.

The object literal and destructuring formatting adjustments (removing extra spaces, normalizing syntax) align with Prettier 3 conventions and improve code consistency without altering behavior.

Also applies to: 190-228, 305-305, 321-321, 342-342, 356-356, 402-402


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.

@patelajay745
Copy link
Author

@KMKoushik Can you please check ?

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

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f525381 and f7e80c0.

📒 Files selected for processing (3)
  • .env.example (1 hunks)
  • packages/email-editor/src/menus/TextMenu.tsx (12 hunks)
  • packages/email-editor/src/nodes/variable.tsx (6 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/general.mdc)

Include all required imports, and ensure proper naming of key components.

Files:

  • packages/email-editor/src/menus/TextMenu.tsx
  • packages/email-editor/src/nodes/variable.tsx
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx}: TypeScript-first: use .ts/.tsx for source code (avoid JavaScript source files)
Use 2-space indentation and semicolons (Prettier 3 enforces these)
Adhere to @usesend/eslint-config; fix all ESLint warnings (CI fails on warnings)
Do not use dynamic imports; always place imports at the top of the module

Files:

  • packages/email-editor/src/menus/TextMenu.tsx
  • packages/email-editor/src/nodes/variable.tsx
**/*.{ts,tsx,md}

📄 CodeRabbit inference engine (AGENTS.md)

Format code with Prettier 3 (run pnpm format)

Files:

  • packages/email-editor/src/menus/TextMenu.tsx
  • packages/email-editor/src/nodes/variable.tsx
**/*.{tsx,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

Name React component files in PascalCase (e.g., AppSideBar.tsx)

Files:

  • packages/email-editor/src/menus/TextMenu.tsx
  • packages/email-editor/src/nodes/variable.tsx
🧬 Code graph analysis (1)
packages/email-editor/src/menus/TextMenu.tsx (1)
packages/email-editor/src/editor.tsx (1)
  • Editor (74-116)
🪛 dotenv-linter (4.0.0)
.env.example

[warning] 25-25: [EndingBlankLine] No blank line at the end of the file

(EndingBlankLine)

Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

2 issues found across 3 files

Prompt for AI agents (all 2 issues)

Understand the root cause of the following 2 issues and fix them.


<file name="packages/email-editor/src/menus/TextMenu.tsx">

<violation number="1" location="packages/email-editor/src/menus/TextMenu.tsx:258">
Scheduling shouldShow through setTimeout immediately breaks the BubbleMenu. The timeout handler destructures {editor, state, from, to}, but setTimeout invokes it with no arguments, so it throws at runtime; even if it didn’t, lastShowResult is never updated, so shouldShow always returns false.</violation>
</file>

<file name="packages/email-editor/src/nodes/variable.tsx">

<violation number="1" location="packages/email-editor/src/nodes/variable.tsx:177">
Wiring onOpenChange directly to setIsEditing means the Radix trigger still opens the popover on the first click, so single-click copy is still blocked. Guard the handler so only close events update state.</violation>
</file>

Since this is your first cubic review, here's how it works:

  • cubic automatically reviews your code and comments on bugs and improvements
  • Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
  • Ask questions if you need clarification on any suggestion

React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.

@KMKoushik
Copy link
Member

i don't think double click is a solution here, if multiple nodes are selected should just should not show the popup. this way we can apply the same logic to buttons / other nodes

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