Skip to content

Panel sections that fold and fill cleanly, a shaded canvas well, and light by default - #134

Merged
thethinkmachine merged 2 commits into
mainfrom
fix/panel-sections-polish
Oct 3, 2026
Merged

thethinkmachine merged 2 commits into
mainfrom
fix/panel-sections-polish

Conversation

@thethinkmachine

Copy link
Copy Markdown
Owner

What changed

Left panel: collapsing and expanding sections

  • States filter no longer stretches. With Transitions folded (or States torn off into a tall window), the filter box grew to ~300px and stranded the rows below it. .search-field had flex: 1, which grows on the column axis.
  • The fill list sizes to its rows. The last open list took all of the panel's spare height whatever it held, so five states stood over ~500px of empty panel with the folded Transitions header pinned to the bottom. It now grows past the 168px cap only as far as its rows reach, and shrinks to the room when it is longer. panel-list.js publishes the list's floor and the section's floor (--lw-floor, --dock-fill-min), because Chrome takes a flex or grid item's automatic minimum from its whole content (12,000px for a 200-state list).
  • Grip and pop-out no longer stay lit after a click. They used :focus-within on a tabindex="0" header; now they show on hover and keyboard focus only.
  • The grip sits in the header's padding, with room before the label. It used to reserve 18px of the row, which pushed the Transitions collapse arrow past the edge at the 220px minimum. Title, status chip and badge now give way by priority: chips truncate (full text on the tooltip) before the title clips.
  • δ table header framed where its rows are. It was a gutter wider than the rows, and the whole table sat a gutter narrower than the fields even with nothing to scroll. The header row draws the frame and is padded by the measured scrollbar width, kept current by a ResizeObserver.
  • Section rules reach the panel edge. The panel bodies dropped scrollbar-gutter: stable, which reserved an empty 10px strip.
  • A folded multi-alphabet section shows Σ2 · Γ3 · Δ2 instead of a bare "ALPHABETS".
  • Transition rows keep state names whole (carry 0, not ca…), truncating the label first.

Both panels: consistency

I measured every docked section header across both panels and all tabs. Height, padding, title type and position, arrow, grip and borders now match. Two real drifts are fixed:

  • Section body padding: left was 3px 14px 12px, right 4px 14px 14px. Both use one token now.
  • The Language badge is 16px tall like the count chips (it was 17px).

The filter text size now matches the other entry fields.

Canvas

  • A light inset shadow where the header, both panels and the sill meet the canvas. It is an overlay above the diagram and below every control (z 40 vs 49+). It takes no pointer, and its colour is the theme-tuned --tab-overflow-shadow.
  • The status pill gets the shadow the rest of the floating canvas chrome already had.

Light is the default theme

  • The base :root block is now the light palette plus the shared tokens, and Dark is an override block like every other theme.
  • All 72 colour variables are restated by every theme, so none inherits a light value by omission.
  • First paint follows: the theme-color meta and the Electron window background are light.
  • A stored theme choice, dark included, is kept.

Tests

  • npm test: 2,790 pass.
  • New tests/panel-sections-css.test.js (9 stylesheet-level pins, since the DOM stub computes no styles). All of them fail against the old CSS.
  • The folded-alphabet summary is covered in tests/workspace-sections.test.js.
  • tests/themes.test.js now takes the dark block as its reference for "every override restates the same variables".
  • Checked in headless Chromium:
    • DFA, PDT, MTM, PFA, DPA, PDA, and 150- and 200-state machines
    • panel widths 220px and 256px
    • a short 520px window
    • Blocks as the fill
    • a real scrollbar on the δ table
    • dark, light and sepia themes
    • a fresh profile, and a stored dark choice
  • npm run build succeeds.

Not in this PR

deriveRegex throws RangeError: Invalid string length on a 60-state cross-linked DFA. The regex expands past V8's string limit well under REGEX_DERIVE_MAX_STATES = 120. Found while testing; left for its own change.

…panels

Collapsing and expanding the Workspace sections turned up a run of layout
faults; each is fixed at its cause and pinned by a test.

- The States filter stretched to ~300px tall whenever States took the
  panel's spare height (Transitions folded) or was torn off into a tall
  window: `.search-field { flex: 1 }` grew on the column axis.
- The dock fill grew to the panel's bottom whatever it held, so five states
  stood over five hundred pixels of empty panel with the folded header
  pinned to the bottom. It is content-sized now and shrinks only when its
  rows are taller than the room; panel-list publishes the list's and the
  section's floors, since a flex or grid item's automatic minimum is its
  whole content.
- A header's grip and pop-out stayed lit after a mouse click (`:focus-within`
  on a tabindex header); they reveal on hover and keyboard focus only.
- The grip lives in the header's left padding, with room before the title,
  instead of reserving 18px of the row; at the 220px minimum that had pushed
  the Transitions arrow past the edge. Titles, status chips and the machine
  badge share shrink by priority, so a narrow row truncates chips first.
- The delta table's header was framed a gutter wider than its rows, and the
  whole table sat a gutter narrower than the fields with nothing to scroll.
  The header row draws the frame and is padded by the measured scrollbar.
- Section rules stopped ~10px short of the panel edge: the panel bodies no
  longer reserve a stable scrollbar gutter.
- A folded multi-alphabet section says "Σ2 · Γ3 · Δ2" instead of nothing.
- Transition rows keep state names whole and truncate the label first.
- Both panels' section bodies share one padding token, and the Language
  badge matches the count chips' 16px.

Also: a light shadow where the header, the panels and the sill meet the
canvas (an overlay above the diagram, below every control), and the status
pill takes the shadow the rest of the floating canvas chrome already had.
A reader who has never picked a theme now opens on Light; a stored choice,
dark included, is kept.

The base `:root` block is the default theme's, so the swap is structural:
the base now holds the light palette beside the tokens no theme varies, and
Dark is an override block like every other theme. Every theme already
restated all 72 colour variables, so none inherits a light value by
omission. The first paint follows: the theme-color meta and the Electron
window's background are the light frame rather than a dark one.
Copilot AI balanced review requested due to automatic review settings October 3, 2026 04:57

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@thethinkmachine
thethinkmachine merged commit a268f8c into main Oct 3, 2026
17 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.

2 participants