Pane focus reads from band strength, not from the dots; cursor visible in both panes

The previous model made the dotted rectangle the de-facto focus signal: the
cursor row got ONLY dots (and only in the active pane), so an unfocused pane's
cursor row disappeared entirely, and selection strength was the only band
difference. Wrong way around for a commander UI.

Now (matching Win7 Explorer / the commander convention):
- tr.highlighted = "selected via Space" OR "cursor row" — the template ORs
  them, so the cursor row always carries the selection band in BOTH panes.
- Pane focus is what changes the band: strong Aero band (--w7-el-grad-h) in
  the focused pane, 7.css's own faint inactive wash in the unfocused pane —
  that wash IS Win7's inactive-selection colour, faint by design.
- The dotted rect is demoted to what it was in Win7: a keyboard-focus marker
  layered ON TOP of the band, focused pane only. It is no longer the thing
  that tells you which pane is active.

Harness now renders a focused and an unfocused pane stacked, with selected
rows and a cursor row in each; verified zoomed in light and dark.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-08-16 02:10:36 +02:00
co-authored by Claude
parent 4102020f5c
commit 66076cf1d7
3 changed files with 40 additions and 12 deletions
+26 -3
View File
@@ -91,7 +91,9 @@
</table> </table>
</figure> </figure>
<figure class="cell" style="margin:0"> <figure class="cell" style="margin:0">
<figcaption>ours — focused panel (is-active): selected + cursor</figcaption> <figcaption>ours — focused pane (top) vs unfocused pane (bottom)</figcaption>
<!-- Focused pane: strong band on selected rows AND the cursor row;
the cursor row additionally gets the dotted focus rect. -->
<table class="is-active"> <table class="is-active">
<colgroup> <colgroup>
<col /> <col />
@@ -107,9 +109,30 @@
</thead> </thead>
<tbody> <tbody>
<tr><td>..</td><td style="text-align:right">—</td><td>—</td></tr> <tr><td>..</td><td style="text-align:right">—</td><td>—</td></tr>
<tr><td>Documents</td><td style="text-align:right">—</td><td>3/29/2007 12:00 AM</td></tr> <tr class="highlighted"><td>Documents</td><td style="text-align:right">—</td><td>3/29/2007 12:00 AM</td></tr>
<tr class="highlighted"><td>report.pdf</td><td style="text-align:right">27 KB</td><td>3/23/2007 12:00 AM</td></tr> <tr class="highlighted"><td>report.pdf</td><td style="text-align:right">27 KB</td><td>3/23/2007 12:00 AM</td></tr>
<tr class="is-cursor"><td>notes.txt</td><td style="text-align:right">4 KB</td><td>3/13/2007 12:00 AM</td></tr> <tr class="highlighted is-cursor"><td>notes.txt</td><td style="text-align:right">4 KB</td><td>3/13/2007 12:00 AM</td></tr>
</tbody>
</table>
<!-- Unfocused pane: same rows, faint inactive wash, no dots. -->
<table style="margin-top:10px">
<colgroup>
<col />
<col style="width: 5.5rem" />
<col style="width: 8.5rem" />
</colgroup>
<thead>
<tr>
<th>Name</th>
<th style="text-align:right">Size</th>
<th>Modified</th>
</tr>
</thead>
<tbody>
<tr><td>..</td><td style="text-align:right">—</td><td>—</td></tr>
<tr class="highlighted"><td>Documents</td><td style="text-align:right">—</td><td>3/29/2007 12:00 AM</td></tr>
<tr><td>report.pdf</td><td style="text-align:right">27 KB</td><td>3/23/2007 12:00 AM</td></tr>
<tr class="highlighted"><td>notes.txt</td><td style="text-align:right">4 KB</td><td>3/13/2007 12:00 AM</td></tr>
</tbody> </tbody>
</table> </table>
</figure> </figure>
+1 -1
View File
@@ -279,7 +279,7 @@
(click)="rowClick($event, i)" (click)="rowClick($event, i)"
(dblclick)="openAt(i)" (dblclick)="openAt(i)"
(contextmenu)="rowContextMenu($event, i)" (contextmenu)="rowContextMenu($event, i)"
[class.highlighted]="isSelected(entry)" [class.highlighted]="isSelected(entry) || i === panel().cursor()"
[class.is-cursor]="i === panel().cursor() && isActive()" [class.is-cursor]="i === panel().cursor() && isActive()"
> >
<td> <td>
+13 -8
View File
@@ -639,19 +639,24 @@ body {
border-color: var(--w7-li-bd-hl); border-color: var(--w7-li-bd-hl);
} }
/* Selection in the FOCUSED panel. 7.css's tr.highlighted is Win7's *inactive* /* Pane-focus model (commander convention, matching Win7 Explorer):
selection — a near-white wash that is almost invisible when it is the the CURSOR ROW always carries the selection band in BOTH panels —
panel you are actually working in. Win7 drew the focused pane's selection tr.highlighted covers "selected via Space" AND "cursor row" (the template
as the stronger Aero band, which is what --w7-el-grad-h/-bd-h already are ORs them). What changes with pane focus is the band's strength, never
(and the dark palette restates them, so this recolours for free). */ whether it exists:
- focused pane -> strong Aero band (below)
- unfocused pane -> 7.css's own tr.highlighted, which IS Win7's
inactive-selection wash — faint by design, not a bug.
The dotted focus rectangle is NOT the focus signal; it is layered on top
of the band in the focused pane only, the way Win7 drew the keyboard
focus rect over the selected item. */
.win7 table.is-active > tbody > tr.highlighted { .win7 table.is-active > tbody > tr.highlighted {
background: var(--w7-el-grad-h); background: var(--w7-el-grad-h);
border-color: var(--w7-el-bd-h); border-color: var(--w7-el-bd-h);
} }
/* The keyboard cursor: one dotted focus rectangle around the ROW, the way /* One dotted rectangle around the ROW; per cell (tr > *) draws a dotted box
Win7 drew a focused-but-unselected item. Applying this per cell (tr > *) around every cell instead — visibly wrong. */
draws a dotted box around every cell instead — visibly wrong. */
.win7 table > tbody > tr.is-cursor { .win7 table > tbody > tr.is-cursor {
outline: 1px dotted var(--w7-el-c); outline: 1px dotted var(--w7-el-c);
outline-offset: -1px; outline-offset: -1px;