Skip to content

library: the section table learns about servers, and the toolbar gets its Source chip - #31

Closed
GLinnik21 wants to merge 1 commit into
shared-servers-basefrom
worktree-agent-aee2537e32604e837
Closed

GLinnik21 wants to merge 1 commit into
shared-servers-basefrom
worktree-agent-aee2537e32604e837

Conversation

@GLinnik21

@GLinnik21 GLinnik21 commented Aug 13, 2026 •

Copy link
Copy Markdown
Collaborator

Deliverable A of the Shared Sources design: the Library's section table goes multi-server, and the toolbar gets its Source chip and the two-level Sources list. Deliverable B is answered by subtraction here too — the tab strip keeps naming types, not people.

What changed

The table is addressed by (SOURCE, section). Both servers have a section 1 and they are different libraries, so a bare key names two things. Every fetch is issued through client_for(sid) captured at the spawn site — the rule browse.rs already stated for its page worker and did not keep.

It grows by APPEND, never by rebuild. A page landing is blamed on a section INDEX, so a table that reshuffled under an in-flight fetch would splice one library's items into another's store. ensure_sections's early-return was the only thing preventing that; appending replaces it and holds for every source. Two generations now: SECTIONS_GEN (shape, moves on an append — what the label caches key on) and EPOCH (identity, moves on reset alone — what index-blamed landings gate on), so one source's append cannot discard another's answer.

Only the current server is discovered on the main thread. ensure_sections runs at boot and on every Library entry; fanning out there would park the SDL loop for one connect(2) per unreachable share. Every other source is discovered by a worker off pump — sections, then the server's own friendlyName, then a size=0 count probe per library — with a 10 s per-source backoff.

The Source chip, first in the toolbar: Library · LDN Films bamx23 ▾, the handle a MICRO run at 62% of the label's own ink, absent entirely on your own libraries. With one source the chip is not drawn and the list does not exist. Its 640-wide panel has two levels swapped by pills at the top: Browse (one tick, no words, OK closes) and On Home (the word On/Off, OK flips, the panel stays open). Groups are servers — machine as header, person as accessory. Last pinned dims its value and states the rule. An unreachable group dims whole and still reads On.

The toolbar is a typed chip list. on_ok matched on the chip's INDEX with a _ catch-all, so inserting Source at 0 would have made it open Sort while Sort and Filter both opened Filter — silently. open_chip_menu is the one exhaustive chip → action map and the pointer path calls it directly.

Picking a library on another server moves the app's current server (§5's named cheap variant). Without it the panel is a trap: PmsMovie carries no ServerId, posters and ratingKey resolution go through client(), and ratingKeys are server-local — so OK on a friend's card would open and play a different title of yours with the same number. Home's catalog is dropped and re-armed asynchronously; route's cached machineIdentifier is forgotten.

TableView gained the two things it lacked: Section::accessory was declared and never painted, and Section::dim is one alpha over header, accessory, rows and the selection pill.

