-
Notifications
You must be signed in to change notification settings - Fork 1
fixed #53 -- The code block is not workable styling need to be enhance #77
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
Conversation
Bumps [actions/labeler](https://github.com/actions/labeler) from 4 to 5. - [Release notes](https://github.com/actions/labeler/releases) - [Commits](actions/labeler@v4...v5) --- updated-dependencies: - dependency-name: actions/labeler dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]>
…lopment/actions/labeler-5 chore(deps): bump actions/labeler from 4 to 5
Bumps [@hookform/resolvers](https://github.com/react-hook-form/resolvers) from 4.1.0 to 4.1.1. - [Release notes](https://github.com/react-hook-form/resolvers/releases) - [Commits](react-hook-form/resolvers@v4.1.0...v4.1.1) --- updated-dependencies: - dependency-name: "@hookform/resolvers" dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]>
…pment/hookform/resolvers-4.1.1 chore(deps): bump @hookform/resolvers from 4.1.0 to 4.1.1
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 22.13.4 to 22.13.5. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]>
…pment/types/node-22.13.5 chore(deps-dev): bump @types/node from 22.13.4 to 22.13.5
Bumps [eslint](https://github.com/eslint/eslint) from 9.20.1 to 9.21.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](eslint/eslint@v9.20.1...v9.21.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]>
…pment/eslint-9.21.0 chore(deps-dev): bump eslint from 9.20.1 to 9.21.0
Bumps [@tanstack/router-devtools](https://github.com/TanStack/router/tree/HEAD/packages/router-devtools) from 1.106.0 to 1.109.2. - [Release notes](https://github.com/TanStack/router/releases) - [Commits](https://github.com/TanStack/router/commits/v1.109.2/packages/router-devtools) --- updated-dependencies: - dependency-name: "@tanstack/router-devtools" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]>
…pment/tanstack/router-devtools-1.109.2 chore(deps-dev): bump @tanstack/router-devtools from 1.106.0 to 1.109.2
Bumps [@tanstack/react-query](https://github.com/TanStack/query/tree/HEAD/packages/react-query) from 5.66.8 to 5.66.9. - [Release notes](https://github.com/TanStack/query/releases) - [Commits](https://github.com/TanStack/query/commits/v5.66.9/packages/react-query) --- updated-dependencies: - dependency-name: "@tanstack/react-query" dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]>
…pment/tanstack/react-query-5.66.9 chore(deps): bump @tanstack/react-query from 5.66.8 to 5.66.9
Bumps [tailwindcss](https://github.com/tailwindlabs/tailwindcss/tree/HEAD/packages/tailwindcss) from 4.0.7 to 4.0.8. - [Release notes](https://github.com/tailwindlabs/tailwindcss/releases) - [Changelog](https://github.com/tailwindlabs/tailwindcss/blob/main/CHANGELOG.md) - [Commits](https://github.com/tailwindlabs/tailwindcss/commits/v4.0.8/packages/tailwindcss) --- updated-dependencies: - dependency-name: tailwindcss dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]>
…pment/tailwindcss-4.0.8 chore(deps-dev): bump tailwindcss from 4.0.7 to 4.0.8
Bumps [@tanstack/router-plugin](https://github.com/TanStack/router/tree/HEAD/packages/router-plugin) from 1.105.5 to 1.109.2. - [Release notes](https://github.com/TanStack/router/releases) - [Commits](https://github.com/TanStack/router/commits/v1.109.2/packages/router-plugin) --- updated-dependencies: - dependency-name: "@tanstack/router-plugin" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]>
…pment/tanstack/router-plugin-1.109.2 chore(deps-dev): bump @tanstack/router-plugin from 1.105.5 to 1.109.2
Bumps [prettier](https://github.com/prettier/prettier) from 3.5.1 to 3.5.2. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](prettier/prettier@3.5.1...3.5.2) --- updated-dependencies: - dependency-name: prettier dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]>
…pment/prettier-3.5.2 chore(deps-dev): bump prettier from 3.5.1 to 3.5.2
Bumps [@tailwindcss/postcss](https://github.com/tailwindlabs/tailwindcss/tree/HEAD/packages/@tailwindcss-postcss) from 4.0.7 to 4.0.8. - [Release notes](https://github.com/tailwindlabs/tailwindcss/releases) - [Changelog](https://github.com/tailwindlabs/tailwindcss/blob/main/CHANGELOG.md) - [Commits](https://github.com/tailwindlabs/tailwindcss/commits/v4.0.8/packages/@tailwindcss-postcss) --- updated-dependencies: - dependency-name: "@tailwindcss/postcss" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]>
…pment/tailwindcss/postcss-4.0.8 chore(deps-dev): bump @tailwindcss/postcss from 4.0.7 to 4.0.8
WalkthroughThis pull request updates and refactors various parts of the project. It upgrades a GitHub Action and adds pre-commit type checking, updates dependency versions in package.json, and removes an unused alias in the Vite configuration. In addition, several editor components and hooks are renamed and refactored to replace the minimal Tiptap implementation with a note editor implementation. Minor UI formatting and type adjustments are also applied, along with updates to code block attributes and CSS styling. Changes
Sequence Diagram(s)sequenceDiagram
actor User
participant EditorComponent as Editor Component
participant UseEditorHook as useEditor Hook
participant TiptapEditor as Tiptap Editor
User->>EditorComponent: Open note editor
EditorComponent->>UseEditorHook: Initialize editor
UseEditorHook->>TiptapEditor: Call useTiptapEditor for setup
TiptapEditor-->>UseEditorHook: Return editor instance
UseEditorHook-->>EditorComponent: Editor ready
EditorComponent-->>User: Display editor interface
Possibly related PRs
Poem
✨ Finishing Touches
🪧 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: 0
🧹 Nitpick comments (5)
src/renderer/src/components/editor.tsx (2)
2-2: Use consistent styling imports across the project
Good job importing the updated note-editor styles. Please ensure any references to the old minimal Tiptap styles have been removed across the codebase so there is no confusion or duplication.
10-10: Check for performance overhead
TheMeasuredContainercomponent can be beneficial for measuring layout, but it may introduce some overhead. Ensure it doesn't negatively impact rendering in resource-constrained environments (e.g., slow devices).src/renderer/src/note-editor/extensions/code-block-lowlight/code-block-lowlight.ts (1)
5-5: Consider accessibility when disabling spell-check
Disabling spell-check in code blocks is often preferred, but ensure no accessibility issues arise if code elements are also used for text that might benefit from spell-checking.src/renderer/src/note-editor/editor.tsx (1)
69-75: Consider memoizing the editor instance.The editor instance is recreated on every render. Consider using
useMemoto optimize performance.- const editor = useEditor({ + const editor = React.useMemo(() => useEditor({ value, onUpdate: onChange, ...props - }) + }), [value, onChange, props])src/renderer/src/note-editor/hooks/use-editor.ts (1)
172-181: Consider adding validation for throttleDelay.The throttleDelay parameter should be validated to ensure it's a non-negative number.
export const useEditor = ({ value, output = 'html', placeholder = '', editorClassName, throttleDelay = 0, onUpdate, onBlur, ...props }: UseEditorProps): Editor | null => { + if (throttleDelay < 0) { + console.warn('throttleDelay should be a non-negative number'); + throttleDelay = 0; + }
📜 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 (18)
.github/workflows/label.yml(1 hunks).husky/pre-commit(1 hunks)electron.vite.config.ts(1 hunks)package.json(4 hunks)src/renderer/src/components/app-sidebar.tsx(0 hunks)src/renderer/src/components/editor.tsx(3 hunks)src/renderer/src/components/home/components/note-editor.tsx(1 hunks)src/renderer/src/components/shared/simple-tooltip.tsx(1 hunks)src/renderer/src/components/ui/sidebar.tsx(2 hunks)src/renderer/src/minimal-tiptap/index.ts(0 hunks)src/renderer/src/note-editor/components/section/five.tsx(0 hunks)src/renderer/src/note-editor/editor.tsx(4 hunks)src/renderer/src/note-editor/extensions/code-block-lowlight/code-block-lowlight.ts(1 hunks)src/renderer/src/note-editor/hooks/use-editor.ts(6 hunks)src/renderer/src/note-editor/index.ts(1 hunks)src/renderer/src/note-editor/styles/partials/code.css(1 hunks)src/renderer/src/note-editor/utils.ts(2 hunks)src/renderer/src/routes/__root.tsx(0 hunks)
💤 Files with no reviewable changes (4)
- src/renderer/src/components/app-sidebar.tsx
- src/renderer/src/minimal-tiptap/index.ts
- src/renderer/src/note-editor/components/section/five.tsx
- src/renderer/src/routes/__root.tsx
✅ Files skipped from review due to trivial changes (3)
- src/renderer/src/note-editor/index.ts
- .github/workflows/label.yml
- src/renderer/src/components/home/components/note-editor.tsx
🔇 Additional comments (21)
src/renderer/src/components/editor.tsx (7)
4-8: Validate all new imports
The new imports (SectionOne,SectionTwo,SectionThree,SectionFour,SectionFive) from@renderer/note-editorlook correct. Verify that these components integrate seamlessly with the rest of the editor features and that no legacy references remain.
12-12: Confirm bubble menu styling
TheLinkBubbleMenuimport from@renderer/note-editor/components/bubble-menu/link-bubble-menuis a great addition. Just verify that its styling aligns with the updated design and does not conflict with any existing bubble menus.
14-14: Excellent rename and usage of the new hook
ReplacinguseMinimalTiptapEditorwithuseEditoris consistent with the project’s shift to the note editor. This is clear and more intuitive.
16-16: Refine the interface naming
RenamingMinimalTiptapPropstoEditorPropsis clear, but ensure all references (including documentation and code comments) reflect the new name to avoid confusion.
66-72: Forward ref usage
The forward ref usage inEditorThreeis well-structured. Confirm that any consumer of this component receives the intended ref to the measured container’s DOM node, as the passed ref is assigned to<MeasuredContainer>.
96-96: Set displayName for debugging
SettingEditorThree.displayNameis beneficial for debugging in React DevTools. Good job adding it.
98-98: Export default naming
ExportingEditorThreeby default maintains consistency with its displayName and helps keep your imports straightforward..husky/pre-commit (1)
2-2: Performing type checks on pre-commit
Addingpnpm typecheckto your pre-commit hook is a good practice to catch type errors early. Be aware it can slow down commits for large projects, so consider caching or partial checks if performance becomes an issue.src/renderer/src/note-editor/extensions/code-block-lowlight/code-block-lowlight.ts (1)
11-12: Preserve naming consistency
Using'class': 'block-node'and'spell-check': falseinHTMLAttributesis fine, but double-check that the'block-node'class name matches your styling conventions in other parts of the note editor.src/renderer/src/components/shared/simple-tooltip.tsx (2)
7-10: LGTM! Props are now more flexible.Making the tooltip props optional improves component reusability by allowing partial prop configurations.
18-20:Details
❓ Verification inconclusive
Verify the default asChild behavior.
The default value of
trueforasChildprop might not be the safest default. Consider whether this could cause issues with non-button children.
🏁 Script executed:
#!/bin/bash # Search for SimpleTooltip usage with non-button children ast-grep --pattern 'SimpleTooltip>$_'Length of output: 39
Action Required: Manually Verify the Default
asChildUsage in SimpleTooltipThe automated search for non-button children usage with SimpleTooltip didn’t return any evidence of issues. However, since the ast-grep script produced no output, it’s advisable to perform a manual review to ensure that no instances of SimpleTooltip are used with non-button elements that could be adversely affected by the default
asChild={true}behavior. If any such cases exist, consider explicitly setting the prop tofalse.
- Verify Usage: Check all occurrences of SimpleTooltip in the codebase to confirm that it's not wrapping non-button elements unless intended.
- Safety Check: Ensure that the default
asChildvalue does not lead to unintended behavior when non-button components are passed as children.electron.vite.config.ts (1)
33-33:Details
✅ Verification successful
Verify impact of removing @editor alias.
The @editor alias has been removed. Ensure all imports previously using this alias have been updated.
🏁 Script executed:
#!/bin/bash # Search for any remaining @editor imports rg "@editor" --type ts --type tsxLength of output: 61
It appears the previous command failed because
rgdidn’t recognize the “tsx” file type. Please execute the above script to verify that no import statements using the removed@editoralias remain in any TypeScript or TSX files.
🏁 Script executed:
#!/bin/bash # Re-run the search for any remaining @editor imports in TypeScript and TSX files rg "@editor" --iglob "*.ts" --iglob "*.tsx"Length of output: 43
Alias Removal Verified:
The removal of the@editoralias has been successfully confirmed. Our re-run search over.tsand.tsxfiles did not return any references to@editor, indicating that all previous imports have been updated accordingly. The updated configuration inelectron.vite.config.ts(line 33) now solely uses the@rendereralias.src/renderer/src/note-editor/editor.tsx (2)
4-4: LGTM! Improved type naming clarity.The rename from
EditortoTiptapEditorand updated imports improve code clarity by avoiding name conflicts.Also applies to: 15-15
17-22: LGTM! Interface renamed for consistency.The rename from
MinimalTiptapPropstoEditorPropsaligns with the new naming convention.src/renderer/src/note-editor/hooks/use-editor.ts (2)
5-5: LGTM! Clear import naming.The rename from
useEditortouseTiptapEditorimproves clarity by distinguishing between the imported and local hook.Also applies to: 25-25
28-36: LGTM! Interface renamed for consistency.The rename from
UseMinimalTiptapEditorPropstoUseEditorPropsaligns with the new naming convention.src/renderer/src/note-editor/utils.ts (1)
2-2: LGTM! Type updates align with editor refactoring.The changes correctly update the import and type signature to use
EditorPropsinstead ofMinimalTiptapProps, maintaining consistency with the broader editor refactoring.Also applies to: 37-37
src/renderer/src/components/ui/sidebar.tsx (2)
254-254: Type refinement improves component reference handling.The change from
ElementReftoComponentRefis a good practice as it better represents the component reference types.Also applies to: 327-327
260-276: Improved tooltip implementation.The restructuring to use
SimpleTooltipenhances the component's accessibility and user experience.src/renderer/src/note-editor/styles/partials/code.css (1)
7-11: Fixed code block styling by adjusting overflow handling.The removal of
overflow-autofrom.ProseMirror prewhile maintaining it in.ProseMirror pre codeis a good solution that:
- Prevents double scrollbars
- Maintains proper code block overflow handling
- Fixes the styling issue mentioned in #53
Also applies to: 17-19
package.json (1)
36-36:Details
❓ Verification inconclusive
Verify package version compatibility.
The dependency updates are minor version increments and patches, which should be safe. However, let's verify the latest versions and any potential security advisories.
Also applies to: 57-57, 97-99, 101-101, 111-111, 118-118, 121-121
🏁 Script executed:
#!/bin/bash # Check npm registry for latest versions and security advisories for pkg in "@hookform/resolvers" "@tanstack/react-query" "@tailwindcss/postcss" "@tanstack/router-devtools" "@tanstack/router-plugin" "@types/node" "eslint" "prettier" "tailwindcss"; do echo "Checking $pkg..." npm view $pkg version dist-tags.latest time.modified npm audit $pkg doneLength of output: 7071
Dependency versions match the npm registry, but further security verification is needed.
- The npm registry returns for each package (e.g., "@hookform/resolvers" at 4.1.1) confirm that the versions in package.json are the current ones.
- The npm audit command failed due to the absence of a lockfile (ENOLOCK error). To complete a security audit, please generate a lockfile with
npm i --package-lock-onlyand then runnpm auditlocally.
Summary by CodeRabbit
New Features
Refactor
Style