mirror of
https://github.com/olehomelchenko/astrolabe.git
synced 2026-08-08 02:02:33 +00:00
Re-split library and preview when the editor is hidden; remember the editor's width
This commit is contained in:
@@ -181,6 +181,23 @@ lives in [04 · Routing & Global Events](04-routing-and-events.md).
|
||||
now has a home — the hidden-pane state landed in M6 with the toggle strip (below). The strip
|
||||
owns show/hide; wiring the splitter's Enter to it is an optional convenience, not required.
|
||||
|
||||
**Editor-hidden layout.** Pane model: the two **side** panes carry stored widths; the **editor
|
||||
is the flex filler** (no stored width while shown). Show/hide is layout-aware only for the
|
||||
editor — hiding **captures** the width it had (`capturedEditorWidth`), showing **pins it back**
|
||||
and re-splits the rest at the side panes' ratio (`shownSideWidths`); side panes just flip
|
||||
visibility and flex-fill the freed space (spec §01A). So `togglePane` needs `panesInner`
|
||||
(panes-row width minus the toggle strip, measured by `PaneToggleStrip`) for the editor only.
|
||||
With the editor hidden, library and preview become adjacent and share a **second splitter**,
|
||||
`PaneSplitHandle` — separate from `ResizeHandle` because the geometry differs: `ResizeHandle`
|
||||
resizes one side pane while the editor absorbs the change (the opposite side is untouched);
|
||||
`PaneSplitHandle` re-proportions **two** panes with no filler between them (editor-hidden, the
|
||||
side panes render `flex: width 1 0` and share the span), the pure `splitLibraryWidth()` holding
|
||||
each above its min. **valuenow trade-off:** it reports the library's 0–100 position
|
||||
(`splitValue()`) from the **stored ratio**, deliberately container-independent — so unlike
|
||||
`ResizeHandle` it does **not** observe the container, and `aria-valuenow` can drift from the
|
||||
rendered position after a window enlargement (worst near the extremes). Drag/keyboard read live
|
||||
`clientWidth`, so resizing itself stays accurate; only the announced value drifts.
|
||||
|
||||
_(Consulted via `/council` → WAI-ARIA APG `windowsplitter`. This bullet is the contract;
|
||||
cite it, not the APG file.)_
|
||||
|
||||
|
||||
Reference in New Issue
Block a user