Skip to content

dmvs_html: script texts in every look; class changes put only what they change - #6

Merged
JohnAmadis merged 2 commits into
mainfrom
fix/looks-keep-script-texts
Oct 12, 2026
Merged

JohnAmadis merged 2 commits into
mainfrom
fix/looks-keep-script-texts

Conversation

@JaxCalder

@JaxCalder JaxCalder commented Oct 12, 2026 •

Copy link
Copy Markdown

Summary

This fixes two bugs in a list on a screen that is hidden as the page loads (a page's screen not shown yet). Both showed up in carhmi-demo's queue.

1. The text a script sets now shows in every look of an element

innerText became a variable only in the element as the page has it. Its other looks are the element laid out in another state, for example a class the script changes (the playing row's row-active). Those looks were painted with the page's original text, as it was before the script ran. Clicking a row therefore brought back the design's titles ("Neonowe Noce", "Cyberpunk City", ...).

Now a look's elements keep like, the element they are a look of; it is set where the looks are matched to the page (seen_like). A text is painted from that element's variable, while the look's own style (for example the active colour) still applies.

2. A class that hides an element is converted even when its screen hides it too

classList.add('invisible') on a row of a hidden screen compared "hidden before" with "hidden after". Visibility is inherited from the screen, so nothing seemed to change and the class was dropped silently. A list showed rows it had too many of.

  • The style now keeps the element's own visibility (style_t::visibility: inherited / visible / hidden).
  • A change compares, binds and fades to the element's own opacity (own_opacity()). Whatever the boxes around it hide stays their concern: the screen still hides it through its own opacity.
  • An element hidden by itself is revealed by a change that shows it. Its inside follows its own visibility, or its parent's after the reveal. This makes rows that are hidden at first (rows 5–9) drawn with their texts and cover once shown.

3. A change of a class sets only what that class changes

A change set every variable its element is bound to (its place and its opacity) to how the change lays it out. An element's classes change independently, though: rows are faded by invisible when the list is shorter, and given row-active for the one playing. Picking a track removed row-active from the hidden rows, which also set their opacity back, and they reappeared.

Now a change of a class sets the element's position only if adding or removing that class moves it, and its opacity only if adding or removing it fades it.

Test plan

  • New test dmvs_html_converts_a_list_on_a_hidden_screen: no look shows the page's original text, and every row has an opacity variable starting at 255, and picking a row sets no row's opacity. The test fails without the fix (8 expectations) and passes with it; all tests pass.
  • Without class_effects the picking check fails
  • STM32F746G-DISCO: the queue shows the 3 tracks of the card, and picking them keeps the titles and shows no extra rows
  • carhmi-demo's page: none of the design's titles is left in any TEXT; rows 0–9 fade by $row_N_alpha (0–4 shown, 5–9 hidden)

🤖 Generated with Claude Code

JohnAmadis and others added 2 commits October 12, 2026 13:03
Two things a list on a hidden screen (a page's screen not shown yet) got
wrong, both seen in the car HMI's queue:

- The text a script sets (innerText) was its variable only in the element
  as the page has it; in its other looks - laid out in another state, a
  class the script changes (the playing row's) - the text was the page's,
  as it was before the script: clicking a row showed the design's titles.
  A look's elements now keep the element they are a look of (`like`, set
  as the looks are matched), and a text is painted from its variable.

- A class that hides the element (visibility) was not converted when the
  element was hidden anyway - by its screen, as the page is: hidden then
  and hidden after, nothing changed. The opacity a change compares, binds
  and fades to is now the element's own (its own visibility; what the
  boxes around it inherit stays theirs), and an element hidden by itself
  is revealed by a change that shows it - its inside by its own
  visibility, or as its parent then is. The rows a list had too many of
  stayed on it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A change put every variable its element is bound to - its place and its
opacity - as the change lays it out. An element's classes change
independently, though: the car HMI's rows are faded by `invisible` (the
list is shorter) and given `row-active` (the one playing); picking a track
removed row-active from the hidden rows and put their opacity back, and
they showed again.

A change of a class now puts what adding or removing that class does to
the element: its place if one of them moves it, its opacity if one of
them fades it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@JaxCalder JaxCalder changed the title dmvs_html: a script's texts in every look; own visibility in a change dmvs_html: script texts in every look; class changes put only what they change Oct 12, 2026
@JohnAmadis
JohnAmadis merged commit d941f82 into main Oct 12, 2026
1 check 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.

2 participants