Skip to content

M3.57: preserve fractional CSS gradient stop positions - #3284

Open
MMexicann wants to merge 1 commit into
storytold:mainfrom
MMexicann:fix/css-swatch-stop-precision
Open

MMexicann wants to merge 1 commit into
storytold:mainfrom
MMexicann:fix/css-swatch-stop-precision

Conversation

@MMexicann

@MMexicann MMexicann commented Oct 20, 2026 •

Copy link
Copy Markdown

What and why

CSS swatch export rounded every gradient stop to a whole percentage. Stops at 12.5% and 12.890625% both became 13%, turning a narrow blend into a hard edge. Preserve fractional percentages in linear and radial swatches.

Updates the required M3.57 progress evidence; scores and estimates are unchanged.

How it was tested

Added an original synthetic regression for both gradient kinds, including integer endpoints. It fails before the fix because the nearby stops collapse to 13%.

cargo xtask ci passed all ten steps on Windows: 8,570 workspace tests passed (13 ignored), the no-bundled-fonts test passed, and all 23 WebAssembly checks passed. Validation used writable task-local TEMP/TMP directories.

Checklist

  • cargo xtask ci passes (fmt, strict clippy, tests, no-bundled-fonts, PDF dependencies, assets, brands, cursors, layers, wasm).
  • No panics introduced in shipped code; the production change removes rounding.
  • Clean-room: original synthetic fixture and public CSS specification; no proprietary assets or GPL/AGPL code.
  • No assets added.

Summary by CodeRabbit

  • Bug Fixes

    • CSS linear and radial gradients now preserve fractional stop positions instead of rounding them to whole percentages.
  • Tests

    • Added regression coverage to verify fractional gradient stop positions.
  • Documentation

    • Updated roadmap and parity documentation to reflect improved gradient swatch fidelity.

@coderabbitai

coderabbitai Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: storytold/vectorcraft/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 34634e09-8ae0-4a47-98b0-062f293608fb
📥 Commits

Reviewing files that changed from the base of the PR and between bc1ae08 and b28979f.

📒 Files selected for processing: 3
  • crates/color/src/palette_io.rs
  • docs/roadmap.md
  • docs/target-app-parity.md

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.

📝 Walkthrough

CSS gradient stop positions now retain fractional percentages in generated declarations. Regression coverage checks linear and radial gradients. The roadmap and parity documentation record the change.

Changes: CSS gradient stop preservation

Layer / File(s) Summary
Preserve fractional CSS gradient stops
crates/color/src/palette_io.rs, docs/roadmap.md, docs/target-app-parity.md
CSS gradient declarations preserve fractional stop percentages. Regression tests cover linear and radial gradients. The roadmap and parity records describe the change. Scores and estimates remain unchanged.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: bflatastic, huge, kaboomfox

Merge Risk: ⚪ Minimal · up to b2897

No actionable merge-blocking risk remains in the reviewed changes.

Architecture risk: 🔵 Low · up to b2897

The change affects 2 systems.

Changed systems: crates, docs

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — crates (service) was modified; 1 changed file maps to changed impact.
  • observed — docs (service) was modified; 2 changed files map to changed impact.

Before / after behavior

  • observed — Modified behavior in crates/color/src/palette_io.rs: CSS gradient stop percentages no longer round offset * 100; fractional values are preserved in generated declarations.
  • observed — Modified behavior in crates/color/src/palette_io.rs: Added a regression test covering linear and radial CSS gradients with fractional stop positions, including 12.5% and 12.890625% output.
  • observed — Modified behavior in docs/roadmap.md: The roadmap metadata now records fractional CSS swatch gradient stop preservation and its synthetic regression coverage.
  • observed — Modified behavior in docs/roadmap.md: The M3 milestone now states that CSS library export preserves fractional linear and radial gradient stop positions.
Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 1 files. (2 skipped: 2… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: preserving fractional CSS gradient stop positions.
Description check Passed The description covers the change, reason, testing, regression coverage, CI results, and checklist items. It matches the repository template and provides sufficient implementation evidence.
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.
Full details: Docstring Coverage

Explanation

Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 1 files. (2 skipped: 2 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

🔧 LanguageTool
docs/target-app-parity.md

LanguageTool checks are incomplete because the per-file request limit of 5 was reached. Remaining text was skipped; findings from completed checks are retained.

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

This branch has not been deployed

No deployments
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.

1 participant