Repository navigation
test: pin that drawButton does not clip an oversized label - #57
Merged
Merged
Conversation
The drawButton docstring described the label as "centered within the box", but the label is drawn onto the whole surface, so one too large for its box overflows past the box edges. Pin that behavior, and that the overflow is not clickable, and document it in the docstring and README. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
|
Self-review rubric (anchor:
src/test/python/preponderous/graphik/test_graphik.py:897 — This review comment was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener). drafted by Claude on behalf of Daniel Stephenson |
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.
Summary
Stage B (unit-test expansion) for
drawButton, with the matching doc correction.drawButtondocstring describedtextas "The label, centered within the box", which implies the label is contained by the box. It is not: the label is drawn withdrawTextonto the whole surface, so a label too large for its box overflows past the box edges. An empirical probe (4x4 box, size-20"WWWW"label) painted 172 pixels outside the box.test_draw_button_does_not_clip_a_label_larger_than_the_box, is added. It pins that the overflow is painted, and that a press on an overflowing label pixel outside the box does not fire the callback (the hit test covers only the box).drawButtonbullet are updated to state both facts.No production behavior is changed. The change is purely additive and touches no public signature, so no consumer-impact check applies.
No tracking issue — gap found during triage.
Test plan
python3 -m py_compile src/main/python/preponderous/graphik/graphik.pypython3 -m pytest(headless viaconftest.py): 69 passed (68 previously plus 1 new)set_clipto the box around thedrawTextcall) was temporarily injected intodrawButton, and to pass once it was removed.Deferred issues
.github/workflows/or to the release/tagging process, both excluded from autonomous change.preponderous/__init__.pydepends on a maintainer decision about the namespace convention used by siblingpreponderous.*projects, which cannot be settled from this repository.This PR description was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).
🤖 Generated with Claude Code
drafted by Claude on behalf of Daniel Stephenson