The rules for which columns a browser shows and how wide each is, gathered into one place that can be tested without a browser.
Status: the plan as of 2026-11-21. Part A is built (A1, A2, A3, A4 and A7, on dev, not released): see Part A as built. Nothing after it is built, and each part starts on Steve's word. The thumbnail fix is built too, and part B's timings are taken: compaction is under the 2ms line, so C would rest on testability (see Part B's timings). Part C is built (2026-11-21, on dev): see Part C as built. It is part 2 of Browser Cleanup; Tile Container Views no longer waits on it for its first grid. Steve's decisions of 2026-11-20: the recordings before part A may start; the line for part B is 2ms; the companion's code is kept and no work is put into it now; the first grid does not wait on this plan. The choices made, and the ones still open, are listed at the end. A review of this page (_review.md, beside it) was folded in five times on 2026-11-20 and a sixth on 2026-11-21. What each pass changed is marked "(review)" and "(review 2)" to "(review 6)"; the reviewer's answers, and the questions that follow from them, are in the last section. The reviewer's verdict on the fifth pass, with the recordings in hand: part A can start (A1, A2, A3, A4 and A7, five commits), and C still waits on B.
What changed from the first draft (2026-11-19). That draft proposed a layout object, SvColumnLayout, that was handed a flat list of columns and answered with a plan. The review found three things it had not taken in: the levels are nested inside each other, not laid side by side; each level chooses its own direction; and an object that solved the whole layout would have to repeat what the views already know about themselves. This version keeps each view's knowledge in the view and moves only the arithmetic. It also puts the small, safe fixes first and a measurement before the larger change.
The Naked Objects paper describes a screen as a lens over the model, made of three decisions: which nodes are visible, whether each visible parent-to-child edge is layered (the child gets its own plane, beside or in front of its parent) or inlined (the child is drawn within its parent's extent), and how siblings are arranged. It says the framework owns the mechanics, and names one of them: responsive collapse is the lens switching edges from inlined to layered as space runs out, within the bounds the hints allow.
That mechanic is what this plan is about. Read that way, the code has four separate implementations of it, one per kind of edge:
| What the user sees | In the lens model | Where it is decided today |
|---|---|---|
| Earlier columns hide and the breadcrumbs keep the path | Layers stacked in depth, no longer side by side. Still layered. | SvStackView and SvNavView |
| A docked companion becomes a tab | An inlined edge becomes layered | SvDetailView and SvCompanionView |
| Side-by-side panes become tabs | An inlined edge becomes layered | SvAnchoredTabsLayout |
| A document's sections go from three text columns to one; a section folds to a tile | Inlined siblings rearranged; an inlined edge becomes layered, by the user's hand | CSS, and SvInlineSectionTile |
A pin on a companion or a tab, and a folded section, are the same thing too: the user choosing a placement, inside what the hints allow.
So the destination is one protocol in which every edge says how it wants to be placed, how far it may give way, and how much room it needs. It is a shared protocol and not one owner. Part C is the first step: the layers, with each companion's reservation handed in as a number by the companion that worked it out. SvAnchoredTabsLayout stays the owner of its panes for good: two panes with the same claim can need different answers, because a player dragged their divider, chose a different member of a group, or closed a pane that should be the first to come back. What it shares with the rest is the edge of the protocol: its reservation goes outward, the width it is given comes inward, and it divides that width by the history it keeps. (review 2) What this page calls a level is a layer in the paper's words.
A browser shows a chain of levels. Each level is a SvStackView holding a nav view (the column or menu) and a detail view. The detail view holds the next level's whole stack, and that level's companion panel if it has one. So the levels are nested: the third column is inside the second level's detail view, which is inside the first's. The one place views sit side by side is an anchored-tabs level, whose panes are siblings.
An anchored-tabs level ends its browser's chain. Each open pane is a browser of its own, with its own chain, laid out against the width of its pane's frame. So there are two calculations there, not one: the outer chain, in which the anchored level reserves width and the columns before it give way, and each pane's chain, in which the pane's columns fit the pane. (review)
Each level takes its direction from its node:
"right": the nav is a column on the left and the next level is beside it."down": the nav is a row across the top and the next level is beneath it.No node in the app supplies a companion today. nodeCompanionNode() answers null in the framework and nothing in the app overrides it; the Narration and Party panels that were companions are now anchored tabs, each pane a browser of its own. The companion panel is exercised only by the framework's own spec, which supplies one at run time. So every companion rule on this page is a rule of the framework that no player reaches, and what that means for C's scope is a question for Steve under Still open. (review 3)
In the app today every node is "right", the default. The only "down" levels in use are anchored tabs, which force it. Any other direction throws. "left" and "up" are wanted eventually, "left" for right-to-left languages among other uses; see Four directions.
A level also chooses how it shows its children (nodeChildrenLayout()): one per tile in a column, as anchored tabs, or inline, where the next levels are laid out in place as a document (Inline Navigation, in the app's plans). So a level is not always a column, and one column can hold several levels of the tree. See Inline documents.
"right" levels take part. A "down" level is never hidden and adds no width, since its row costs height and the levels beneath it get its full width."right" column after it, plus every docked companion and anchored-tabs claim after it, is not less than the root width. So columns give way from the left.display: none. A column does not animate. A companion does: its size changes over 380ms, and its embedded browser is laid out again 400ms after it docks. So a companion's reservation is at its new value while its box is still narrower, and a recording has to take three things apart: the reservation when it is decided, the box in transition, and the box once settled. Otherwise a correct frame in between reads as a wrong answer. (review 4)The arithmetic is flat: every comparison is against the root width, although the views are nested. It gives the right answer because columns give way strictly from the left.
A column's target width is the larger of 270px and its node's nodeMinTileWidth(), plus a thumbnail allowance, capped at the available width.
| Class | Its part |
|---|---|
SvStackView | Sums the widths after it, decides hide or show for its own column, and loops the whole chain until nothing changes. |
SvNavView | Target width, available width, hide and show, and the width styles. |
SvDetailView | A companion's room. |
SvCompanionView | Docked, tab or hidden, and its docked length. |
SvStackView_anchoredTabs | How much width the panes claim. |
Each was read from the source. None has been measured in a browser; part B does that.
syncFromNode ends in a pass over the whole chain. A node update bubbles to the root, so a streamed narration runs it for every level on every chunk.safeUpdateCompactionChain, updateCompactionChain and recompactBrowserChain, with 12 call sites.SvNavView.makeOrientationRight and SvNavView.updateWidthForWindow hold near-copies of one rule. The second has a case the first lacks: the last column fills the row when the root is between one and two column widths. In that case every sync writes the fixed width and then the full width.clientHeight inside the loop, after widths are written. It is a raw element read, so the thrash counter does not see it.SvOptionNodeTile decides whether to step back after a pick by comparing the window width with 540. What it wants to know is whether its parent column is hidden.17em, 540, 200, and the loop guard of five.TestAnchoredTabsLayout. The columns have nothing like it, so every fix so far was found in a browser and guarded by a comment.In this order: the recordings, part A, the thumbnail fix, part B, and then part C if B's numbers call for it. Everything before C is small and worth doing whatever is decided about C.
Part A is meant to change nothing a user sees, so what it could change is recorded first. Steve has said to start these (2026-11-20), with one condition: not everything the columns do today is how they should behave. So a recording says what happens, not what is right. Its assertions are named as today's behaviour, anything that looks wrong is listed for Steve with the recording, and a behaviour he calls wrong is taken out of what part A and part C must reproduce and becomes a fix of its own.
app-mobile-column-width.spec.js asserts on the widest ancestor of the "My Sessions" tile. A wrapper as wide as the viewport passes it while the column itself is stuck at 270px. It should measure the enclosing nav view.SvSummaryNodes and the nodeCompanionNode() hook, and what they saw is kept here for when the companion is taken up. Bottom edge, on a host with setNodeIsVertical(false) at a width of 1,000px: hidden at a detail height of 219px, a tab from 220px to 579px, docked from 580px, no width reserved. Two side companions, each asking for 700px at a 1,000px root with three 270px columns: both dock and reserve 700px, the first two columns hide and the third shows; at 600px both are tabs and reserve nothing. companion-panel.spec.js accepts a tab while requiring a reservation above zero, which should depend on the mode. (review 4)Taken by tests/e2e/compaction-recordings.spec.js in the app repo, which writes tests/e2e/recordings/compaction-before-A.json: one new session with one character seated, 41 steps, no page errors. It has been taken three times. The numbers here are the second run's, taken after the GM's opening had finished arriving (see point 2 below), and that run is the baseline (app commit 5e57446e4). The reviewer compared the first two runs: the same open tabs and the same stack states at all 32 steps of the resize. The third run matched the baseline in layout at every step and in every pass count (292 calls, 530 level visits, 212 resize handlers). app-mobile-column-width.spec.js is mended and passes. Nothing below is asserted as right.
The width spec was measuring nothing. On a phone the "My Sessions" text it looked for is the breadcrumb, not a tile, so none of its ancestors was a column. It now reads the columns: the root column hidden, the My Sessions column 393px of 393px.
The session at 1,600px. The app's two columns (the root and My Sessions) are hidden and the session's tab row takes the full width. Narration alone is 1,600px. With Party opened, Narration is 1,076px and Party 522px. Both panes' columns are fill columns.
The resize. Both panes stay open down to 1,040px (Narration 602px, Party 436px). At 1,000px and below only Party shows, at the full width, and Narration is closed. Coming back up, Narration returns at 1,040px. This agrees with the reviewer's 1,038px.
The Narration column at 390px. It is 390px wide, a fill column with no minimum, before and after an ordinary node update on the chat. The narration that asks for 900px does not overflow.
The solo Party sheet. The Party column's own node asks for 437px and the sheet it presents for 300px, as read. At every width recorded it is a fill column, so the difference never shows. The second case could not be taken: no tile on a new character's sheet opens past the inlined levels, so there was nothing to open from inside it. That case, and the repeated section column, need a character with something to open, or the Inline Lab.
Passes. Script time in the passes only; the layout they cause is not in these numbers, and nothing was streaming.
| What happened | Calls to the chain pass | Level visits inside them | Resize handlers | Script time |
|---|---|---|---|---|
| One step of the resize (31 of the 32) | 7 to 9 | 13 to 17 | 6 or 7 | 0.2 to 0.7ms |
| The one step where Narration's pane reopens (1,000px to 1,040px) | 12 | 20 | 6 | 0.6ms |
| 1.2 seconds with nobody touching anything | 0 | 0 | 0 | 0 |
| Opening the Party tab | 16 | 34 | 0 | 0.8ms |
| An ordinary node update on the chat | 6 | 14 | 0 | 0.3ms |
So one resize runs six or seven handlers, and one explicit node update on the chat runs six passes. The handlers are counted across the outer browser and its pane browsers together, so "where one would do" is not yet shown: it may be one per browser. A1 checks which stack answers a resize within its own browser, and that the panes still close and reopen. The script cost is small: a third of a millisecond for the node update. If the layout cost is as small, part B will find compaction under the 2ms line and C will rest on testability. That is a first sign and not part B's answer. (review 5)
For Steve: things that happen today and may not be wanted.
tests/e2e/compaction-looks.spec.js into test-results/compaction-looks/.Every column that shows in the dev recording is a fill column, so the recording says nothing about the rule A3 merges. The reviewer took the missing comparison in local Chromium: a plain SvSummaryNode asking for 300px, not a fill column, with a child that has one leaf, in an embedded browser 390px wide. It is the last column, so it stretches under the one-to-two-widths rule. Its inline width was 100% and its flex grow and shrink zero throughout.
| Action | Rendered width | Inline minimum | Inline maximum |
|---|---|---|---|
| Show the list | 390px | 17em | 100% |
Call didUpdateNode() on the list | 390px | 300px | 100% |
| Open its child | 0px (hidden) | 300px | 300px |
| Go back to the list | 390px | 17em | 100% |
So an ordinary node update changes the column's minimum from 17em to 300px (the later write from syncMinWidthClaim()), and the rendered width does not move. A3 must leave all four rows as they are.
tests/e2e/compaction-recordings.spec.js now compares a run with the baseline, step by step: the open tabs, and each stack's direction, hidden flag, widths, target, fill and width styles. A difference fails it. The pass counts are printed beside the baseline's and not asserted, since part A is meant to lower them. A run writes to its own output directory; the baseline is replaced only on purpose (COMPACTION_BASELINE=write), by a run that finished. app-mobile-column-width.spec.js now also asserts which column shows (My Sessions) and that it is no wider than the screen. (review 5)
The commit that added the comparison dropped six helpers the test still calls, so the recorder failed at its first tab lookup; the reviewer caught it. They are restored (app commit 899f07651), and a step that has a snapshot on one side only is now reported as a difference. The repaired recorder was run on the dev build as it stood before part A: 41 steps, every layout the same as the baseline, and the same 292 calls, 530 level visits and 212 resize handlers. (review 6)
Each is its own commit, changes no rule, and is checked by the comparison above, the width table for A3, and the existing specs (companion-panel, session-anchored-tabs, app-mobile-column-width). The numbers are kept as they were, so A5 and A8 stay in the list as moved.
recompactBrowserChain. The other two go.SvNavView, the fuller one, used by both callers. This leaves a third writer, syncMinWidthClaim(), which a node sync runs. A3 keeps that later write exactly as it is; it moves under one owner in C, not here. See One method applies a width. (review 2)SvStackView.makeOrientationLeft is renamed for what it does. It is the method the "down" direction calls, and it lays the stack out downward. The name is wanted for a real "left".Steve said to start. Five commits in strvct, each deployed to dev on its own and checked there before the next.
| Fix | Commit | What changed |
|---|---|---|
| A1 | f730b118 | SvBrowserView registers the root stack it makes for the window's resize; a stack no longer registers itself. Pane browsers register their roots the same way. |
| A2 | 5850899d | safeUpdateCompactionChain and updateCompactionChain are gone; their five callers call recompactBrowserChain. |
| A3 | dbf06eb4 | makeOrientationRight calls updateWidthForWindow, the one rule. Its own shorter copy is gone, and so is the second call in syncOrientation. syncMinWidthClaim() is untouched. |
| A4 | 6aef2beb | defaultTargetWidth (270), fullWidthMinWidth (17em), maxCompactionPasses (5), bottomCompanionContentRoom (200), narrowViewportThreshold (540), minInlineColumnWidth (200). Values unchanged. |
| A7 | a81d0557 | SvStackView.makeOrientationLeft is makeOrientationDown. |
The checks, after every one of the five: the recorder found the layout the same as the baseline at all 41 steps; app-mobile-column-width and companion-panel passed. From A3 on, the width table below was read too.
What A1 saved. Over the whole recording the chain passes fell from 292 to 193, the level visits from 530 to 299 and the resize handlers from 212 to 113. A step of the resize is now 4 to 6 passes and 3 or 4 handlers, where it was 7 to 9 and 6 or 7; the step that reopens Narration is 9, where it was 12. The handlers left should be one per browser (the outer one and each pane, open or not); I counted them and did not name which browser each belongs to. A2, A3, A4 and A7 changed no count.
The width table, from a fixture of my own (tests/e2e/compaction-width-table.spec.js: plain nodes in an embedded browser 390px wide, on dev). It was read on the build before A3 and again after, and is the same:
| Action | Rendered width | Inline minimum | Inline maximum |
|---|---|---|---|
| Show the list | 390px | 300px | 100% |
Call didUpdateNode() on the list | 390px | 300px | 100% |
| Open its child | 0px (hidden) | 300px | 300px |
| Navigate back to the list | 390px | 17em | 100% |
The first row's minimum is 300px where the reviewer's reads 17em. My mount ends in a node sync, which writes the minimum again; the other three rows agree with the reviewer's.
Not a check of part A: session-anchored-tabs fails five of its tests on dev, and did before part A. They are the gaps its last commit names (a call only the host has, Theatre opening beside Narration, a page-local character replaced by the host's party). It is not a guard for this work until it is mended.
Not exercised: no step of the recorder lays a stack out downward with a companion, so A7 and the 200 of A4 rest on the rename being mechanical and on companion-panel.
Both were in part A and both can change what a user sees, so each is its own decision with its own acceptance case. Neither is needed for B or C. (review)
SvOptionNodeTile steps back when the window is narrower than 540px. Whether the column it would step back to is hidden is a different test: the sum of the columns against the root width. With two columns of the default 270px in a top-level window the two disagree only at exactly 540px. With wider columns they disagree in an ordinary window: a 400px parent and a 270px picker in a 650px window hide the parent while the picker stays open. In a narrow embedded browser inside a wide window the same follows from the two widths, though nobody has seen it yet. Asking whether the column to return to is hidden is the better rule, and it is a change. If it is adopted (review 2): the test is the visibility of the actual column to return to, on the live path in the tile's own browser; a column hidden by a docked companion counts as hidden; picking several and toggling off behave as now; and the path is checked again before the delayed step back, so a user who has already gone elsewhere stays there. Not found in the app (2026-11-20). The session's Settings tab, the one pane where I expected a single-pick field, shows none to a player: Steve looked, and it holds the table's status, the away-rolls rule, the invite link, delete, volume and cost. The session's Chat Model and Campaign fields are not shown there. So this stays a reasoned case with no player route known, and it is not urgent.nodeMinTileWidth has four readers (review 2): a nav view reads its own node for its target width; an inline document reads the presented node for its text columns; a companion reads the child of its root that owns the selected path; and an anchored level reads a tab's node for the comfortable width of its pane, which is what the Party tab's 437px is for today. Moving every reader to the presented node would throw away what the host knows. If the Party pane and the sheet ever need to ask for different widths, the answer is an optional hint for that one role, defaulting to today's value.
A column whose tiles have thumbnails is 72px wider, and it finds out by asking its first subnode. Asking can load a lazily stored list just to look at its first row (see The thumbnail allowance). Mending that changes when a list loads and perhaps what a user sees, so it is not a cleanup and it is not part of C. It lands by itself after A, with its own before and after, and its result is the baseline B measures. It stands whether or not C is ever built, and C keeps an exact comparison.
Its three checks:
The first visible frame and the settled width are both recorded, since ordinary loading may settle the allowance before anything is painted.
strvct 0ca64f67. thumbnailWidthAllowance() gives 0 while the node's subnodes are pending and does not read the list; once the list has loaded it reads the first row, and it keeps nothing between calls. A loaded list tells its node it updated, which syncs the column, so the 72px arrives with the rows.
The three checks, in tests/e2e/compaction-width-table.spec.js on dev, read before the fix and after:
| Check | Before | After |
|---|---|---|
| A pending list is asked for its width | 72px, the list read twice | 0px, the list not read |
| The list has loaded, its first row has a thumbnail | 72px | 72px |
| The same first row stands for a plain node | 0px, the list unchanged | 0px, the list unchanged |
The recorder still found every layout the same as the baseline. What this does not show: "pending" is stood in for (the fixture's node is made to answer that its list is pending); no list pending in a real store was exercised, and the first visible frame of one was not recorded. The Bestiary of a campaign with creatures is the real case, and I have not opened one.
tests/e2e/compaction-measure.spec.js, three runs on dev with A and the thumbnail fix in place, in headless Chromium under Playwright on Steve's Mac. What is timed is the outermost chain pass, which includes any layout the pass forces by reading geometry inside it. Each frame's passes are summed.
| Workload | Frames | Frames with a pass | p95 over all frames | p95 over frames with a pass | Worst frame | Frames over 2ms |
|---|---|---|---|---|---|---|
| Streaming, 390 by 844, processor 4x slower | 1,801 to 2,159 | 29 to 39 | 0ms | 2.1 to 2.4ms | 2.5 to 3.0ms | 2 or 3 |
| Resizing, 1,280px to 980px and back three times, 4x slower | about 455 | about 215 | 0.8 to 0.9ms | 1.0 to 1.1ms | 1.7 to 1.9ms | 0 |
| The same resizing, not slowed | about 458 | about 217 | 0.2 to 0.3ms | 0.3ms | 0.4 to 0.5ms | 0 |
Against the line. Counted as the plan says (every frame of the workload, those that cost nothing included), compaction is far under 2ms in both workloads: the 95th percentile while streaming is 0ms, because a pass runs in about one frame in fifty. Resizing is under the line however it is counted. The one figure near the line is streaming counted over only the frames that had a pass: 2.1 to 2.4ms on a processor slowed four times, with two or three frames a response over 2ms and none over 3ms. So the speed case for C is not made. C would rest on testability.
What a chunk costs. Text arrived in 12 to 21 frames a response (the table sends narration in batches, about one every two seconds, not token by token). A frame where text arrived and a pass ran held six calls, in all three runs (90 calls in 15 such frames, 100 in 16, 60 in 10). That is the same six that one explicit didUpdateNode() cost in the recordings.
Limits. The response was live, not a replay, so chunk sizes and cadence differed between runs. Layout the browser does later for a pass's writes is not attributed to the pass. Frames longer than 25ms were counted (7 to 17 a streaming run) but not traced to a cause, so "compaction caused a missed frame" is neither shown nor ruled out; a performance trace would say. It is a throttled desktop browser and not a phone. The end states and transitions matrix described below is not built.
With A in place, a browser spec records two things.
It also counts passes (calls apart from loops), forced layouts, and time spent in passes while a narration streams and while the window is resized. The time comes from a browser performance trace, since the thrash counter misses raw reads.
The workloads. (review 3)
| Workload | What is recorded |
|---|---|
| Streaming | A warmed, joined session with a character chosen, Narration selected, and the player at the live end of the conversation, in Chromium at 390 by 844 with the processor throttled, standing in for a phone (Steve, 2026-11-20). It is not a phone, and the result is reported as a stand-in's. One representative response replayed through the normal update path, with the same chunk sizes and cadence every run. This is the primary one: it is what a player is doing when it matters. |
| Resizing | The same session, settled, with Narration pinned and Party selected, in a browser that can be resized. Narration (600px), Party (437px) and a 1px divider need 1,038px: at 1,037px only Party shows, at 1,038px both. Start at 1,280px, take the anchored container below 1,038px and back, and record the pane closing and returning. |
The two are reported apart, each with its hardware and browser named. Compaction is counted across the outer browser and its pane browsers, nested time once. A timing on a real phone can be added later and set beside the stand-in's. Companion rules are not in these runs, since the session has no companion; they are checked in a framework fixture.
The line, agreed before measuring (proposed by the reviewer, accepted by Steve 2026-11-20). Compaction is costly if it takes more than 2ms at the 95th percentile per active frame, on a 60Hz target; that is about 12% of a 16.7ms frame. The device, the path and the workloads are agreed first. Streaming and resizing are measured apart. For each, all compaction time in every frame of the workload is summed, frames that cost nothing included, with the synchronous layout it causes counted once. The speed case is made if either workload goes over the line repeatedly, or if traces repeatedly show compaction causing a missed frame even when the percentile passes. Passes per chunk, loops per resize and forced layouts explain a result; they do not establish what the user pays. (review 2)
If compaction is under the line, C rests on testability alone. Tile Container Views is not a reason for C: its first grid wraps at the edge of its container with a least cell width, which needs only the width its column is already given, as an inline document shows. Negotiating a width with the columns beside it waits for a real need, such as keeping two cells side by side by asking a neighbour to give way. (review 2) Both are good reasons; they are different sizes of reason, and Steve should see the numbers before choosing.
Each level states its own claim. A stack view answers layerClaim(): a small record of plain values that it works out from the model and its own state, each from the node it is read from today.
A claim holds nothing that depends on a width. targetWidth() today reads the available width, and on a root whose width is not cached that is a measurement, so calling it from every sync would not be the model-only comparison this plan promises. The widths are the function's other input, taken once per pass, and anything that depends on them (the cap, a full-width anchored reservation) is worked out inside the function against that one snapshot. (review 2) The level is a layer in the paper's words, and whatever it inlines is part of its claim.
| Field | From |
|---|---|
| axis | horizontal or vertical, from the node's orientation (vertical for anchored tabs). Which way along the axis is not in the claim; see Four directions |
| target width, yield floor | What SvNavView.targetWidth() and yieldTargetWidth() work from, before the cap at the available width: the larger of 270px and the node's hint, plus the thumbnail allowance (see The thumbnail allowance). The function applies the cap. (review 2) |
| fills | SvNavView.shouldCurrentlyFillAvailble() |
| companion reservation | A number: the width its side companion holds in this pass, worked out by the companion itself (see The companion stays where it is). Zero for a bottom companion, a tab, or none. (review 4) |
| anchored reservation | Either a fixed width, from the pins and the tabs' minimums, or a flag saying "the root's width as reported", for a level that wants the full width. anchoredClaimWidth() reads the root width for that case today; the flag keeps the claim free of widths and the function fills it in from the pass's snapshot. (review 3) |
One function allocates. SvLayerAllocation is given two widths (the root's width as reported, and the width to fit columns in, which differ only while a root has no width yet) and the chain's claims in order, and answers, for each level, hidden or shown and which width rule applies. It has no DOM and no views. It holds today's flat arithmetic for the columns, in one pass. It is run once per browser: the outer chain ends at an anchored level, and each pane's browser runs its own.
The function's contract. These are today's rules, and each is a line in TestLayerAllocation. (review)
The browser runs the pass. It walks its own chain gathering claims, calls the function, and hands each level its answer. Each view applies its own answer to itself and writes only what changed.
Steve said not to stop, with the timings in hand. Three commits in strvct, each deployed to dev and checked there before the next.
| Step | Commit | What changed |
|---|---|---|
| Claims and one function | d2489ea4 | SvLayerAllocation (no DOM) takes a chain's claims and two widths and answers hidden or shown and the width rule for each level. A stack states layerClaim() and applies its own answer. A pass sizes the companions, then allocates once; the loop is gone, with sumOfNavWidths, compactNavAsNeeded and updateCompaction. |
| One writer | bc86afeb | SvNavView.applyLayerAnswer() is the only writer of a column's width, minimum, maximum and flex grow and shrink. A pass gives it a new answer; an orientation sync, a node sync and a reveal apply the last one again. updateWidthForWindow and syncMinWidthClaim are gone. |
| One gate | 90f165c1 | A root keeps the signature of its last pass: the two widths and, for each level, which stack it is, whether it is on the page, and its claim. A node sync compares and runs a pass only on a difference. |
The rules are in a headless test. tests/headless/TestLayerAllocation.js, 55 checks: columns giving way from the root end, the cap and its 1px edge, the width rules, a fill column, vertical levels at the root, middle and end, one and two companion reservations (the case that comes to more than the root holds among them), anchored reservations and the full-width flag, a root with no width yet.
The checks on dev.
tests/e2e/compaction-matrix.spec.js), taken before C: eight variants by path depth by container width, down and back up, 1,482 level states with hidden columns and docked and tabbed companions. The first step matched it at every state. The second changed 9 on purpose (below). The third matched the new baseline.tests/e2e/compaction-triggers.spec.js): a width hint, a fill flag, a deeper path, a sibling with the same title, the container's width, a level's direction, and a companion bound and removed each ran a pass and gave the layout expected; an ordinary node update ran none.companion-panel, app-mobile-column-width and the width table passed after each step.What it saved. Over the session recording, 165 passes where there were 292 before part A and 193 after it. One explicit node update on the chat: no pass, where there were six. A streamed response at phone size: no pass in any of about 2,000 frames, where there were 204 to 264 passes a response. Resizing costs what it did (it changes a width every step).
One change of behaviour, made on purpose. A column whose node hints a width keeps that hint, held to the room there is, as its minimum whichever of a pass or a node sync ran last. Before, a pass left a full-width column's minimum at 17em and the next node sync put the hint back, so the style depended on the order. In 8 of the 9 matrix states only the inline minimum differs. In the ninth, a 300px container, the column had been 340px wide (17em is wider than its container) and is now 300px. The width table's last row changed the same way.
Where the build differs from the plan above.
What is not shown. The matrix and the trigger spec use plain nodes in an embedded browser; anchored levels are covered only by the session recording and the headless test. session-anchored-tabs still fails the same five tests it failed before part A. No real phone was used. Nothing here is released to prod.
An earlier version of this page moved the companion's arithmetic (docked, tab or hidden, and its docked length) into the function. It stays in SvDetailView and SvCompanionView. (review 4)
A side companion has all it needs before any column is hidden. Its mode comes from the root width as reported, less its own column's target. Its docked length may also use the room above that column's yield floor. Neither reads whether a column is hidden, nor another panel's reservation. Today's loop exists only because a column can read a reservation before the companion has brought it up to date.
So a pass in C goes in this order, and needs no loop:
What starts a pass is separate from what the pass works out. Binding a companion, a pin and a width hint each ask the owning browser for a pass, where today they lay out or compact directly; that way the first pass sees a panel that has just been mounted. The reservation itself is always worked out inside the pass, since a resize alone can change it.
This makes C the same size whatever the companion's future is. Whether it becomes the auxiliary view of Browser Cleanup or is retired is Steve's to decide, and C does not wait for it. The cost is that the companion's own rules stay tested in a browser fixture and not headlessly; the function's test covers what the columns do with a reservation.
A column whose tiles have thumbnails is 72px wider, and it finds out by asking its first subnode. Three things make that less simple than it reads. (review 3)
node.subnodes().first() goes through the subnodes getter, which loads a lazily stored list before .first() runs. The Bestiary makes its list lazy on purpose, since a campaign can hold hundreds of creature sheets. The reviewer saw the production method resolve a lazy list on its first call.slotIsPendingMaterialization("subnodes") first. While the list is pending, the claim has no thumbnail allowance and the list stays unloaded. Once it is loaded, each sync reads the first row again and a pass is asked for only when the number changes. A column bound to a new node whose list is pending does not keep the last node's 72px.This is a change of behaviour, so it is not in C. Today the first layout of an unloaded list loads it, on or off the page. Under this rule the first layout may be 72px narrower until the list arrives in the ordinary way, and then corrects. It lands as the thumbnail fix, before B, and C takes its behaviour as the one to reproduce. (review 4)
A nav view's width is written from three places today: the two rules A3 merges, and syncMinWidthClaim(), which every node sync runs and which writes a minimum width. Showing a column also re-runs its orientation, which writes widths again. Under C that is a trap: a sync overwrites an allocated width, the level's claim compares equal, no pass is asked for, and nothing puts the width back. So C gives one method, applyLayerAnswer(), the only right to write a nav view's width, minimum and maximum, and its flex grow and shrink, which are what let a narration give way. A sync and a reveal call it with the last answer and write nothing of their own. It must be right the first time it is applied to a new view, and on the way out of being a fill column. If part B shows the node's raw minimum reaching the final styles, the answer carries it: two different raw minimums can give the same capped target. (review, review 2) SvAnchoredTabsLayout goes on laying out the panes inside an anchored level.
Why this does not repeat the views' logic. The line is between what I need and who gets what. How a column arrives at its target width, whether it fills, what its companion prefers: each stays in the view that knows it, in one place. The function sees numbers and never asks why. A new kind of level, such as a grid from Tile Container Views, states a claim and the function does not learn it exists. The companion's arithmetic does not move at all: the function is handed its result.
The risk to watch: if a claim ever needs to carry a rule and not a value, the function has started to copy a view. That is the signal to stop and put the rule back.
Nesting and direction. The claims are gathered by walking the nested chain, and the list keeps its order. A "down" level is in the list: it adds no nav width and is never hidden, and any anchored reservation it carries is counted. Because the arithmetic is flat, the function needs no tree. The nested arithmetic (each level handing its leftover width to its child) is a rule change and is in part D.
"left" and "up" are not in C, but C is written so that adding them does not reopen it.
"right" and "left" are the horizontal axis; "down" and "up" the vertical. The arithmetic depends only on the axis: a "left" column costs the same width as a "right" one, and a sum does not care about order. So the claim carries the axis, and the function never learns which way a level faces. A chain that mixes "right" and "left" levels needs nothing new.SvCompanionView already speaks of an edge and a length."down" level is never hidden. If rows are ever to give way for height, it is the same function run on the other axis with heights, and is a part D decision."left" on its own is the other case. Both come out the same in the arithmetic. Which of them a right-to-left language should use is open, and is not decided here.Inlining is a placement, chosen edge by edge: an inlined child is drawn within its parent's extent and makes no layer of its own. So the rule for claims is that an inlined child adds to its parent's claim, and a layered child makes its own entry in the chain. An inline document (a character sheet) is therefore one layer to compaction, whatever it holds. What goes on inside it is CSS: its sections flow into one, two or three text columns from the width it is given, with nothing measured. That fits this plan as it is. The function gives the document a width and never looks inside. Folding a section or opening a row changes height only and asks for no pass.
Four things about it bear on the plan. The second has been seen in a framework fixture; part B records both of the first two on the Party sheet.
shouldCurrentlyFillAvailble() is true for an inline document only when no level follows it. Open a tile past the inlined levels and the document stops filling: it becomes a fixed column at its target width, and can be hidden like any other. So a sheet three text columns wide drops to one, or disappears, when a spell is opened from it. C reproduces this. Whether it is wanted is a part D question.nodeMinTileWidth means more than one thing. For a document it is the column's target width, and it is the width of one text column inside the document. (It has two more readers; see Two fixes that are decisions.) They are read from different nodes: the target width from the column's own node, the text column width and the fill test from the node it presents (nodePresentedNode, as a character presents its sheet). The claim should come from one node, and I had put the presented one into part A. The review found a case where the two differ (the Party tab and a solo sheet), so that is now a separate decision and C keeps each value's source as it is.One trigger. browser.setNeedsLayerAllocation() schedules one pass for the end of the cycle. A level's sync works out its claim, which reads only the model, and asks for a pass only when the claim differs from the last one it gave. So a streamed chunk that changes no claim costs a comparison per level and no pass.
Comparing claims is not enough by itself. A stack that replaces another can have exactly the old one's claim and still never have been given an answer. So the browser is also asked for a pass whenever a stack in its chain is added, replaced, removed or put back on the page, whatever the claims say. It is asked on a real change only: clearOtherView() runs even when there is nothing to clear, and asking from there without looking would bring back a pass on every sync. (review, review 2)
What is left alone in C. An embedded browser goes on getting its width from its container's resize observer. Anchored panes keep their own layout. Every companion keeps its own sizing, side or bottom; a bottom one is handed its height (A6).
None is in C. Together they are the road from C to the one protocol described in Compaction in the lens model: each brings another kind of edge, or another of the lens's decisions, under the same claims and the same allocation.
SvAnchoredTabsLayout, which goes on dividing the width it is given."left" and "up" directions, and compaction along the vertical axis. See Four directions."down" in place of hiding columns. A single-column phone mode is the far end of this.| Asks | Detail |
|---|---|
| The chain changed | A stack was added, replaced, removed or put back on the page. This is asked from the stack itself, on a real change of which stack is there or whether it is on the page, and not from the path notification, which compares the path's titles joined together and so says nothing when a sibling with the same title is chosen. Mending that notification is navigation work and is not in this plan: it would wake the breadcrumbs, the URL and other listeners on more events. (review 2) It also changes which column is last and so which may fill. (review) |
| The root width changed | Window resize at the root; the container's resize observer for an embedded browser, including the first real width it reports. |
| A level's claim changed | Found by the level's own sync comparing claims. Covers a width hint, the thumbnail allowance (it follows the first subnode), the direction, a presented node, the header region. |
| A companion's claim changed | Docked or undocked by the user, or its width hint moved. The hint comes from the embedded browser's path notification, so this one crosses from the inner browser to the outer, and it misses a same-title sibling too. C records and keeps that. If the outer width should follow such a swap, the companion would refresh its hint on the inner chain's change and tell the outer browser only when the hint moved; that is a correction of its own, apart from C. (review 2) |
| The anchored reservation changed | Not only a pin. An ordinary tap on a tab can move a group's pin, and a tab becoming available can change the largest unpinned minimum. The level compares its reservation and asks when it differs. The test uses an anchored level that claims less than the whole root, so a stale reservation shows in the column before it. (review 2) |
A node update that changes none of these asks for nothing.
TestLayerAllocation runs whole chains through the function: depth, mixed directions with a "down" level at the root, middle and end (made up for the test, since a real anchored level ends its chain), an anchored reservation at the end of a chain, reservations on one level and on two, a fill column, the one-pixel margin and its 1px edge, a root with no width yet, two reservations that come to more than the root holds, an anchored level with the full-width flag, and the one-to-two-widths rule. This is the written protocol in executable form, and it covers the chain, not one level.uncollapse() re-syncs the column's orientation and its tiles. C must keep the tiles' part of that and move the width's part into applyLayerAnswer().targetWidth(), which reads a width and can measure, while promising a comparison that reads only the model.These were the recommendations; they are now the plan. Any of them can be reopened.
SvLayerAllocation, layerClaim(), setNeedsLayerAllocation() and TestLayerAllocation. A level is not always a column (it may be a row, a set of tabs or an inline document), "column" also means a text column inside a document, and the paper's word for the unit is a layer. "Compaction coordinator" stays as the plan's name."left" and "up" add nothing to the allocation.applyLayerAnswer().SvDetailView and SvCompanionView. C hands its reservation to the function and removes the loop by doing companions before columns."left". The allocation is the same either way.All nine were answered, and the answers are folded in above. In short:
syncMinWidthClaim() for C; the one owner also owns flex grow and shrink.SvAnchoredTabsLayout apart for good, sharing the protocol at its edge.Two edits to the contract came with them, both made: the anchored reservation is a fixed width or a flag, and the 1px edge of the cap is a named case.
nodeCompanionNode() hook on plain nodes, with no Lab page. The reviewer built both in Chromium.No questions were outstanding. The reviewer read the recordings and said part A can start. It corrected two claims of mine (the resize is 7 to 9 passes at 31 of 32 steps, with 12 where a pane reopens; and the cost of a streamed chunk was not measured), supplied the width comparison A3 needs, and asked for two changes to the tests, both made: the baseline is kept safe from reruns, and the width spec says which column and how wide at most.
tests/e2e/away-rolls-switch.spec.js, two players on dev): drawn in Settings for owner and guest, switched off by a mouse click as the guest and back on as the owner, and both windows showed each change. Two things it turned up, neither mended: a click on the row's label does not switch it, only a click on the switch itself; and in the Settings pane at a 1,280px window the label is cut short ("GM rolls for away players after a mi…").