Skip to content

fix(fontless): prefer concrete fallbacks declared in css - #855

Merged
danielroe merged 2 commits into
mainfrom
fix/concrete-fallbacks
Sep 23, 2026
Merged

danielroe merged 2 commits into
mainfrom
fix/concrete-fallbacks

Conversation

@danielroe

@danielroe danielroe commented Sep 23, 2026 •

Copy link
Copy Markdown
Member

a bug of very long standing

Summary by CodeRabbit

  • Bug Fixes
    • Font fallback selection prioritizes explicit override fallbacks, then combines concrete CSS-declared fallback families with category defaults without duplicates. Generic families and provider-reported categories are used when no concrete CSS fallbacks are provided.

@netlify

netlify Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for fontless ready!

Name Link
🔨 Latest commit d06c290
🔍 Latest deploy log https://app.netlify.com/projects/fontless/deploys/6ab3f1d7a5c2ac000710760a
😎 Deploy Preview https://deploy-preview-855--fontless.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai

coderabbitai Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: a8583b9f-5acd-4071-b059-c9bd233a10dd

📥 Commits

Reviewing files that changed from the base of the PR and between 25d3000 and d06c290.

📒 Files selected for processing (2)
  • packages/fontless/src/resolve.ts
  • packages/fontless/test/resolve.spec.ts

Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

Fallback resolution now combines CSS-declared concrete fallbacks with category defaults and removes duplicates. Explicit override fallbacks take precedence. Tests cover concrete fallback handling and precedence.

Changes

Fallback resolution

Layer / File(s) Summary
Fallback precedence and validation
packages/fontless/src/resolve.ts, packages/fontless/test/resolve.spec.ts
resolveFallbacks receives full fallback options and provider-reported fallbacks. It merges CSS-declared concrete fallbacks with category defaults and removes duplicates. Explicit override fallbacks take precedence.

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

Merge Risk: ⚪ Minimal · up to d06c2

The fallback change is mergeable after normal checks; no actionable issue remains.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: preferring concrete fallbacks declared in CSS.
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.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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.

❤️ Share

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

@pkg-pr-new

pkg-pr-new Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/fontaine@855
npm i https://pkg.pr.new/fontless@855

commit: d06c290

@danielroe
danielroe requested a review from gioboa September 23, 2026 14:28
@codecov

codecov Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (6499534) to head (d06c290).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #855   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           17        17           
  Lines         1175      1178    +3     
  Branches       367       368    +1     
=========================================
+ Hits          1175      1178    +3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@gioboa gioboa left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nice 👍

@danielroe
danielroe added this pull request to the merge queue Sep 23, 2026
Merged via the queue into main with commit cc46300 Sep 23, 2026
12 checks passed
@danielroe
danielroe deleted the fix/concrete-fallbacks branch September 23, 2026 18:54
@github-actions github-actions Bot mentioned this pull request Sep 23, 2026
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