Host gate

  • make check green three times, 419 → 431 tests.
  • make and make RELEASE=1 both link (ARM).
  • code-review high run; all seven findings addressed (four were latching bugs of the same shape as this module's known single-flight one — an empty count landing latching the probe off, reachable unable to flip back after discovery, "Check for new shares" only re-asking known-dead sources, and the chip mixing a queued name with a committed handle). The one finding left open is pre-existing and belongs to the probe/ingest unit: auth.rs:396 has no address-family filter, so includeIPv6=1 can now store an address stream.rs (AF_INET, dotted-quad) can never dial.

Device verification — deferred to coordinator

Not verified on device. The television was unavailable for the whole of this work; nothing below has been seen.

Setup

The second server must be injected, since nothing else registers one yet.

  1. Resolve the share's credentials from plex.tv with the owner token (never printed):
    python3 - <<'EOF'
    import json,os,sys
    REPO="<worktree>"; sys.path.insert(0, os.path.join(REPO,"tests")); os.chdir(REPO)
    import run as h
    t=h.read_token(); r=[x for x in h._server_resources(h._plextv_resources(t)) if not x.get("owned")][0]
    host,port,_=h.pick_connection(r)
    print(json.dumps([{"name":r["name"],"machine_id":r["clientIdentifier"],
                       "handle":r.get("sourceTitle") or "","host":host,"port":int(port),
                       "token":r["accessToken"]}],separators=(",",":")))
    EOF
    
    For this account that resolves to bx23-ldn, handle bamx23, <share-ip-redacted>:<share-port-redacted> (plain HTTP; httpsRequired=false).
  2. ssh root@$TV 'cat > /tmp/plxnative-servers' with that JSON, then tools/tv-session.sh up --screen library --keep (--keep so the clear does not remove it). The app registers it in install_pms and logs servers: #0 name="bx23-ldn" handle="bamx23" … and then browse: roster now 2 source(s).

Give the friend's libraries a few seconds to arrive: their discovery is a WAN worker driven by pump, which only runs while the Library screen is up.

The six frames, and what a correct one looks like

tools/capture-screen.sh out.png DISPLAY, then look at it.

# How to get there Correct frame
1 up --screen library with no plxnative-servers Toolbar at y≈134 has exactly two chips from x=90: Sort · Title, Filter · All. No Source chip, no empty slot.
2 with the share armed, boot to library (your own Movies) Three chips; the first reads Library · <your library> with a chevron and no handle run at all — this is the one to look at hardest, because an empty run would show as extra width before the chevron.
3 key up (grid → toolbar, focus lands on Source), key ok 640-wide panel at x=90, y=204. Two pills at its top: Browse filled (subtle white pill, primary ink), On Home bare tertiary text. Below: one group per server — header Gleb's Mac mini with no accessory, header bx23-ldn with bamx23 right-aligned on the same line one rung down. Rows are two-line (Movies over 185 films). Exactly one tick, on the library you are browsing. No On/Off anywhere. Last row, under a hairline: Check for new shares.
4 key up (onto the pills), key right Same panel, same height, nothing has moved. On Home now filled, Browse bare. Every library row reads On or Off at its trailing edge — your own On, the friend's Off. No ticks anywhere.
5 key down (into the rows), key ok on your first library, then key down The row you unpinned reads Off. The remaining pinned row's On is dimmer than the other rows' words while its label stays full-strength, and its sub-line reads Home needs one library instead of its size. key ok on it must do nothing at all — no flash, no toast, the word does not change.
6 with the panel open, make the share unreachable — on the TV: ip route add blackhole <share-ip-redacted> — then key ok on Check for new shares and wait ~10 s The bx23-ldn group dims whole at .52 — header included, its accessory reads Not reachable · bamx23, and its rows still read On. Your own group is untouched. (Undo with ip route del blackhole <share-ip-redacted>.)

Also worth one look, since it is the riskiest interaction: on the Browse level, ok on a row of the friend's group must close the panel, dissolve the grid, relabel the chip to Library · <their library> bamx23, and leave the type pill selected in the top strip (their films keep Movies lit). The event log should show browse: current server is now source 1.

FPS gate

./tests/run.py --fps once, at the end. The library scenes arm /tmp/plxnative-library — note =N now names a tab pill; with one source that is unchanged.

🤖 Generated with Claude Code

https://claude.ai/code/session_01TxZ585ehWMnuScciTQ9WgV

… its Source chip

Deliverable A of the Shared Sources design. The Library's section table described
one server — a bare `key` with no server on it, a flat `SECTIONS`, and an
`ensure_sections` that fetched from whatever `client()` happened to be. Measured
against the real share on 2026-08-11, both servers have a section `1` and they are
different libraries, so a bare key names two things. The table is now addressed by
(SOURCE, section), and every fetch is issued through `client_for(sid)` CAPTURED AT
THE SPAWN SITE — the rule this file already stated for its page worker and did not
keep.

IT GROWS BY APPEND AND NEVER BY REBUILD, and that is the soundness argument, not a
detail. A page landing is blamed on a section INDEX, so a table that reshuffled
under an in-flight fetch would splice one library's items into another's store.
`ensure_sections`'s early-return was the only thing preventing that; appending
replaces it and holds for every source, not only for the second call. Two
generations now, each with one job: SECTIONS_GEN (shape — moves on an append, what
the label caches key on) and EPOCH (identity — moves on `reset` alone, what
index-blamed landings gate on), because one source's append must not discard
another source's answer.

ONLY THE CURRENT SERVER IS DISCOVERED ON THE MAIN THREAD. `ensure_sections` runs at
boot and on every Library entry, so fanning out there would park the SDL loop for
one connect(2) per unreachable share — seconds of frozen boot because a friend
switched their server off. Every other source is discovered by a worker off `pump`:
sections, then the server's own friendlyName (`GET /`, so a roster that never
reached plex.tv can still head its group with a machine name), then a size=0 count
probe per library. Ten-second per-source backoff. A dead share arrives as
`reachable: false` and costs the main thread nothing.

