Repository navigation
splash_screen uses epdlib text_fit; test that no sample text is cut (M7) - #250
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #249
What changed
splash_screentries several ways of breaking an address (after a "/", then after ".", "-" or ":") until one is drawn whole. Each try was checked by calling epdlib's internaltext.fit_textwith the block's settings copied by hand (font, size, width, height, max_lines, shrink, ellipsis). Now each try is one call to epdlib's newprepared.text_fit(name, option)(txoof/epdlib#91), which uses the block's real settings, so the check can't drift from what epdlib draws.fit_address(prepared, name, address)replacesfit_address(address, font, size, width, height, max_lines, ellipsis). The quick check that skips tries too wide even at the smallest size stays (it keeps long names fast).text_fittoo, instead of its own copy of the block's settings and padding sum.tests/test_all_plugins.py(txoof asked for a few cases, not every layout): each plugin's default layout, drawn with its sample data on a 9.7" (1200x825) and a 2.7" (264x176) screen, must not cut any text with "…". Text made smaller byshrinkis allowed. 22 cases; all pass today. Checked that it fails with a too-long sample hostname.pyproject.tomlanduv.lock.Area
plugins/splash_screen, ci (epdlib pin only), tests.
Tests
uv run pytestpasses (1330 passed; reference images unchanged)uv run ruff check .passesReview
Only txoof approves and merges this PR.
🤖 Generated with Claude Code