Skip to content

fix: enforce minimum footer font size and truncate long text (#24) - #26

Merged
HarrisJDCampbell merged 1 commit into
HarrisJDCampbell:mainfrom
DrashtiC07:feat-footer-min-font-size
Oct 30, 2026
Merged

HarrisJDCampbell merged 1 commit into
HarrisJDCampbell:mainfrom
DrashtiC07:feat-footer-min-font-size

Conversation

@DrashtiC07

Copy link
Copy Markdown
Contributor

Closes #24

Summary

Previously, custom footers scaled down without a lower bound to fit within the court width. For very long footer text, this resulted in font sizes collapsing below readable thresholds.

This change:

  • Enforces a minimum footer font size of 7 (scaling down from max 10).
  • If the text still exceeds the available width (W - 2 * GX = 868px) at font size 7, it truncates the string with an ellipsis (…).
  • Truncation occurs before escapeXml(), preventing split XML entities (e.g. &).
  • Adds test cases in test/render.test.mjs verifying scaling without truncation, truncation at font size 7, and XML entity preservation.

@coderabbitai

coderabbitai Bot commented Oct 27, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e0f373c9-5159-4de9-87a4-9816ae93be5e
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@HarrisJDCampbell

Copy link
Copy Markdown
Owner

Thanks! Truncating before escapeXml is the detail that matters here, since cutting after would chop & in half, and you tested exactly that. Tried a long footer and it sits at 7px with the ellipsis right at the edge. Merging.

@HarrisJDCampbell
HarrisJDCampbell merged commit cc39393 into HarrisJDCampbell:main Oct 30, 2026
5 checks passed
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.

Give long custom footers a minimum font size

2 participants