THE SOURCE CHIP, first in the toolbar: `Library · LDN Films  bamx23 ▾`, the handle a
MICRO run at 62% of the label's own ink and ABSENT ENTIRELY on your own libraries —
absence, not an empty run. With one source the chip is not drawn at all and the list
does not exist. Its panel is 640 wide because the rows are two-line, with two levels
swapped by pills at the panel top: Browse, a picker with one tick and no words, and
On Home, switches whose word is the only mark. The levels never mirror each other's
marks — a mark says where you are, a word says what is set. A server is a group whose
header is the MACHINE and whose accessory is the PERSON; the last pinned library dims
its VALUE and states the rule on its sub-line while its label keeps live ink; an
unreachable server's group dims whole at one alpha and still reads On, because
nothing was unpinned.

The toolbar is a TYPED chip list now, and that is a fix rather than a tidy-up: `on_ok`
matched on the chip's INDEX with a `_` catch-all, so inserting Source at 0 would have
made it open the Sort menu while Sort and Filter both opened Filter — silently, since
every index still resolved to something. `open_chip_menu` is the one chip → action
map, exhaustive so a new chip is a compile error, and the pointer path calls it
directly instead of deferring to `on_ok` (which reads the FOCUSED chip, so the two
agreed by side effect rather than by construction). The test asserts chip → menu by
IDENTITY and the row's contents by order, and pins position nowhere.

THE TAB STRIP DELIBERATELY DOES NOT CHANGE (deliverable B, "answered by subtraction").
`browse::tab_*` projects the table to one pill per TYPE — your own sections, plus any
type only a friend has — so the strip is the same width at one friend or at ten, and
a borrowed library's selection capsule rests on its type's pill. With one source it is
the identity map, so a single-server install draws exactly the strip it always did.
`/tmp/plxnative-library=N` therefore names a PILL now; the comment says so.

PICKING A LIBRARY ON ANOTHER SERVER MOVES THE APP'S CURRENT SERVER, which is
`docs/shared-servers.md` §5's named cheap variant and is here because without it this
panel is a trap. `PmsMovie` carries no ServerId, so a borrowed card's poster is
fetched from `client()` and its ratingKey resolved through `client()` — and ratingKeys
are server-local, so OK on a friend's card would quietly open, and play, a different
title of yours with the same number. Moving `current` makes them agree. The cost is
stated rather than hidden: Home's catalog belongs to the server it came from, so it is
dropped and re-armed asynchronously, and `route`'s cached machineIdentifier is
forgotten so the next PlayQueue names the right machine. Threading ServerId through
the stored structs retires the seam.

Two things `TableView` was missing for the panel, both now in the shared component
rather than drawn in the screen: `Section::accessory` was declared and NEVER PAINTED,
and `Section::dim` is one alpha over header, accessory, rows and the selection pill —
not `Row::dim` per row, because the state is a fact about the GROUP and a dimmed row's
own "On" must stay legible as itself.

Four latching bugs the review caught, all the same shape as the single-flight one this
module already had: an empty count landing no longer latches the probe off; `reachable`
is now written by every page fetch, in both directions, so a server that goes offline
after discovery can still dim; "Check for new shares" re-asks EVERY source rather than
only the ones already known to be down, and a library created since is appended; and
the Source chip reads the QUEUED section's owner, so the handle does not pop in 70 ms
after the name it belongs to.

