Skip to content

fix(obs-list): draw the Obs Lists picker with the shared menu layout (uses the full rev4 display) - #704

Merged
brickbots merged 1 commit into
mainfrom
fix/obslist-picker-resolution
Nov 19, 2026
Merged

brickbots merged 1 commit into
mainfrom
fix/obslist-picker-resolution

Conversation

@brickbots

Copy link
Copy Markdown
Owner

On a rev4 unit, the observing-list screen (Objects → Obs Lists) now uses the whole display. It shows 9 lines, and the selection box is at the center of the screen.

Problem

On rev4 (the 176 × 176 display), the Obs Lists screen did not use all of the display:

  • It showed only 3 lists below the selection box.
  • The selection box was too high, and it did not go across the full width.

Thus, the screen showed fewer observing lists than the unit had. The other menus on rev4 were correct.

Cause

UIObsList (ui/obs_list.py) had its own copy of the old menu drawing code. That code used fixed positions for the 128 × 128 display: 7 lines, and a selection box at (-1, 60, 129, 80). PR #453 changed UITextMenu to calculate the layout from the display, but it did not change this copy.

Change

The Obs Lists screen now uses the same drawing code as all other menus.

  • UIObsList has no drawing loop now. UITextMenu.update() draws the lines and the selection box with carousel_layout().
  • UITextMenu has a new small method, _draw_item_text(). It draws the text of one item. A subclass can replace it to change how an item is drawn, but the subclass keeps the shared layout.
  • UIObsList replaces only _draw_item_text(). On the selected line, the name scrolls when it is too long. This was the only function that the old copy added.

Lines of code: obs_list.py +19 / −53, text_menu.py +17 / −3. A new test file, tests/test_obs_list_layout.py, has 6 tests at 128 and 176. The tests fail on the old code and pass on the new code.

Screenshots

Before (left) and after (right), with 11 test lists and 1 folder.

rev4, 176 × 176:

(Screenshot to attach: rev4 before and after, before_after_rev4_176.png.)

v3, 128 × 128:

(Screenshot to attach: 128 px before and after, before_after_v3_128.png.)

On the 128 display, the lines move down by 1 to 4 pixels. The selection box moves down by 2 pixels. This is the same change that all other 128 menus got in #453. Now the Obs Lists screen looks the same as the Objects menu on a v3 unit.

Other screens in the observing-list flow

I examined the other screens for fixed 128-pixel positions:

  • Folder view (a subfolder in obslists/): this is UIObsList too, so this change repairs it.
  • Opened list: this is UIObjectList. It already uses list_layout() and is correct on rev4.
  • "Loaded n/m objects" message: this is UIModule.message(). It already calculates its size from the display.

I found no other fixed positions. The other 128 values in these files are colour brightness values, not positions.

One old behaviour does not change: the scrolling text on the selected line uses the full display width for its length, but it starts at the text indent. Thus, the last character can go off the right edge while the text scrolls. This occurs on both displays and it occurred before this change.

Tests

  • nox -s lint format type_hints smoke_tests unit_tests: all pass (2303 unit tests).
  • I ran the app headless at 176 and at 128, and I examined the picker, a long name that scrolls, a folder, and an opened list.

🤖 Generated with Claude Code

On rev4 (176x176) the Obs Lists picker showed only 3 rows below a
selection box that sat too high and stopped at x=129. UIObsList had its
own copy of the pre-#453 UITextMenu drawing loop, with fixed 128-px
row positions and a fixed selection box.

Remove that loop. UITextMenu.update now draws each item through a small
_draw_item_text() hook, and UIObsList overrides only that hook to scroll
the selected item when it is too long. Rows, fonts, brightness and the
selection box now come from carousel_layout(), as in every other menu.

On 128x128 the rows move down 1-4 px, the same shift the other menus
got in #453.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@brickbots
brickbots merged commit 610f682 into main Nov 19, 2026
4 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.

1 participant