fix: improve editor UI#347
Conversation
|
Warning Review limit reached
Next review available in: 40 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (29)
📝 WalkthroughWalkthroughThis PR updates RichEditor styling, Lexical imports and editor ref access, Markdown blank-line parsing/serialization, and Vitest browser test setup, along with related environment, package, TypeScript, and CI configuration. ChangesRichEditor and test infrastructure updates
Estimated code review effort: 4 (Complex) | ~60 minutes Possibly related PRs
Sequence Diagram(s)sequenceDiagram
participant User
participant RichEditor
participant MarkdownParser
participant BrowserTests
User->>RichEditor: Type paragraphs and empty lines
RichEditor->>MarkdownParser: Serialize editor document
MarkdownParser-->>RichEditor: Markdown with preserved paragraph gaps
BrowserTests->>RichEditor: Render editor and inspect paragraphs
BrowserTests->>MarkdownParser: Parse serialized Markdown
MarkdownParser-->>BrowserTests: AST with matching paragraph nodes
🚥 Pre-merge checks | ✅ 1 | ❌ 4❌ Failed checks (2 warnings, 2 inconclusive)
✅ Passed checks (1 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/app/src/features/NoteEditor/RichEditor/theme/RichEditor.css`:
- Line 105: The RichEditor theme is using color tokens that point at the parent
variables instead of the actual leaf values, so the text and link colors won’t
resolve correctly. Update the color references in the RichEditor CSS to use the
`-base` Chakra variables for the typography and link tokens, and verify the
affected styles in the RichEditor stylesheet still point to the correct token
names.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: a178e3f1-68ce-4815-a0cd-12fef1dcdd63
📒 Files selected for processing (2)
packages/app/src/components/theme/base.tspackages/app/src/features/NoteEditor/RichEditor/theme/RichEditor.css
There was a problem hiding this comment.
Actionable comments posted: 5
🧹 Nitpick comments (7)
packages/app/src/features/NoteEditor/RichEditor/plugins/Markdown/remark/remarkPreserveBlankLines.ts (2)
41-48: 🎯 Functional Correctness | 🔵 Trivial | 💤 Low valueInserted empty paragraph positions use
offset: 0which is inaccurate.The
offsetfield is set to0for all inserted empty paragraphs regardless of their actual position in the source. While this doesn't affect serialization (which only usesline), it could cause issues if any downstream code relies onoffsetfor source mapping or error reporting.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/app/src/features/NoteEditor/RichEditor/plugins/Markdown/remark/remarkPreserveBlankLines.ts` around lines 41 - 48, The inserted empty paragraph in remarkPreserveBlankLines uses a fixed offset of 0, which makes its source position inaccurate. Update the emptyLine position object so the offset is derived from the actual blank line location instead of a constant, and keep the line/column mapping consistent with the surrounding logic in remarkPreserveBlankLines. Use the existing line-based position construction to locate where the paragraph is created and adjust both start and end offsets accordingly.
65-67: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueRemove the unused
remarkPreserveBlankLineswrapper.markdownParser.tsalready callsfillGapsWithParagraphsdirectly, so this plugin wrapper has no remaining references.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/app/src/features/NoteEditor/RichEditor/plugins/Markdown/remark/remarkPreserveBlankLines.ts` around lines 65 - 67, The remarkPreserveBlankLines plugin wrapper is now unused because markdownParser already invokes fillGapsWithParagraphs directly. Remove the remarkPreserveBlankLines export/wrapper from remarkPreserveBlankLines.ts, and update any remaining imports or references so the codebase uses fillGapsWithParagraphs directly without the extra Plugin wrapper.packages/app/src/features/NoteEditor/RichEditor/plugins/Markdown/markdownParser.ts (1)
58-71: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueRedundant
children.lengthcheck in join logic.
hasChildrenalready verifieschildren.length > 0, so when!hasChildren(left)isfalse(meaninghasChildrenreturnedtrue),left.children.length === 0can never betrue. The second condition is dead code.♻️ Simplify empty-paragraph checks
(left, right) => { if (left.type === 'paragraph' || right.type === 'paragraph') { - const isLeftEmpty = !hasChildren(left) || left.children.length === 0; - const isRightEmpty = - !hasChildren(right) || right.children.length === 0; + const isLeftEmpty = !hasChildren(left); + const isRightEmpty = !hasChildren(right);🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/app/src/features/NoteEditor/RichEditor/plugins/Markdown/markdownParser.ts` around lines 58 - 71, The join logic in markdownParser’s paragraph handling has a redundant empty-check because hasChildren already guarantees children exist, so the extra children.length comparison is dead code. Simplify the left/right emptiness checks inside the join callback by relying only on hasChildren for the paragraph nodes, and keep the early return 0 behavior for empty paragraphs while preserving the existing null fallback.packages/app/src/features/NoteEditor/RichEditor/__tests__/utils/renderRichEditor.tsx (1)
142-144: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueAdd null guard to
getEditor()for consistency withrenderEditorInDOM.tsx.
renderEditorInDOM.tsxthrows a descriptive error wheneditorRef.currentis null, but this version returns it directly. A caller that invokesgetEditor().read(...)before the editor is mounted would get a confusingTypeError: Cannot read properties of nullinstead of a clear message.♻️ Proposed refactor
getEditor() { - return editorRef.current; + const editor = editorRef.current; + if (!editor) throw new Error('Editor instance is not set'); + return editor; },🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/app/src/features/NoteEditor/RichEditor/__tests__/utils/renderRichEditor.tsx` around lines 142 - 144, The getEditor helper currently returns editorRef.current directly, which can surface a null TypeError if called before mount. Update getEditor() in renderRichEditor to match the null handling used by renderEditorInDOM.tsx: check editorRef.current, and throw a descriptive error when it is missing before returning the editor instance. Keep the behavior consistent for callers like getEditor().read(...) by ensuring the method always either returns a valid editor or fails with a clear message.packages/app/src/features/NoteEditor/RichEditor/plugins/CodeHighlightPlugin.tsx (1)
8-10: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winSyntax highlighting is disabled — track the TODO.
The plugin now registers only
registerCodeIndentationinstead ofregisterCodeHighlighting, meaning code blocks lose syntax highlighting. The TODO at line 8 acknowledges this. SinceregisterCodeHighlightingrequires Prism.js (a browser-specific dependency not available in@lexical/code-core), re-adding it may require importing from@lexical/codeseparately or adding a Prism dependency.Do you want me to help re-introduce
registerCodeHighlightingalongsideregisterCodeIndentation, or open an issue to track this?🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/app/src/features/NoteEditor/RichEditor/plugins/CodeHighlightPlugin.tsx` around lines 8 - 10, The CodeHighlightPlugin currently only calls registerCodeIndentation in its useEffect, so syntax highlighting is no longer being registered; update this plugin to also restore registerCodeHighlighting as noted by the existing TODO. Locate the change in CodeHighlightPlugin and wire the highlighting registration back in alongside registerCodeIndentation, using the appropriate browser-side Prism-backed implementation if needed rather than the `@lexical/code-core-only` path.packages/app/src/features/NoteEditor/RichEditor/plugins/Markdown/remark/remarkLiftFormatting.ts (1)
30-37: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueType guard return type is too narrow for
RootContentinput.
hasChildrennow acceptsRootContentbut still narrows toPhrasingContent & { children: PhrasingContent[] }. ARootContentnode liketablehas children but is notPhrasingContent, so the guard is semantically incorrect for non-phrasing inputs. This doesn't cause runtime issues in current callers (the join handler only accesseschildren.length, andflattenToLeafpassesPhrasingContent), but it could mislead future consumers.♻️ Proposed fix — use a broader type guard
export function hasChildren( node: RootContent, -): node is PhrasingContent & { children: PhrasingContent[] } { +): node is RootContent & { children: RootContent[] } { return ( 'children' in node && Array.isArray((node as { children?: unknown }).children) && (node as { children: unknown[] }).children.length > 0 ); }Then update
flattenToLeafto castnode.childrentoPhrasingContent[]when needed, since the input there is alreadyPhrasingContent.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/app/src/features/NoteEditor/RichEditor/plugins/Markdown/remark/remarkLiftFormatting.ts` around lines 30 - 37, The `hasChildren` type guard is too narrow for its `RootContent` parameter because it claims the node is `PhrasingContent` even when broader root nodes like `table` can match. Broaden the return type in `hasChildren` to reflect any `RootContent` with a `children` array, then adjust `flattenToLeaf` to explicitly cast `node.children` to `PhrasingContent[]` where that phrasing-specific assumption is valid. Keep the existing runtime check logic and update only the typings around `hasChildren` and `flattenToLeaf`.packages/app/src/features/NoteEditor/RichEditor/RichEditorContent.tsx (1)
72-72: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueAdd dependency array to
useImperativeHandle.Without deps,
editorRef.current = editoris reassigned on every render. SinceeditorfromuseLexicalComposerContextis stable, adding[editor]avoids unnecessary work.♻️ Proposed fix
- useImperativeHandle(editorRef, () => editor); + useImperativeHandle(editorRef, () => editor, [editor]);🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/app/src/features/NoteEditor/RichEditor/RichEditorContent.tsx` at line 72, The useImperativeHandle call in RichEditorContent is missing a dependency array, causing editorRef to be reassigned on every render. Update the useImperativeHandle invocation to depend on editor from useLexicalComposerContext, so the handle is only refreshed when the editor instance changes. This should be applied in RichEditorContent where editorRef is wired to editor.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@packages/app/src/features/NoteEditor/RichEditor/__tests__/utils/renderEditorInDOM.tsx`:
- Around line 72-106: The renderEditorInDOM helper is missing translation
context, so RichEditor plugins that call useTranslation can fail in DOM tests.
Update the renderEditor function to wrap RichEditor with I18nextProvider or the
app’s LocalesProvider, alongside the existing Provider, ThemeProvider, and
MockWorkspaceProvider. Keep the change localized to renderEditorInDOM and use
the existing editorPanelContext and RichEditor symbols to locate the wrapper.
In
`@packages/app/src/features/NoteEditor/RichEditor/plugins/Markdown/remark/remarkPreserveBlankLines.test.ts`:
- Around line 20-24: The test in remarkPreserveBlankLines.test.ts has the wrong
expectation for fillGapsWithParagraphs when parsing Hello\n\n\nWorld; update the
assertion in the “Must add 1 paragraph for gap in 2 lines” case to expect 4
children instead of 3 so it matches the actual blank-line preservation behavior
and round-trip consistency.
- Around line 26-30: The expectation in the fillGapsWithParagraphs test is wrong
for the 10-blank-line case. Update the assertion in
remarkPreserveBlankLines.test so the expected children count matches the actual
behavior of fillGapsWithParagraphs and markdownProcessor.parse for a 10-line
gap, using the existing test name and helper function references to locate it.
Keep the test aligned with round-trip preservation so it asserts the full
paragraph count produced by the parser/fillGapsWithParagraphs flow.
In `@packages/app/src/features/NoteEditor/RichEditor/theme/RichEditor.css`:
- Line 148: Update the RichEditor.css color tokens that currently reference
var(--chakra-colors-typography) and var(--chakra-colors-link) to use the
matching base leaves instead. In the RichEditor styles where the editor text and
link styling are defined, switch those declarations to
var(--chakra-colors-typography-base) and var(--chakra-colors-link-base) so the
CSS resolves correctly and the intended editor/link colors are applied.
In `@packages/app/tsconfig.json`:
- Line 36: The Vitest test type setup is using the root
`@testing-library/jest-dom` types, which only target Jest matchers. Update the
types entry in the app tsconfig to use `@testing-library/jest-dom/vitest`
alongside vitest/globals so Vitest files keep the correct matcher typings,
including expect.element and the jest-dom matchers.
---
Nitpick comments:
In
`@packages/app/src/features/NoteEditor/RichEditor/__tests__/utils/renderRichEditor.tsx`:
- Around line 142-144: The getEditor helper currently returns editorRef.current
directly, which can surface a null TypeError if called before mount. Update
getEditor() in renderRichEditor to match the null handling used by
renderEditorInDOM.tsx: check editorRef.current, and throw a descriptive error
when it is missing before returning the editor instance. Keep the behavior
consistent for callers like getEditor().read(...) by ensuring the method always
either returns a valid editor or fails with a clear message.
In
`@packages/app/src/features/NoteEditor/RichEditor/plugins/CodeHighlightPlugin.tsx`:
- Around line 8-10: The CodeHighlightPlugin currently only calls
registerCodeIndentation in its useEffect, so syntax highlighting is no longer
being registered; update this plugin to also restore registerCodeHighlighting as
noted by the existing TODO. Locate the change in CodeHighlightPlugin and wire
the highlighting registration back in alongside registerCodeIndentation, using
the appropriate browser-side Prism-backed implementation if needed rather than
the `@lexical/code-core-only` path.
In
`@packages/app/src/features/NoteEditor/RichEditor/plugins/Markdown/markdownParser.ts`:
- Around line 58-71: The join logic in markdownParser’s paragraph handling has a
redundant empty-check because hasChildren already guarantees children exist, so
the extra children.length comparison is dead code. Simplify the left/right
emptiness checks inside the join callback by relying only on hasChildren for the
paragraph nodes, and keep the early return 0 behavior for empty paragraphs while
preserving the existing null fallback.
In
`@packages/app/src/features/NoteEditor/RichEditor/plugins/Markdown/remark/remarkLiftFormatting.ts`:
- Around line 30-37: The `hasChildren` type guard is too narrow for its
`RootContent` parameter because it claims the node is `PhrasingContent` even
when broader root nodes like `table` can match. Broaden the return type in
`hasChildren` to reflect any `RootContent` with a `children` array, then adjust
`flattenToLeaf` to explicitly cast `node.children` to `PhrasingContent[]` where
that phrasing-specific assumption is valid. Keep the existing runtime check
logic and update only the typings around `hasChildren` and `flattenToLeaf`.
In
`@packages/app/src/features/NoteEditor/RichEditor/plugins/Markdown/remark/remarkPreserveBlankLines.ts`:
- Around line 41-48: The inserted empty paragraph in remarkPreserveBlankLines
uses a fixed offset of 0, which makes its source position inaccurate. Update the
emptyLine position object so the offset is derived from the actual blank line
location instead of a constant, and keep the line/column mapping consistent with
the surrounding logic in remarkPreserveBlankLines. Use the existing line-based
position construction to locate where the paragraph is created and adjust both
start and end offsets accordingly.
- Around line 65-67: The remarkPreserveBlankLines plugin wrapper is now unused
because markdownParser already invokes fillGapsWithParagraphs directly. Remove
the remarkPreserveBlankLines export/wrapper from remarkPreserveBlankLines.ts,
and update any remaining imports or references so the codebase uses
fillGapsWithParagraphs directly without the extra Plugin wrapper.
In `@packages/app/src/features/NoteEditor/RichEditor/RichEditorContent.tsx`:
- Line 72: The useImperativeHandle call in RichEditorContent is missing a
dependency array, causing editorRef to be reassigned on every render. Update the
useImperativeHandle invocation to depend on editor from
useLexicalComposerContext, so the handle is only refreshed when the editor
instance changes. This should be applied in RichEditorContent where editorRef is
wired to editor.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 96dd503a-85ed-45ed-8b6c-b8bbb446545d
⛔ Files ignored due to path filters (2)
package-lock.jsonis excluded by!**/package-lock.jsonpackages/app/src/features/NoteEditor/RichEditor/plugins/Markdown/__tests__/__snapshots__/markdown-roundtrips-consistency.test.ts.snapis excluded by!**/*.snap
📒 Files selected for processing (24)
packages/app/.env.examplepackages/app/.gitignorepackages/app/package.jsonpackages/app/src/features/NoteEditor/RichEditor/RichEditor.tsxpackages/app/src/features/NoteEditor/RichEditor/RichEditorContent.tsxpackages/app/src/features/NoteEditor/RichEditor/__tests__/utils/renderEditorInDOM.tsxpackages/app/src/features/NoteEditor/RichEditor/__tests__/utils/renderRichEditor.tsxpackages/app/src/features/NoteEditor/RichEditor/plugins/CodeHighlightPlugin.tsxpackages/app/src/features/NoteEditor/RichEditor/plugins/EditorPanelPlugin/EditorPanelPlugin.tsxpackages/app/src/features/NoteEditor/RichEditor/plugins/EditorPanelPlugin/utils/tree.tsxpackages/app/src/features/NoteEditor/RichEditor/plugins/KeyboardControlsPlugin/KeyboardControlsPlugin.tspackages/app/src/features/NoteEditor/RichEditor/plugins/Markdown/__tests__/markdown-roundtrips-consistency.test.tspackages/app/src/features/NoteEditor/RichEditor/plugins/Markdown/__tests__/markdown-samples/index.tspackages/app/src/features/NoteEditor/RichEditor/plugins/Markdown/__tests__/paragraphs.browser.test.tspackages/app/src/features/NoteEditor/RichEditor/plugins/Markdown/__tests__/utils.tspackages/app/src/features/NoteEditor/RichEditor/plugins/Markdown/convertLexicalNodeToMarkdownNode.tspackages/app/src/features/NoteEditor/RichEditor/plugins/Markdown/markdownParser.tspackages/app/src/features/NoteEditor/RichEditor/plugins/Markdown/remark/remarkLiftFormatting.tspackages/app/src/features/NoteEditor/RichEditor/plugins/Markdown/remark/remarkPreserveBlankLines.test.tspackages/app/src/features/NoteEditor/RichEditor/plugins/Markdown/remark/remarkPreserveBlankLines.tspackages/app/src/features/NoteEditor/RichEditor/plugins/Markdown/serializeMarkdownTree.test.tspackages/app/src/features/NoteEditor/RichEditor/theme/RichEditor.csspackages/app/tsconfig.jsonpackages/app/vitest.config.mts
✅ Files skipped from review due to trivial changes (4)
- packages/app/src/features/NoteEditor/RichEditor/plugins/EditorPanelPlugin/utils/tree.tsx
- packages/app/.gitignore
- packages/app/src/features/NoteEditor/RichEditor/plugins/Markdown/tests/markdown-samples/index.ts
- packages/app/src/features/NoteEditor/RichEditor/plugins/Markdown/tests/utils.ts
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
packages/app/src/features/NoteEditor/RichEditor/RichTextContainer.tsx (1)
22-22: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick winPlace
classNameafter{...props}to prevent silent override.If a consumer passes
classNameviaprops, the spread at line 23 will overwrite"RichEditor", removing the--re-*CSS custom properties that all editor spacing depends on. MovingclassNameafter the spread (or merging) ensures the base class is always present.♻️ Proposed fix
<Box w="100%" maxH="100%" outline="none" padding="1rem 1rem 5rem" overflow="auto" - className="RichEditor" {...props} + className="RichEditor" asChild >🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/app/src/features/NoteEditor/RichEditor/RichTextContainer.tsx` at line 22, Ensure the base “RichEditor” class is always retained in the RichTextContainer element by placing className after the {...props} spread or merging the consumer-provided className with it. Update the JSX props order near the RichEditor class without changing other prop behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/app/src/features/NoteEditor/RichEditor/theme/RichEditor.css`:
- Around line 510-528: Update the color variable references at the noted
RichEditor.css locations to use the defined typography.base and link.base
tokens, replacing the non-existent typography and link variables while
preserving link hover styling.
---
Nitpick comments:
In `@packages/app/src/features/NoteEditor/RichEditor/RichTextContainer.tsx`:
- Line 22: Ensure the base “RichEditor” class is always retained in the
RichTextContainer element by placing className after the {...props} spread or
merging the consumer-provided className with it. Update the JSX props order near
the RichEditor class without changing other prop behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 1d487325-8629-470e-85d8-7de8c499217a
📒 Files selected for processing (4)
.github/workflows/codeql.ymlpackages/app/src/features/NoteEditor/RichEditor/RichEditorContent.tsxpackages/app/src/features/NoteEditor/RichEditor/RichTextContainer.tsxpackages/app/src/features/NoteEditor/RichEditor/theme/RichEditor.css
💤 Files with no reviewable changes (1)
- packages/app/src/features/NoteEditor/RichEditor/RichEditorContent.tsx
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.github/workflows/codeql.yml (1)
25-59: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick winRestrict the test job’s
GITHUB_TOKENpermissions.Without an explicit
permissionsblock, this job inherits repository/org defaults while executing repository-controlled install, test, and build commands. Set the minimum required permissions, such ascontents: read, and grant additional permissions only to jobs that need them.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/codeql.yml around lines 25 - 59, Add a job-level permissions block to the tests job, granting only contents: read for checkout and repository access. Do not grant write or unrelated permissions; leave additional permissions to jobs that explicitly require them.Source: Linters/SAST tools
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In @.github/workflows/codeql.yml:
- Around line 25-59: Add a job-level permissions block to the tests job,
granting only contents: read for checkout and repository access. Do not grant
write or unrelated permissions; leave additional permissions to jobs that
explicitly require them.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: da71a8cc-45f4-4adc-afb3-d88bf636ac8b
📒 Files selected for processing (3)
.github/workflows/codeql.ymlpackages/app/README.mdpackages/app/src/features/NoteEditor/RichEditor/theme/RichEditor.css
💤 Files with no reviewable changes (1)
- packages/app/src/features/NoteEditor/RichEditor/theme/RichEditor.css
|
@coderabbitai full review |
✅ Action performedFull review finished. Your plan includes PR reviews subject to rate limits. More reviews will be available in 40 minutes. |
Fix #327
We have problem with follows text
# Why Russian Classics Feel So Different I've noticed that after finishing a Russian novel I rarely want to start another book immediately. It's not because the stories are difficult. It's because they seem to leave unfinished conversations in my head. Instead of remembering the plot, I keep thinking about the questions the characters were asking themselves.It leaves empty line as a paragraph, so we have 3 paragraphs in result.
When we remove that paragraph, we have 2 paragraph in Lexical, but only one paragraph in Markdown, so when MD converts back into Lexical we have only one paragraph.
Summary by CodeRabbit
Summary
New Features
Bug Fixes
Style
Chores / Tests