Host 419 -> 431 (`make check` green three times), `make` and `make RELEASE=1` both
link. NOT VERIFIED ON DEVICE — the television was unavailable for the whole of this
work; the PR carries the recipe.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01TxZ585ehWMnuScciTQ9WgV
Copilot AI lite review requested due to automatic review settings August 13, 2026 21:42

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.

Pull request overview

Implements Deliverable A of the Shared Sources design by making the Library section table multi-server (addressed by (source, section)), adding a typed Source chip to the Library toolbar with a two-level Sources panel, and plumbing server “facts” (machine name / handle / ownership) through the server registry so UI can present multi-server context safely.

Changes:

  • Refactors browse to maintain an append-only multi-source section table, with worker-driven discovery for non-current servers and epoch-based gating for index-blamed landings.
  • Adds the Library toolbar Source chip + two-level Sources panel (Browse vs On Home), plus TableView support for section header accessories and whole-group dimming.
  • Introduces plex::ServerFacts and supporting APIs, plus Client::friendly_name(), to keep server identity/ownership metadata available beyond the client’s dial address.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/run.py Extends injected server payload to include the owner handle (sourceTitle).
rust-modules/src/ui/widgets.rs Updates tab-strip sizing/caching to use the new tab projection (browse::tab_*).
rust-modules/src/ui/table.rs Adds Section::accessory painting and Section::dim to support multi-server grouping in menus.
rust-modules/src/ui/library.rs Adds typed toolbar chips, the Source chip, and the two-level Sources panel + related tests.
rust-modules/src/ui/CLAUDE.md Updates UI contribution docs to reflect the new Library toolbar/Sources panel behavior.
rust-modules/src/route.rs Adds forget_server_identity() to clear cached machineIdentifier when switching servers.
rust-modules/src/plex/servers.rs Adds ServerFacts storage and APIs (ids, facts, describe) alongside the server registry.
rust-modules/src/plex/models.rs Adds friendlyName to MediaContainer for GET / parsing.
rust-modules/src/plex/mod.rs Re-exports new server-facts APIs/types.
rust-modules/src/plex/library.rs Adds Client::friendly_name() helper.
rust-modules/src/dev.rs Adds handle to injected dev server schema + logging and tests.
rust-modules/src/browse.rs Core refactor: multi-source roster + append-only sections, tab projection, pinning, and discovery workers.
rust-modules/src/app.rs Registers additional servers from dev trigger and describes them in the registry.
docs/shared-servers.md Documents Deliverable A implementation details and remaining follow-ups.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +374 to 383
if s.name.is_empty() || s.handle.is_empty() {
if let Some(f) = crate::plex::server_facts(sid) {
if s.name.is_empty() {
s.name = f.name.clone();
}
if s.handle.is_empty() {
s.handle = f.handle.clone();
}
}
}
Comment on lines +1121 to +1126
// answer without a second `GET /`. `owned` is carried through unchanged: this describer
// learned a name, not a grant.
if let Some(s) = sources().get(si) {
let owned = s.handle.is_empty();
crate::plex::describe_server(s.sid, &name, "", owned);
}
GLinnik21 added a commit that referenced this pull request Aug 13, 2026
…no pill

Builds on #31's projection rather than replacing it: the strip stays "your own
libraries, plus a type only a friend has", and this makes that second half work.

`is_show: bool` has two values, so "does an owned library have this KIND" — the
test that decides whether a borrowed library gets its own pill — answers YES for
a friend's MUSIC library on the strength of your films. It would fold onto your
Movies pill, and everything in it would be unreachable from the strip. The other
half of the same gap was one layer up: `project_sections` dropped `artist` and
`photo` at discovery, so those types could never reach the projection to be
missing from it. A type dropped at the door cannot be the growth case.

So `SecKind` (Movie/Show/Music/Photo) replaces the boolean, discovery keeps every
type this product has a level for, and the projection compares by type. A music
library browses like any other section — the listing, its server-driven sorts and
the A-Z rail are all type-agnostic, and this account's own /hubs already put a
Recently Added Music shelf on Home, so the content was at the top level before it
had a tab. What is still missing is the level BELOW the grid: an artist opens the
movie detail page, which has nothing to play. That belongs to whoever builds the
music level; the strip's job is to say the type exists.

Two more things the multi-source table made true and one bug of my own:

