-
-
Notifications
You must be signed in to change notification settings - Fork 145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove toolbar from the alpha editor #1114
Remove toolbar from the alpha editor #1114
Conversation
@MichaelMoyles is attempting to deploy a commit to the Codú Team on Vercel. A member of the Team first needs to authorize it. |
WalkthroughThe pull request involves significant modifications to the editor components, primarily focusing on the removal of various features to simplify the editor's functionality. Key changes include the deletion of the Changes
Assessment against linked issues
Possibly related PRs
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🧹 Outside diff range and nitpick comments (1)
components/editor/editor/index.tsx (1)
Line range hint
36-38
: Address the TODO comment regarding accessibilityThere's an unaddressed TODO comment about accessibility issues:
// TODO: Review this for no-static-element-interactions click-events-have-key-events
This comment highlights potential accessibility concerns that should be addressed. Consider implementing keyboard event handlers to improve accessibility or use a more semantic HTML element if possible.
Would you like assistance in implementing a solution for this accessibility issue?
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (11)
- components/editor/editor/RenderPost.tsx (2 hunks)
- components/editor/editor/components/CodeBlock/CodeBlock.module.css (0 hunks)
- components/editor/editor/components/CodeBlock/CodeBlock.tsx (0 hunks)
- components/editor/editor/components/Table/CustomTableNodeView.tsx (0 hunks)
- components/editor/editor/components/Toolbar/Toolbar.module.css (0 hunks)
- components/editor/editor/components/Toolbar/Toolbar.tsx (0 hunks)
- components/editor/editor/components/Toolbar/ToolbarItemButton.tsx (0 hunks)
- components/editor/editor/components/bubble-menu.tsx (0 hunks)
- components/editor/editor/components/color-selector.tsx (0 hunks)
- components/editor/editor/extensions/index.tsx (0 hunks)
- components/editor/editor/index.tsx (1 hunks)
💤 Files with no reviewable changes (9)
- components/editor/editor/components/CodeBlock/CodeBlock.module.css
- components/editor/editor/components/CodeBlock/CodeBlock.tsx
- components/editor/editor/components/Table/CustomTableNodeView.tsx
- components/editor/editor/components/Toolbar/Toolbar.module.css
- components/editor/editor/components/Toolbar/Toolbar.tsx
- components/editor/editor/components/Toolbar/ToolbarItemButton.tsx
- components/editor/editor/components/bubble-menu.tsx
- components/editor/editor/components/color-selector.tsx
- components/editor/editor/extensions/index.tsx
🧰 Additional context used
🔇 Additional comments (4)
components/editor/editor/index.tsx (4)
Line range hint
36-53
: Toolbar removal aligns with PR objectivesThe removal of the Toolbar component from the render tree aligns well with the PR objective of simplifying the editor interface. Good job on implementing this change.
Line range hint
1-53
: Summary of review findings
- The removal of the Toolbar component aligns with the PR objectives.
- The addition of the
TiptapExtensions
import needs verification or removal if unused.- The editor configuration may need adjustment to fully align with the simplified feature set described in the PR objectives.
- The accessibility TODO comment should be addressed to improve the component's accessibility.
- The functionality of the
EditorBubbleMenu
should be verified to ensure it provides the intended simplified set of formatting options.Overall, the changes are moving in the right direction, but some refinements and verifications are needed to fully meet the PR objectives and maintain code quality.
Line range hint
47-49
: Verify EditorBubbleMenu functionalityThe
EditorBubbleMenu
component is still present in the render tree. Given the PR objectives to simplify the interface and make editing functionalities accessible via a slash menu and tooltips, please verify that:
- The
EditorBubbleMenu
provides the intended simplified set of formatting options.- It doesn't reintroduce any of the removed features (strikethrough, codeblock, etc.).
- It aligns with the described slash menu and tooltip functionality.
Let's check the implementation of EditorBubbleMenu:
#!/bin/bash # Description: Check the implementation of EditorBubbleMenu # Test: Display the contents of the file containing EditorBubbleMenu fd -e ts -e tsx -e js -e jsx --exec cat {} | rg -A 30 "export (const|function) EditorBubbleMenu"
Line range hint
21-25
: Review editor extensions for consistency with PR objectivesThe current editor configuration retains extensions like
StarterKit
,Highlight
, andTypography
. This seems inconsistent with the PR objective of removing features such as strikethrough, codeblock, and text alignment options.Please review the extensions and consider:
- Removing or customizing
StarterKit
to exclude unwanted features.- Verifying if
Highlight
andTypography
extensions are still needed.- Updating
TiptapEditorProps
to reflect the reduced feature set.This will ensure that the editor's capabilities align with the simplified interface described in the PR objectives.
Let's check the contents of the TiptapEditorProps:
@@ -11,7 +11,7 @@ const RenderPost = ({ json }: RenderPostProps) => { | |||
|
|||
const editor = useEditor({ | |||
editable: false, | |||
extensions: [...TiptapExtensions, CustomCodeBlockReadOnly], | |||
extensions: [...TiptapExtensions], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codebase verification
Please address the remaining usages of removed extensions.
The search identified several instances of removed extensions such as table
and underline
in the following files:
utils/createPasswordLessEmailTemplate.ts
utils/createEmailTemplate.ts
components/editor/editor/RenderPost.tsx
server/trpc/react.tsx
components/ui/Search.tsx
- and others.
Please verify and remove or update these usages to ensure consistency with the PR objectives.
🔗 Analysis chain
LGTM! Verify removed extensions.
The change aligns with the PR objectives of simplifying the editor by removing unused features. The CustomCodeBlockReadOnly
extension has been removed, leaving only the core TiptapExtensions
.
To ensure consistency across the codebase, let's verify that the removed extensions are not being used elsewhere:
This script will help us confirm that the removed extensions are not being used in other parts of the codebase, ensuring that the simplification is consistent throughout the project.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check for any remaining usage of removed extensions
# Test 1: Search for CustomCodeBlockReadOnly
echo "Searching for CustomCodeBlockReadOnly usage:"
rg "CustomCodeBlockReadOnly" --type typescript --type tsx
# Test 2: Search for other removed extensions mentioned in the PR objectives
echo "Searching for other removed extensions:"
rg -e "strikethrough" -e "codeblock" -e "text alignment" -e "superscript" -e "subscript" -e "table" -e "color selector" -e "highlighting" -e "underline" --type typescript --type tsx
Length of output: 485
Script:
#!/bin/bash
# Description: Check for any remaining usage of removed extensions by specifying file extensions
# Test 1: Search for CustomCodeBlockReadOnly
echo "Searching for CustomCodeBlockReadOnly usage:"
rg "CustomCodeBlockReadOnly" -g "*.ts" -g "*.tsx"
# Test 2: Search for other removed extensions mentioned in the PR objectives
echo "Searching for other removed extensions:"
rg -e "strikethrough" -e "codeblock" -e "text alignment" -e "superscript" -e "subscript" -e "table" -e "color selector" -e "highlighting" -e "underline" -g "*.ts" -g "*.tsx"
Length of output: 15375
Script:
#!/bin/bash
# Description: Check for any remaining usage of removed extensions by specifying file extensions
# Test 1: Search for CustomCodeBlockReadOnly
echo "Searching for CustomCodeBlockReadOnly usage:"
rg "CustomCodeBlockReadOnly" -g "*.ts" -g "*.tsx"
# Test 2: Search for other removed extensions mentioned in the PR objectives
echo "Searching for other removed extensions:"
rg -e "strikethrough" -e "codeblock" -e "text alignment" -e "superscript" -e "subscript" -e "table" -e "color selector" -e "highlighting" -e "underline" -g "*.ts" -g "*.tsx"
Length of output: 15375
@@ -5,10 +5,9 @@ import Typography from '@tiptap/extension-typography' | |||
import { EditorContent, useEditor } from '@tiptap/react' | |||
import StarterKit from '@tiptap/starter-kit' | |||
import { TiptapEditorProps } from "./props"; | |||
import { CustomCodeBlockEdit, TiptapExtensions } from "./extensions"; | |||
import { TiptapExtensions } from "./extensions"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codebase verification
Unused TiptapExtensions
import identified
The TiptapExtensions
import in components/editor/editor/index.tsx
is not used within this file. Please either implement its usage or remove the unused import to maintain code cleanliness.
- File:
components/editor/editor/index.tsx
, Line: 8
🔗 Analysis chain
Verify the usage of TiptapExtensions import
The TiptapExtensions
import has been added, but it doesn't appear to be used within this file. This could indicate either:
- Incomplete changes where the import is intended to be used but the implementation is missing.
- An unnecessary import that should be removed.
Please review and either implement the usage of TiptapExtensions
or remove the unused import.
Let's verify if TiptapExtensions
is used elsewhere in the codebase:
Retry searching for TiptapExtensions
usage with corrected file types
Let's rerun the search using the correct file type identifiers to ensure we capture all instances of TiptapExtensions
.
Retry searching for TiptapExtensions
usage with glob patterns
Let's rerun the search using glob patterns to accurately target .ts
and .tsx
files.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check for usage of TiptapExtensions in the codebase
# Test: Search for TiptapExtensions usage
rg --type typescript --type tsx "TiptapExtensions"
Length of output: 85
Script:
#!/bin/bash
# Description: Re-check usage of TiptapExtensions in TypeScript and TSX files
rg --type ts --type tsx "TiptapExtensions"
Length of output: 70
Script:
#!/bin/bash
# Description: Re-check usage of TiptapExtensions in TypeScript and TSX files using glob patterns
rg "TiptapExtensions" -g "*.ts" -g "*.tsx"
Length of output: 374
Hey @MichaelMoyles |
Shoot! Open up a something to fix that 😭 My bad |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
✨ Codu Pull Request 💻
Fixes #1028
Pull Request details
Removed the toolbar & other unused features below:
Any Breaking changes
Associated Screenshots