Bugfix/let tasklist follow fontsize#88
Conversation
|
Someone is attempting to deploy a commit to the Alok Singh's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughTask list font sizes are derived from Tiptap text-style marks and exposed through a CSS variable. The editor registers the extension, both themes scale task-list controls from that variable, and both toolbars render the font-size control. ChangesTask list font-size synchronization
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant TextStyleMark
participant TaskListFontSize
participant TaskListCSS
participant TaskCheckbox
TextStyleMark->>TaskListFontSize: Provide task text fontSize
TaskListFontSize->>TaskListCSS: Set --edra-task-font-size
TaskListCSS->>TaskCheckbox: Scale checkbox and checkmark with em units
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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 `@src/lib/edra/tiptap/extensions/TaskListFontSize.ts`:
- Around line 20-24: Validate the fontSize value in the mark lookup and before
assigning it in the TaskListFontSize extension, accepting only the supported CSS
length grammar. Reject values containing declarations or other invalid syntax so
untrusted document content cannot be interpolated into the task item’s inline
style, while preserving valid font-size values.
- Around line 17-27: Update the descendant traversal in the task-list font-size
logic to stop when it reaches a nested task item, preventing its text marks from
determining the parent checkbox size. Preserve scanning the current task item’s
own content and existing font-size detection 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: f919e01b-ceec-42b6-ad0d-57cb22ca7258
📒 Files selected for processing (5)
src/lib/edra/extensions.tssrc/lib/edra/headless/editor.csssrc/lib/edra/shadcn/editor.csssrc/lib/edra/tiptap/extensions/TaskListFontSize.tssrc/lib/edra/tiptap/extensions/index.ts
|
I think everything is fine now. |
…hall be rendered for this task, aligned to the font size of the largest text within the content.
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/lib/edra/tiptap/extensions/TaskListFontSize.ts (1)
6-22: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winAvoid reapplying relative font sizes to checked task items. The task item
liand the checkedpboth use--edra-task-font-size, so values like2emcompound inside the paragraph and render larger than intended. Keep the paragraph font size normalized for relative units, and add a checked-task regression test. Drop the%example unless that unit is supported here.🤖 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 `@src/lib/edra/tiptap/extensions/TaskListFontSize.ts` around lines 6 - 22, The fontSizeToPx normalization must prevent relative checked-task paragraph sizes from compounding with the task item’s --edra-task-font-size. Update the checked-task paragraph styling to use the normalized font-size value for relative units, preserve the existing behavior for supported absolute units, and add a regression test covering a checked task with a value such as 2em. Do not add a percent example unless percent parsing is supported by fontSizeToPx.
🤖 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 `@src/lib/edra/headless/editor.css`:
- Line 524: Fix the Stylelint keyword casing in the gradient declarations:
update both gradient values to currentcolor in src/lib/edra/headless/editor.css
at lines 524-524 and src/lib/edra/shadcn/editor.css at lines 257-257.
---
Outside diff comments:
In `@src/lib/edra/tiptap/extensions/TaskListFontSize.ts`:
- Around line 6-22: The fontSizeToPx normalization must prevent relative
checked-task paragraph sizes from compounding with the task item’s
--edra-task-font-size. Update the checked-task paragraph styling to use the
normalized font-size value for relative units, preserve the existing behavior
for supported absolute units, and add a regression test covering a checked task
with a value such as 2em. Do not add a percent example unless percent parsing is
supported by fontSizeToPx.
🪄 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: c2dce9d7-7d86-43bd-b518-457d4c0e6979
📒 Files selected for processing (3)
src/lib/edra/headless/editor.csssrc/lib/edra/shadcn/editor.csssrc/lib/edra/tiptap/extensions/TaskListFontSize.ts
| text-decoration: none; | ||
| box-decoration-break: clone; | ||
| -webkit-box-decoration-break: clone; | ||
| background-image: linear-gradient(currentColor, currentColor); |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Fix the Stylelint keyword casing error.
currentColor violates the configured value-keyword-case rule.
src/lib/edra/headless/editor.css#L524-L524: change both gradient values tocurrentcolor.src/lib/edra/shadcn/editor.css#L257-L257: change both gradient values tocurrentcolor.
🧰 Tools
🪛 Stylelint (17.14.0)
[error] 524-524: Expected "currentColor" to be "currentcolor" (value-keyword-case)
(value-keyword-case)
[error] 524-524: Expected "currentColor" to be "currentcolor" (value-keyword-case)
(value-keyword-case)
📍 Affects 2 files
src/lib/edra/headless/editor.css#L524-L524(this comment)src/lib/edra/shadcn/editor.css#L257-L257
🤖 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 `@src/lib/edra/headless/editor.css` at line 524, Fix the Stylelint keyword
casing in the gradient declarations: update both gradient values to currentcolor
in src/lib/edra/headless/editor.css at lines 524-524 and
src/lib/edra/shadcn/editor.css at lines 257-257.
Source: Linters/SAST tools

make the position and size of tasklist follow the text font size
before:


after:
Summary by CodeRabbit