- The label + width cache moves off the section table's generation onto the
  STRIP's (`browse::tabs_gen`), bumped only when the projected pill list actually
  changes. The table's generation now moves once per source as libraries land,
  and most of those fold onto pills already drawn — so the row was re-measuring
  every pill, several times a boot, on Home's hot path, for a strip that had not
  moved.
- `Nav::Library` carries a TAB and `pill = section + 1` is not true any more.
  Three comments still said "the first section" where they meant "the first tab"
  (the navosc scene, `select_pill`, the FPS manifest) and `nav.rs`'s TAB doc said
  the pill was a section index plus one. Wording only — #31 wired the arithmetic
  correctly; a doc that lies about an index space is how the next edit gets it
  wrong.
- `tabs()` compared the old and new projection with `addr_of!(TABS).read()`,
  which copies the Vec BITWISE and then drops the copy — freeing the buffer the
  static still points at. A double free that aborts the process, found by the new
  invariance test rather than by review. It borrows now.

The deliverable is host-provable, which matters because there is no host runtime:
`the_strip_is_the_same_row_at_one_friend_and_at_three` grows the roster to eleven
libraries across four sources and asserts the pill list never moves — the width
follows, since every pill's width is a pure function of its label.

Fixture names use the canonical stand-ins (`friend`, `nas-home`, `Film Club`),
which are also character-length-preserving for the width assertions in home.rs.
@GLinnik21

Copy link
Copy Markdown
Collaborator Author

Superseded by #47, which is the integration branch this unit was built for and which now carries the whole feature.

Closed rather than merged because #47 already contains this work — verified before closing, not assumed: every commit on this branch is either an ancestor of #47 or reached it through the shared servers, squashed commit, and the one genuine follow-up that was NOT in it (the OK NAVIGATES test on #27) has been cherry-picked across.

The review record lives here; the code ships there.

@GLinnik21 GLinnik21 closed this Aug 15, 2026
GLinnik21 added a commit that referenced this pull request Aug 15, 2026
…no pill

Builds on #31's projection rather than replacing it: the strip stays "your own
libraries, plus a type only a friend has", and this makes that second half work.

`is_show: bool` has two values, so "does an owned library have this KIND" — the
test that decides whether a borrowed library gets its own pill — answers YES for
a friend's MUSIC library on the strength of your films. It would fold onto your
Movies pill, and everything in it would be unreachable from the strip. The other
half of the same gap was one layer up: `project_sections` dropped `artist` and
`photo` at discovery, so those types could never reach the projection to be
missing from it. A type dropped at the door cannot be the growth case.

So `SecKind` (Movie/Show/Music/Photo) replaces the boolean, discovery keeps every
type this product has a level for, and the projection compares by type. A music
library browses like any other section — the listing, its server-driven sorts and
the A-Z rail are all type-agnostic, and this account's own /hubs already put a
Recently Added Music shelf on Home, so the content was at the top level before it
had a tab. What is still missing is the level BELOW the grid: an artist opens the
movie detail page, which has nothing to play. That belongs to whoever builds the
music level; the strip's job is to say the type exists.

Two more things the multi-source table made true and one bug of my own:

- The label + width cache moves off the section table's generation onto the
  STRIP's (`browse::tabs_gen`), bumped only when the projected pill list actually
  changes. The table's generation now moves once per source as libraries land,
  and most of those fold onto pills already drawn — so the row was re-measuring
  every pill, several times a boot, on Home's hot path, for a strip that had not
  moved.
- `Nav::Library` carries a TAB and `pill = section + 1` is not true any more.
  Three comments still said "the first section" where they meant "the first tab"
  (the navosc scene, `select_pill`, the FPS manifest) and `nav.rs`'s TAB doc said
  the pill was a section index plus one. Wording only — #31 wired the arithmetic
  correctly; a doc that lies about an index space is how the next edit gets it
  wrong.
- `tabs()` compared the old and new projection with `addr_of!(TABS).read()`,
  which copies the Vec BITWISE and then drops the copy — freeing the buffer the
  static still points at. A double free that aborts the process, found by the new
  invariance test rather than by review. It borrows now.

