Make the focus strip resolution-flexible (fix 176x176 layout)#454
Merged
Conversation
The focus-quality (HFD) strip was added in #449 before the resolution-flexible UI work in #453. #453 converted the camera preview's image resize and star selectors to derive from the display resolution but never touched draw_focus_strip(), which kept 128-only literals: strip_top = 90 # bottom-band top plot_top = +9 # V-curve top clearance plot_bottom = -10 # V-curve bottom clearance bottom label = -9 On the 176x176 SSD1333 panel strip_top=90 lands mid-screen (~51% down) instead of as a bottom band, stranding the exposure/matched-star labels high up with a large empty gap above the readout, and the bottom detected-star label clips at the screen edge. Derive the geometry instead (ADR 0009): - strip_top: a fixed fraction of screen height (res_y - res_y*38/128), so the band stays ~30% of the screen on any panel. - label-row clearances: from self.fonts.small.height, so the rows track the (larger) small font on the 176 panel and never collide with the V-curve. The 128 small font is 9 px, so strip_top+9 == strip_top+small_h, res_y-10 == res_y-small_h-1, and res_y-9 == res_y-small_h: the 128 layout is reproduced pixel-for-pixel (zero regression), while the 176 layout becomes a correct proportional bottom band. Verified headless on both DisplayHeadless (128) and DisplayHeadless176 (176). Docs: update the CONTEXT.md focus-strip glossary entry, which described a fixed "~38 px" band, to note it scales with the display. Co-Authored-By: Claude Opus 4.8 (1M context) <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.
Problem
The focus-quality (HFD) focus strip is not fully resolution-independent. It was added in #449 before the resolution-flexible UI work in #453. #453 converted the camera preview's image resize and star selectors to derive from the display resolution, but never touched
draw_focus_strip(), which kept 128-only pixel literals:On the 176×176 SSD1333 panel,
strip_top = 90lands mid-screen (~51% down) instead of as a bottom band: the exposure / matched-star labels are stranded high up with a large empty gap above the readout, and the bottom detected-star label clips at the screen edge.Before / after (headless render)
detclippedOn 176 before the fix, the dim band started ~halfway up the screen with
0.4s/★labels floating far above the big readout. After the fix it's a tidy bottom band matching the 128 proportions.Fix
Derive the geometry instead of hardcoding it (per ADR 0009):
strip_top— a fixed fraction of screen height (res_y - round(res_y * 38 / 128)), so the band stays ~30% of the screen on any panel.self.fonts.small.height, so the rows track the larger small font on the 176 panel and never collide with the V-curve.Because the 128 small font is 9 px,
strip_top + 9 == strip_top + small_h,res_y - 10 == res_y - small_h - 1, andres_y - 9 == res_y - small_h— the 128 layout is reproduced pixel-for-pixel (zero regression) while the 176 layout becomes a correct proportional bottom band.Verification
DisplayHeadless(128×128) andDisplayHeadless176(176×176) and confirmed the strip is a clean bottom band on each, with no stranded labels or clipping.nox -s lint/format/type_hints(158 files) all pass.nox -s smoke_tests(5) andnox -s unit_tests(280, incl.test_focus.py) all pass.Docs
Updates the
docs/ax/ui/CONTEXT.mdfocus strip glossary entry, which described a fixed "~38 px" band, to note it scales with the display.🤖 Generated with Claude Code