Skip to content

Theme server: a Layout choice; PortMaster New's port info reworked - #384

Merged
kloptops merged 5 commits into
PortsMaster:mainfrom
kloptops:theme-server-layouts
Nov 12, 2026
Merged

kloptops merged 5 commits into
PortsMaster:mainfrom
kloptops:theme-server-layouts

Conversation

@kloptops

@kloptops kloptops commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

The theme server only ever drew a theme in its default layout, so the default theme's Grid layout couldn't be previewed or checked. This adds a layout choice, and reworks PortMaster New's port info screen, which the previews showed was out of proportion.

This branch is on top of theme-docs (which includes theme-images): merge those first, or merge this one alone to get all three.

Theme server: layouts

  • The page has a Layout choice next to Color scheme, for themes with more than one layout. It's in the URL, and used by every render, the editor's preview and the Translate view's screens.
  • Renderers switch layout in place, like the scheme:
    • The load command and the zygote's spawn carry the layout.
    • PortMasterGUI and ThemeEngine take force_layout.
    • A layout the theme doesn't have means its default.
  • Export: --layouts all (or a list of names) writes /////. Without it you get the default layout and the same folders as before. The layout check reads both.
  • test_default_theme_layout now checks List and Grid at every size.
  • tools/theme_docs.py renders Grid with --layouts instead of a copy of the theme, and its pictures come out byte-identical.
  • THEME.md documents the Layout choice and --layouts.
  • A theme.json that doesn't parse is one plain error ("theme.json has a mistake in it: …") in the editor's preview, instead of the renderer's traceback, and no renderer starts for it.

PortMaster New: port info

  • The screenshot is centered over the description, with its corner mask. On the ports list card it's centered where its box is the card's full width (the Grid layout, square screens); in the List layout it stays left, beside the details.
  • The screen is two panes, with everything placed inside them, so only the pane splits change with the screen's shape. Before, every region had an area for each shape.
    • Left column: the screenshot, then the description card filling the rest.
    • Details card: status 22, labels 13, values 20, instructions 16 (the old text was caption-sized and bunched at the top), with the rows spread down the card.
  • On 16:9 and 3:2 screens the split is 70/30, so the details card is as wide as on 4:3, with one column. Before, it took over half the width for two short columns, and the screenshot and description were squeezed.
  • The description text is 17.
  • Checked at 14 sizes (480x320 to 3440x1440, square, 16:10) in English, German and Japanese, in both layouts: no layout errors.

Tested: the full suite on Python 3.7 and 3.13, the theme server tests on 3.12 and 3.14, and the flake8 errors-only lint.

🤖 Generated with Claude Code

kloptops and others added 5 commits November 12, 2026 14:04
…t check

A theme with #layouts (the default theme's List and Grid) was only ever
drawn in its default layout: the page had no way to see the others, and
--check only checked that one.

- The page: Layout, next to Color scheme, for a theme with more than one.
  It's in the URL, every render, the editor's preview and the Translate
  view's screens.
- Renderers switch layout in place, like the scheme (the load command and
  the zygote's spawn carry it; PortMasterGUI and ThemeEngine take
  force_layout). A layout the theme doesn't have means its default.
- Export: --layouts all (or names) writes
  <theme>/<resolution>/<scheme>/<layout>/<lang>/<screen>; without it, the
  default layout and the same folders as before. The layout check reads
  either.
- The default theme's layout test checks List and Grid at every size.
- tools/theme_docs.py renders Grid with --layouts instead of a copy of
  the theme (the pictures come out the same, byte for byte).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NxABmR1rUUgi4iicVLZchY
On port info the screenshot's box is as wide as the description card
below it, but the screenshot was drawn at its left edge. It's centred
now (with its corner mask), and so is the ports list card's where its
box is the card's whole width (the Grid layout, square screens). In the
List layout it stays left, beside the details.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NxABmR1rUUgi4iicVLZchY
The details card's text was caption-sized and bunched at its top, and on
wide screens the description was a thin strip under a tall image box.

Port info is two panes now, with everything placed inside them, so only
the panes' splits change with the screen's shape (it was every region's
area, again for each shape):
- the left column: the screenshot, then the description card filling the
  rest (a bigger share on wide screens)
- the details card: status 22, labels 13, values 20, instructions 16, the
  rows spread down the card; two columns on wide screens, the
  instructions filling the rest

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NxABmR1rUUgi4iicVLZchY
On 16:9 and 3:2 screens the details card took over half the width for two
short columns, and the screenshot shrank to fit a short box. The left
column gets 70% now and the details card 30%, as wide as on 4:3, with
the same one column of details and the same screenshot/description split.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NxABmR1rUUgi4iicVLZchY
Its screens started a renderer for it, which failed, and the editor's
preview showed the renderer's whole traceback under the editor's own,
plain, "A , is missing before this key". Now no renderer starts, and the
preview says "theme.json has a mistake in it:" and the parser's message.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NxABmR1rUUgi4iicVLZchY
@kloptops
kloptops merged commit 4722831 into PortsMaster:main Nov 12, 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