The deliverable is host-provable, which matters because there is no host runtime:
`the_strip_is_the_same_row_at_one_friend_and_at_three` grows the roster to eleven
libraries across four sources and asserts the pill list never moves — the width
follows, since every pill's width is a pure function of its label.

Fixture names use the canonical stand-ins (`friend`, `nas-home`, `Film Club`),
which are also character-length-preserving for the width assertions in home.rs.
@GLinnik21
GLinnik21 deleted the worktree-agent-aee2537e32604e837 branch August 22, 2026 23:25
GLinnik21 added a commit that referenced this pull request Aug 26, 2026
…no pill

Builds on #31's projection rather than replacing it: the strip stays "your own
libraries, plus a type only a friend has", and this makes that second half work.

`is_show: bool` has two values, so "does an owned library have this KIND" — the
test that decides whether a borrowed library gets its own pill — answers YES for
a friend's MUSIC library on the strength of your films. It would fold onto your
Movies pill, and everything in it would be unreachable from the strip. The other
half of the same gap was one layer up: `project_sections` dropped `artist` and
`photo` at discovery, so those types could never reach the projection to be
missing from it. A type dropped at the door cannot be the growth case.

So `SecKind` (Movie/Show/Music/Photo) replaces the boolean, discovery keeps every
type this product has a level for, and the projection compares by type. A music
library browses like any other section — the listing, its server-driven sorts and
the A-Z rail are all type-agnostic, and this account's own /hubs already put a
Recently Added Music shelf on Home, so the content was at the top level before it
had a tab. What is still missing is the level BELOW the grid: an artist opens the
movie detail page, which has nothing to play. That belongs to whoever builds the
music level; the strip's job is to say the type exists.

Two more things the multi-source table made true and one bug of my own:

- The label + width cache moves off the section table's generation onto the
  STRIP's (`browse::tabs_gen`), bumped only when the projected pill list actually
  changes. The table's generation now moves once per source as libraries land,
  and most of those fold onto pills already drawn — so the row was re-measuring
  every pill, several times a boot, on Home's hot path, for a strip that had not
  moved.
- `Nav::Library` carries a TAB and `pill = section + 1` is not true any more.
  Three comments still said "the first section" where they meant "the first tab"
  (the navosc scene, `select_pill`, the FPS manifest) and `nav.rs`'s TAB doc said
  the pill was a section index plus one. Wording only — #31 wired the arithmetic
  correctly; a doc that lies about an index space is how the next edit gets it
  wrong.
- `tabs()` compared the old and new projection with `addr_of!(TABS).read()`,
  which copies the Vec BITWISE and then drops the copy — freeing the buffer the
  static still points at. A double free that aborts the process, found by the new
  invariance test rather than by review. It borrows now.

The deliverable is host-provable, which matters because there is no host runtime:
`the_strip_is_the_same_row_at_one_friend_and_at_three` grows the roster to eleven
libraries across four sources and asserts the pill list never moves — the width
follows, since every pill's width is a pure function of its label.

Fixture names use the canonical stand-ins (`friend`, `nas-home`, `Film Club`),
which are also character-length-preserving for the width assertions in home.rs.
GLinnik21 added a commit that referenced this pull request Aug 27, 2026
…no pill

Builds on #31's projection rather than replacing it: the strip stays "your own
libraries, plus a type only a friend has", and this makes that second half work.

`is_show: bool` has two values, so "does an owned library have this KIND" — the
test that decides whether a borrowed library gets its own pill — answers YES for
a friend's MUSIC library on the strength of your films. It would fold onto your
Movies pill, and everything in it would be unreachable from the strip. The other
half of the same gap was one layer up: `project_sections` dropped `artist` and
`photo` at discovery, so those types could never reach the projection to be
missing from it. A type dropped at the door cannot be the growth case.

So `SecKind` (Movie/Show/Music/Photo) replaces the boolean, discovery keeps every
type this product has a level for, and the projection compares by type. A music
library browses like any other section — the listing, its server-driven sorts and
the A-Z rail are all type-agnostic, and this account's own /hubs already put a
Recently Added Music shelf on Home, so the content was at the top level before it
had a tab. What is still missing is the level BELOW the grid: an artist opens the
movie detail page, which has nothing to play. That belongs to whoever builds the
music level; the strip's job is to say the type exists.

