Conversation
Blank lines were skipped by the line replacement logic, causing ordered and unordered list toolbar actions to do nothing in an empty editor.
List commands were calling getCursor on the raw EditorView retained by the command adapter. Read the current line directly from CodeMirror state so toolbar actions reach the list insertion logic.
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The added pnpm test script is likely not running the new deep-nested test file due to non-recursive glob expansion in typical package-script shells.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
Open (2)
What changed in this PR
Fixes the editor toolbar’s ordered/unordered list actions so they work when invoked in an empty (or blank-line) CodeMirror editor, and adds regression coverage plus a small Sass cleanup.
Changes:
- Update list insertion commands to read the active line via CodeMirror selection state and insert a Markdown list marker on blank lines.
- Add Node
--test-based regression tests for ordered and unordered list toolbar commands through the CodeMirror adapter. - Reorder a Sass declaration in the comment component to avoid Sass mixed-declaration warnings.
| File | Description |
|---|---|
| ui/src/components/Editor/utils/codemirror/commands.ts | Inserts list markers on blank lines and reads active line from CodeMirror selection state. |
| ui/src/components/Editor/utils/codemirror/commands.test.cjs | Adds regression tests for list toolbar behavior via the CodeMirror adapter. |
| ui/src/components/Comment/index.scss | Moves border-bottom before nested rules to avoid Sass warnings. |
| ui/package.json | Adds a pnpm test script for running the new Node tests. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Fixes #1620
Proposed Changes
adapter-only
getCursor()method.1.or-) when a list action isused on a blank line.
through the CodeMirror adapter.
mixed-declaration warning.
Verification
cd ui && pnpm testcd ui && pnpm build