Repository navigation
fix: adapt to every board geometry - #1
Merged
Merged
Conversation
layout_lines() always returned exactly three lines and never read
board.rows -- on a 30x12 panel 9 rows stayed blank, on 120x24, 21 did.
It now derives the line budget from board.rows and uses any rows
beyond the featured session's three to list other active sessions and
then playback detail, bounded by the board like every other plugin
list should be.
Also fixes a real overflow: for Track sessions the artist ("middle")
was returned unmodified while the album ("bottom") was correctly
ellipsized, so a long artist name produced a row wider than the board
(trivial on a 15-col Note). It is now ellipsized the same way.
Manifest: removed max_length: 22 from title/show/artist/album/user/
player (both as simple vars and their sessions.* mirrors) -- these are
verbatim, unbounded Plex metadata the code never truncates, so a fixed
bound narrower than what the code can emit and wider than a Note can
fit was dishonest in both directions. Added a "Note Array (tall)"
preview (1 wide x 4 tall, 15x12 -- the narrower-than-Flagship,
taller-than-Note trap) alongside the existing wide one. Bumped the
patch version.
Added the shared board-geometry conformance test with
strict_growth=True (this plugin renders a session list) and
require_note_array_preview=True, plus unit coverage for the new
row-growth behavior and the Track ellipsize fix.
Co-Authored-By: Claude <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.
What was broken
layout_lines()(__init__.py:107-136before this change) always returned exactlythree lines and never read
board.rows— onlyboard.colswas read anywhere in thefile. On a 30x12 FiestaPanel, 9 rows stayed blank; on the 120x24 max array, 21 did.
The fix derives the line budget from
board.rowsand fills anything beyond thefeatured session's three lines with other active sessions, then playback detail —
never more than
board.rows, never fewer just because there was nothing left to add.middle = session["artist"]was returned unmodified asline_2at both return points, while
bottom(album) was passed throughellipsize. Anartist name longer than the board's width produced a row wider than the board —
trivial on a 15-col Note. Now ellipsized the same way as the album.
title,show,artist,album,user,player, as bothsimple vars and their
sessions.*mirrors) declaredmax_length: 22— wider than aNote (15) can fit, and dishonest in the other direction too: this is verbatim,
unbounded Plex metadata the code never truncates, so no fixed number is an honest
promise. Removed the bound rather than fabricate one; the page editor's fit-checker
no longer claims a false guarantee on either axis for these fields.
note_arraypreview was 2-wide x 1-tall (the WIDE case only) — it neverexercised a tall array, which is exactly why the row bug went unnoticed. Added a
"Note Array (tall)" preview (1 wide x 4 tall = 15x12): narrower than a Flagship but
twice a Note's height, the exact trap called out in the audit.
What was already right and is unchanged:
ellipsize,wrap_two_linesandaccentareall parameterised by
colsderived fromself.board, with no literal-width branches —that width-adaptivity is preserved as-is.
What changed
__init__.py:layout_lines()gainedrowsandothersparameters (both defaultto the old 3-line, no-extras behavior, so every existing 3-arg call site is
unchanged); a new
_extra_lines()helper fills the row budget withsession_summary()(one line per other active session) thenplayback_detail_lines()(player, then minutes left).
fetch_data()now readsboard.rows(defaulting to theFlagship's 6 when unbound, matching the existing
board.colsdefault of 22) andpasses it through, and sets
PluginResult.formatted_lines— previously never set, soplacing this plugin directly on a board slot (rather than via a template) rendered
nothing at all.
manifest.json: removed the six over/under-declaredmax_lengthvalues, added thetall
note_arraypreview, bumped version1.0.0→1.0.1.tests/test_plugin.py: added the shared board-geometry conformance test(
strict_growth=True— this plugin renders a session list — andrequire_note_array_preview=True), unit tests for the row-growth behavior and theTrack ellipsize fix, a render-equality test for the new tall preview, and coverage
for
session_summary()'s three media-type branches.Local test output
Run via the repo's own CI recipe (FiestaBoard core on
PYTHONPATH, inside the devcontainer):
Vacuity check (the new conformance test is not vacuous)
Reverted the row fix only (
rows = board.rows if board else DEFAULT_ROWS→rows = 3, i.e. the original hardcoded behavior) and re-ran just the new test:Restored the fix; full suite is green again (output above).
Deliberately left alone
line_1/line_2/line_3still declaremax_length: 22in the manifest. The auditscoped the six-var fix to
title/show/artist/album/user/playerspecificallyand excluded these; they aren't checked by the conformance suite either (only the
top-level
max_lengthsdict feedsDECLARED_LENGTH_EXCEEDED, and it only ever heldsessions.*keys), so left as-is rather than widening scope.get_formatted_display()— this plugin never overrides it, so there was nothing tofix on that (dead) hook.
ellipsize/wrap_two_lines/accentparameterised by
cols) is untouched, per the audit's note that it's the one part ofthis plugin that was already generic.
Do not merge — opening for review only.
🤖 Generated with Claude Code