Two more things the multi-source table made true and one bug of my own:

- The label + width cache moves off the section table's generation onto the
  STRIP's (`browse::tabs_gen`), bumped only when the projected pill list actually
  changes. The table's generation now moves once per source as libraries land,
  and most of those fold onto pills already drawn — so the row was re-measuring
  every pill, several times a boot, on Home's hot path, for a strip that had not
  moved.
- `Nav::Library` carries a TAB and `pill = section + 1` is not true any more.
  Three comments still said "the first section" where they meant "the first tab"
  (the navosc scene, `select_pill`, the FPS manifest) and `nav.rs`'s TAB doc said
  the pill was a section index plus one. Wording only — #31 wired the arithmetic
  correctly; a doc that lies about an index space is how the next edit gets it
  wrong.
- `tabs()` compared the old and new projection with `addr_of!(TABS).read()`,
  which copies the Vec BITWISE and then drops the copy — freeing the buffer the
  static still points at. A double free that aborts the process, found by the new
  invariance test rather than by review. It borrows now.

The deliverable is host-provable, which matters because there is no host runtime:
`the_strip_is_the_same_row_at_one_friend_and_at_three` grows the roster to eleven
libraries across four sources and asserts the pill list never moves — the width
follows, since every pill's width is a pure function of its label.

Fixture names use the canonical stand-ins (`friend`, `nas-home`, `Film Club`),
which are also character-length-preserving for the width assertions in home.rs.
GLinnik21 added a commit that referenced this pull request Aug 28, 2026
…no pill

Builds on #31's projection rather than replacing it: the strip stays "your own
libraries, plus a type only a friend has", and this makes that second half work.

`is_show: bool` has two values, so "does an owned library have this KIND" — the
test that decides whether a borrowed library gets its own pill — answers YES for
a friend's MUSIC library on the strength of your films. It would fold onto your
Movies pill, and everything in it would be unreachable from the strip. The other
half of the same gap was one layer up: `project_sections` dropped `artist` and
`photo` at discovery, so those types could never reach the projection to be
missing from it. A type dropped at the door cannot be the growth case.

So `SecKind` (Movie/Show/Music/Photo) replaces the boolean, discovery keeps every
type this product has a level for, and the projection compares by type. A music
library browses like any other section — the listing, its server-driven sorts and
the A-Z rail are all type-agnostic, and this account's own /hubs already put a
Recently Added Music shelf on Home, so the content was at the top level before it
had a tab. What is still missing is the level BELOW the grid: an artist opens the
movie detail page, which has nothing to play. That belongs to whoever builds the
music level; the strip's job is to say the type exists.

Two more things the multi-source table made true and one bug of my own:

- The label + width cache moves off the section table's generation onto the
  STRIP's (`browse::tabs_gen`), bumped only when the projected pill list actually
  changes. The table's generation now moves once per source as libraries land,
  and most of those fold onto pills already drawn — so the row was re-measuring
  every pill, several times a boot, on Home's hot path, for a strip that had not
  moved.
- `Nav::Library` carries a TAB and `pill = section + 1` is not true any more.
  Three comments still said "the first section" where they meant "the first tab"
  (the navosc scene, `select_pill`, the FPS manifest) and `nav.rs`'s TAB doc said
  the pill was a section index plus one. Wording only — #31 wired the arithmetic
  correctly; a doc that lies about an index space is how the next edit gets it
  wrong.
- `tabs()` compared the old and new projection with `addr_of!(TABS).read()`,
  which copies the Vec BITWISE and then drops the copy — freeing the buffer the
  static still points at. A double free that aborts the process, found by the new
  invariance test rather than by review. It borrows now.

The deliverable is host-provable, which matters because there is no host runtime:
`the_strip_is_the_same_row_at_one_friend_and_at_three` grows the roster to eleven
libraries across four sources and asserts the pill list never moves — the width
follows, since every pill's width is a pure function of its label.

Fixture names use the canonical stand-ins (`friend`, `nas-home`, `Film Club`),
which are also character-length-preserving for the width assertions in home.rs.
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