Skip to content

Bugfix/let tasklist follow fontsize#88

Open
FrankLiu007 wants to merge 6 commits into
Tsuzat:nextfrom
FrankLiu007:bugfix/let-tasklist-follow-fontsize
Open

Bugfix/let tasklist follow fontsize#88
FrankLiu007 wants to merge 6 commits into
Tsuzat:nextfrom
FrankLiu007:bugfix/let-tasklist-follow-fontsize

Conversation

@FrankLiu007

@FrankLiu007 FrankLiu007 commented Jul 23, 2026

Copy link
Copy Markdown

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

before:
QQ_1784770226062
after:
QQ_1784771630795

Summary by CodeRabbit

  • New Features
    • Added a Font Size tool to the editor toolbar.
    • Task list rendering now scales checkbox and text visuals per task item using the largest explicit font size found.
  • Bug Fixes
    • Fixed task list checkbox/checkmark sizing to be font-relative instead of fixed rem-based dimensions.
    • Improved checked-task visuals by moving the strike-through rendering to the task text (with consistent alignment/line-height) and using muted styling for the container.

@vercel

vercel Bot commented Jul 23, 2026

Copy link
Copy Markdown

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.

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Task 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.

Changes

Task list font-size synchronization

Layer / File(s) Summary
Task item font-size decoration
src/lib/edra/tiptap/extensions/TaskListFontSize.ts
Parses descendant text-style font sizes, ignores nested task lists, applies the largest explicit size through --edra-task-font-size, and marks unstyled text in checked items.
Extension export and editor wiring
src/lib/edra/tiptap/extensions/index.ts, src/lib/edra/extensions.ts
Re-exports TaskListFontSize and adds it to the default Tiptap extension array.
Task list typography and checkbox styles
src/lib/edra/headless/editor.css, src/lib/edra/shadcn/editor.css
Uses the font-size variable and em units for task labels, checked paragraphs, checkbox dimensions, and checkmarks.
Font-size toolbar integration
src/lib/edra/headless/components/Toolbar.svelte, src/lib/edra/shadcn/components/Toolbar.svelte
Imports and renders the FontSize tool in both toolbar variants.

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
Loading

Suggested reviewers: tsuzat

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: making task lists follow the editor font size.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 6ab5a72 and 26ebe37.

📒 Files selected for processing (5)
  • src/lib/edra/extensions.ts
  • src/lib/edra/headless/editor.css
  • src/lib/edra/shadcn/editor.css
  • src/lib/edra/tiptap/extensions/TaskListFontSize.ts
  • src/lib/edra/tiptap/extensions/index.ts

Comment thread src/lib/edra/tiptap/extensions/TaskListFontSize.ts Outdated
Comment thread src/lib/edra/tiptap/extensions/TaskListFontSize.ts Outdated
@FrankLiu007

FrankLiu007 commented Jul 23, 2026

Copy link
Copy Markdown
Author

There will need another fix. When the text of a tasklist contains more than one fontsize, which fontsize should the tasklist follow? of course, it should follow the biggest fontsize for the inline text.

QQ_1784789233700

@FrankLiu007

Copy link
Copy Markdown
Author

I think everything is fine now.

…hall be rendered for this task, aligned to the font size of the largest text within the content.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 win

Avoid reapplying relative font sizes to checked task items. The task item li and the checked p both use --edra-task-font-size, so values like 2em compound 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

📥 Commits

Reviewing files that changed from the base of the PR and between c24de35 and 94f14c6.

📒 Files selected for processing (3)
  • src/lib/edra/headless/editor.css
  • src/lib/edra/shadcn/editor.css
  • src/lib/edra/tiptap/extensions/TaskListFontSize.ts

text-decoration: none;
box-decoration-break: clone;
-webkit-box-decoration-break: clone;
background-image: linear-gradient(currentColor, currentColor);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 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 to currentcolor.
  • src/lib/edra/shadcn/editor.css#L257-L257: change both gradient values to currentcolor.
🧰 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants