Skip to content

Board layers: KiCad's order, single out a layer, All/Dim/Only (all clients) - #56

Merged
jlcjak merged 5 commits into
mainfrom
backplane/board-layers
Oct 7, 2026
Merged

jlcjak merged 5 commits into
mainfrom
backplane/board-layers

Conversation

@jlcjak

@jlcjak jlcjak commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator

The board view's layer controls now work like KiCad's, on all four clients.

What changes

Order and names. A board's layers are listed in KiCad's order:

  • copper from front to back (F.Cu, In1–In6, B.Cu)
  • the pads, vias and holes
  • the technical layers in front/back pairs (Paste, Silkscreen, Mask)
  • the user layers, Edge.Cuts and Margin, the courtyards, the fab layers

They use KiCad 7+ names: F.Silkscreen, F.Courtyard, User.Drawings and so on. Before this, they were listed in paint order, starting at B.Fab.

Singling out a layer (KiCad's high contrast):

  • Click a layer's name to make it the active layer. The rest dim, and the active layer is drawn on top.
  • Click the name again to put every layer back.
  • Over a board's list, All / Dim / Only sets how the other layers show. "Only" keeps just the active layer, plus the board outline and, for a copper layer, its pads, vias and holes.
  • In the window, ctrl+H cycles the three modes, like KiCad.
  • The Layers button names the active layer, e.g. "Layers · B.Cu".
  • Clicking a layer's colour still shows or hides that layer.

How each client gets it

  • The rules live in one pure module, src/core/layers.bend (laws lyr_*, test/layers_test.bend).
  • The window carries the focus in the viewer's kind word into V.Look.on, and Ops.scene draws the active layer last.
  • The web and phones get the hidden and dimmed layers as bit masks, plus the layer to draw last.
  • On phones, a tap doesn't pick a layer the focus hides.

Tested

  • Web, in Chromium, on a copy of kicad_projects/test: the list order, Dim and Only, selecting another layer, clicking again to put everything back, the visibility toggle, the active layer drawn on top, no page errors.
  • Window:
    • The board rendered through the real Ops.scene in each mode.
    • The Layers panel rendered with the real fonts. There's no X server here, so the live window wasn't driven.
  • Phones:
    • The phone client through bridge.js (list order, masks, the mode switch, the label).
    • The APK builds.
    • iOS isn't built here.
  • Tests and laws:
    • layers_test passes, plus the existing view, menu, hist, hubs, sidebar, cam, files, plot, select and panes tests.
    • The 12 new laws prove on their own.
    • The full check.sh is left to CI.

🤖 Generated with Claude Code

jlcjak and others added 5 commits October 7, 2026 13:41
src/core/layers.bend (pure): a board's layers in KiCad's order (copper
front to back, pads, vias, holes, the technical layers in front/back
pairs, the user layers, edge and margin, courtyards, fab) with KiCad 7+
names; the focus (an active layer and how the others show: as they are,
dimmed to a quarter, hidden), what stays with the active layer (the
outline, and a copper layer's pads, vias and holes), the masks the web
and phones draw from, a click on a layer's name (it stands out; again,
all back), the All/Dim/Only switch, ctrl+H's cycle, and the window's
kind word carrying the focus. Laws lyr_*; test/layers_test.bend.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…/Only

Each row is the layer's colour (a click shows or hides it) and its name
(a click makes it the active layer and dims the rest; again, all back).
Over a board's rows, All, Dim and Only say how the others show, and the
menu's button names the active layer. The canvas gets the hidden and
dimmed layers as bits and the layer plot2d.js draws last, on top
(client.bend's Lfocus, actions view-layer-pick and view-layer-mode).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…n KiCad

The Layers list follows KiCad's order and names; a row's colour shows or
hides it (vw-layer), its name makes it the active layer (vw-layer-pick),
and a board's list starts with All/Dim/Only (vw-layer-mode). ctrl+H cycles
them as KiCad's high contrast does. The focus rides in the viewer's kind
word into V.Look.on (Lyr.shade) and picking, and Ops.scene draws the
active layer after the rest. Reset layers clears the focus too.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The phone's layer list follows KiCad's order and names and marks the
active layer; screen fields dim, lift, layerMode, layerModes and
layerHead, and off now holds the layers the focus hides too (a tap does
not pick them). Android: a row's box shows or hides the layer, its name
singles it out, chips for All/Dim/Only; the GL renderer draws dimmed
layers at a quarter and the active one last. iOS: the same in its menu
(a segmented picker, each row's show/hide and stand-out buttons) and
Metal renderer (not built here).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Look.on read the focus from the kind word, so look_flip_none (with no
flips Look.on is the kind's own look, for every kind) no longer held for
a kind carrying a focus, and the proof failed in CI. Look.on and Look.of
are back as they were; Look.at is Look.on under the focus, and the scene
(Look.alpha, so Look.shows and the ops' gate and picking) and an item's
colour go through it. A kind with no focus looks as Look.on says. bend
PROOF.bend: All terms check.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@jlcjak
jlcjak marked this pull request as ready for review October 7, 2026 11:27
@jlcjak
jlcjak merged commit c1d83f4 into main Oct 7, 2026
4 checks passed
Snaiderbg pushed a commit to Snaiderbg/Backplane that referenced this pull request Oct 9, 2026
Hub: a taken web port is tried again until it is free
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