Skip to content

sources: render server state and fix the signed-in owner chip - #60

Merged
GLinnik21 merged 3 commits into
mainfrom
b3-sources-ui
Aug 24, 2026
Merged

GLinnik21 merged 3 commits into
mainfrom
b3-sources-ui

Conversation

@GLinnik21

@GLinnik21 GLinnik21 commented Aug 23, 2026 •

Copy link
Copy Markdown
Collaborator

What this keeps

PR #60 now contains only the product-aligned half of lane B3.

Sources render all four states and the winning tier

The Sources panel now distinguishes NotProbed, Reachable, Unauthorized, and Unreachable instead of collapsing them into a two-state reachable flag. Unauthorized points at a grant/token problem rather than misleading the user toward their network.

For reachable sources, Remote and Relay are shown; Local stays implicit. Faulted sources show the fault without also presenting a stale tier.

The profile chip agrees with the account menu

A signed-in account without Plex Home previously had an empty active-profile title, so the top-bar chip said Sign in while the account menu correctly offered Sign out. Both surfaces now use the same account resolver and cannot disagree.

Product decision: no manual server entry

Commit 8ea4bf28 reverts the manual Add server by address UI. It contradicted the recorded owner ruling that servers are configured on a phone or computer and only selected on the television. Its backend was also intentionally absent, so retaining the control would have exposed an action guaranteed to time out.

Remote-reviewer connectivity is handled by the T2/T3 HTTPS discovery chain through ordinary Plex sign-in. T3b therefore only needs to publish real SourceState and winning Location; it does not need a manual-source backend.

Verification

  • make check: 1,075 Rust tests passed.
  • Repository lint passed.
  • Flavor self-test passed.
  • Harness tests: 52 passed.
  • --no-default-features check passed.
  • Not device-verified; the integration television session remains the device gate.

Generated with Codex while resuming Claude Code session 74f05522-98f0-47b7-b8a5-63c36a8a7685.

GLinnik21 and others added 2 commits August 23, 2026 14:28
… a signed-in owner signed out

Two things the Sources panel and the shared top bar were saying wrongly. Neither depends on the
other; both are the words a surface uses about a fact it already had.

**The Sources panel renders all four `SourceState` variants, and the winning tier.** It drew a
two-state "Not reachable" off `SrcGroup::reachable()`, which is the only question a `bool` could
answer. The group header's accessory is now `[state] · [tier] · handle`, state FIRST — the accessory
is the last run on that line and elides from the right, so leading with the state means a
34-character plex.tv handle is what gives way rather than the fact that a server is not answering.

`Not authorized` is the point of the change. A 401 is a sharing-grant problem whose remedy is one
row down in the same panel — "Check for new shares" IS the `/api/v2/resources` refetch that reissues
the per-(user, server) token. Calling it "not reachable" sends the user to look at a router for
something no router was ever part of. `NotProbed` says nothing, and that is not an omission: a group
only reaches this list once its libraries have landed, so "nobody has dialled" there is a fact about
our own instrumentation, and stating it would put a warning on a working server.

Relay and Remote are spoken; Local is not. Relay is a ~2 Mbit/s tunnel the server transcodes down to
fit, which reads as a broken server unless something says why; Remote explains a slower first frame
and a transcode on a file that direct-plays at home; Local is what a server is expected to be, and
annotating every group with it is noise. A tier is only spoken for a group that WORKS — "Not
reachable · Relay · friend" reads as three problems where there is one.

The dim is a new question. `SrcGroup::reachable()` answers the old two-state one, in which
`Unauthorized` comes back `true` — not because it is browsable but because a `bool` had no way to
say otherwise. `usable()` is an exhaustive match, so a fifth state has to be given an answer rather
than inheriting one, and it still defers to `reachable()` for the three states that method gets
right. `browse.rs` needed no edit.

**And the profile chip.** It decided signed-in-ness from `current().title.is_empty()`, but an
account without Plex Home never gets a profile written at all — so that title is empty for a
signed-in owner, and the chip offered them "Sign in" while the menu behind it already headed itself
with their name and offered "Sign out". On a fresh single-user test account that is the first thing
a reviewer sees. `ui/account_menu.rs`'s module doc has recorded it since the menu was converted, and
named `ui/widgets.rs` as the fix site.

Fixed by moving the words rather than writing the same match a second time: `chip_label` is the one
resolver, it lives beside the rows it has to agree with, and the chip calls it. The avatar's initial
comes off the same name, so a chip reading "Gleb" can never carry somebody else's letter. `peek`,
not `load` — drawing a chip must never be able to WRITE the session file — and the read is inside
the generation-keyed cache, which is the shape `session::peek`'s own "no per-frame reader" note asks
for.

1075 host tests (1069 on the base). Prose corrected where this makes it false: `plex/session.rs`'s
`Account` doc, and `docs/parity-gaps.md`'s now-closed chip entry.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G
**This commit contradicts a recorded OWNER RULING and is separated from the one before it for that
reason.** `docs/shared-servers.md` §12, dated 2026-08-21, quotes the owner — *"Servers are
configured on a PC or phone. On the television we only CHOOSE from the available servers"* — and
states the consequence: "There is no add-a-server-by-address on the television, and there will not
be." The ruling is left STANDING and annotated rather than rewritten; an agent may not overturn it.
Dropping this commit leaves the one before it building and green, which is the point of the split.

The case that argued for reopening it is `docs/lg-self-checklist.md` #20/#43/#47: a QA bench not on
the same IPv4 LAN as a plaintext-HTTP PMS dead-ends at "no server found", and the app had no surface
anywhere that could be typed an address. That is a question about a REVIEWER being unable to
evaluate the app at all, which is not the question the ruling answered — it may or may not move it.

**No new `Route` and no screen.** It is two rows in the tail of the popover that already exists,
beside "Check for new shares", which is the other answer to "my server is missing" — putting them
side by side is the point. Closed it is one row; open it is the field plus its action row, and the
COUNT holds still because a popover's height is measured from its rows and a sub-line appearing as
you type would resize the panel under the cursor. `Tail::Recheck` becomes `Tail::Panel(&Add)`,
carrying the field's state, so `ui/onboard.rs`'s `Tail::None` call site — which has no field and
never will — did not have to learn about a state it cannot reach.

The row model, the parse and every read-out are pure and tested that way. `ui/library.rs` is the
wiring; `app.rs` gains a `Route::Library` key guard mirroring the `Route::Search` one already there,
because the television's keyboard has no caret and delegates its delete and Clear-all to the app as
ordinary key syms.

**The seam.** The panel's job ends at a validated `Endpoint`. Dialling it, checking `/identity`,
merging by `machineIdentifier` and registering is worker-thread work with a socket in it and is not
here: the two halves meet at `take_request()` and `report(id, ok)` and nothing else. Nothing takes
the request today, so the field ages out after 20s saying nothing answered — literally true of a
request nobody picked up, and the right read-out once somebody does and the address is wrong.

**A one-source failure now KEEPS the Source chip.** That toolbar row used to empty completely, which
was defensible only while the panel had nothing to offer a user with one server. It was the single
state in the app where somebody whose only server cannot be dialled had nowhere to type one — the
exact dead end this exists to remove. The design's rule is untouched where it argued about a WORKING
library: one source, nothing wrong, still no chip.

Five findings from `/code-review high`, all fixed and each with a test:

- **A panic that killed the app.** `has_prefix_ci` byte-sliced the typed text, and the field
  re-parses on EVERY keystroke to state the port — so a hostname in Cyrillic or Japanese whose 7th
  or 8th byte falls mid-codepoint panicked out of the SDL event loop. `str::get(..n)` now, and the
  simulator survives "привет" with the app still running.
- **The keyboard wedge Search is explicitly defended against.** An app-switch left
  `textinput::STARTED` true and `start()` early-returns on it, so the panel never rose again.
  `app.rs`'s background arm now calls `library::leave_keyboard()` beside `search::leave()` — keeping
  what was typed, because an app switch is the OS moving the screen, not the user abandoning it.
- **The tail vanished on an empty list.** It hung off the last GROUP, so a roster where nothing has
  libraries yet drew neither way out, in precisely the state both rows exist for. It is its own
  headerless section now, with no separator drawn over nothing.
- **The mailboxes had no request identity**, so a late answer for an attempt the user had already
  replaced would land on the new address. They carry a `ReqId` and a mismatched verdict is dropped.
- **`::32400` parsed as a machine NAME** and lit Connect, because the host whitelist allowed `:`
  unconditionally. A multi-colon host is shape-checked as an IPv6 literal instead.

1088 host tests (1075 on the commit before it). Prose corrected where this makes it false:
`ui/consts.rs`'s two "only the Search screen reads these" claims and `docs/distribution.md` §7.
`docs/lg-self-checklist.md` carries the same false sentence and is the integrator's file — the
replacement wording is in the PR body rather than in this diff.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G
@GLinnik21 GLinnik21 changed the title sources: four states, the winning tier, an address to type — and the chip stops calling a signed-in owner signed out sources: render server state and fix the signed-in owner chip Aug 24, 2026
@GLinnik21
GLinnik21 merged commit 36e21df into main Aug 24, 2026
2 checks passed
GLinnik21 added a commit that referenced this pull request Aug 26, 2026
* sources: four states where there were two, and the chip stops calling a signed-in owner signed out

Two things the Sources panel and the shared top bar were saying wrongly. Neither depends on the
other; both are the words a surface uses about a fact it already had.

**The Sources panel renders all four `SourceState` variants, and the winning tier.** It drew a
two-state "Not reachable" off `SrcGroup::reachable()`, which is the only question a `bool` could
answer. The group header's accessory is now `[state] · [tier] · handle`, state FIRST — the accessory
is the last run on that line and elides from the right, so leading with the state means a
34-character plex.tv handle is what gives way rather than the fact that a server is not answering.

`Not authorized` is the point of the change. A 401 is a sharing-grant problem whose remedy is one
row down in the same panel — "Check for new shares" IS the `/api/v2/resources` refetch that reissues
the per-(user, server) token. Calling it "not reachable" sends the user to look at a router for
something no router was ever part of. `NotProbed` says nothing, and that is not an omission: a group
only reaches this list once its libraries have landed, so "nobody has dialled" there is a fact about
our own instrumentation, and stating it would put a warning on a working server.

Relay and Remote are spoken; Local is not. Relay is a ~2 Mbit/s tunnel the server transcodes down to
fit, which reads as a broken server unless something says why; Remote explains a slower first frame
and a transcode on a file that direct-plays at home; Local is what a server is expected to be, and
annotating every group with it is noise. A tier is only spoken for a group that WORKS — "Not
reachable · Relay · friend" reads as three problems where there is one.

The dim is a new question. `SrcGroup::reachable()` answers the old two-state one, in which
`Unauthorized` comes back `true` — not because it is browsable but because a `bool` had no way to
say otherwise. `usable()` is an exhaustive match, so a fifth state has to be given an answer rather
than inheriting one, and it still defers to `reachable()` for the three states that method gets
right. `browse.rs` needed no edit.

**And the profile chip.** It decided signed-in-ness from `current().title.is_empty()`, but an
account without Plex Home never gets a profile written at all — so that title is empty for a
signed-in owner, and the chip offered them "Sign in" while the menu behind it already headed itself
with their name and offered "Sign out". On a fresh single-user test account that is the first thing
a reviewer sees. `ui/account_menu.rs`'s module doc has recorded it since the menu was converted, and
named `ui/widgets.rs` as the fix site.

Fixed by moving the words rather than writing the same match a second time: `chip_label` is the one
resolver, it lives beside the rows it has to agree with, and the chip calls it. The avatar's initial
comes off the same name, so a chip reading "Gleb" can never carry somebody else's letter. `peek`,
not `load` — drawing a chip must never be able to WRITE the session file — and the read is inside
the generation-keyed cache, which is the shape `session::peek`'s own "no per-frame reader" note asks
for.

1075 host tests (1069 on the base). Prose corrected where this makes it false: `plex/session.rs`'s
`Account` doc, and `docs/parity-gaps.md`'s now-closed chip entry.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G

* sources: an address you can type, and a seam for whoever dials it

**This commit contradicts a recorded OWNER RULING and is separated from the one before it for that
reason.** `docs/shared-servers.md` §12, dated 2026-08-21, quotes the owner — *"Servers are
configured on a PC or phone. On the television we only CHOOSE from the available servers"* — and
states the consequence: "There is no add-a-server-by-address on the television, and there will not
be." The ruling is left STANDING and annotated rather than rewritten; an agent may not overturn it.
Dropping this commit leaves the one before it building and green, which is the point of the split.

The case that argued for reopening it is `docs/lg-self-checklist.md` #20/#43/#47: a QA bench not on
the same IPv4 LAN as a plaintext-HTTP PMS dead-ends at "no server found", and the app had no surface
anywhere that could be typed an address. That is a question about a REVIEWER being unable to
evaluate the app at all, which is not the question the ruling answered — it may or may not move it.

**No new `Route` and no screen.** It is two rows in the tail of the popover that already exists,
beside "Check for new shares", which is the other answer to "my server is missing" — putting them
side by side is the point. Closed it is one row; open it is the field plus its action row, and the
COUNT holds still because a popover's height is measured from its rows and a sub-line appearing as
you type would resize the panel under the cursor. `Tail::Recheck` becomes `Tail::Panel(&Add)`,
carrying the field's state, so `ui/onboard.rs`'s `Tail::None` call site — which has no field and
never will — did not have to learn about a state it cannot reach.

The row model, the parse and every read-out are pure and tested that way. `ui/library.rs` is the
wiring; `app.rs` gains a `Route::Library` key guard mirroring the `Route::Search` one already there,
because the television's keyboard has no caret and delegates its delete and Clear-all to the app as
ordinary key syms.

**The seam.** The panel's job ends at a validated `Endpoint`. Dialling it, checking `/identity`,
merging by `machineIdentifier` and registering is worker-thread work with a socket in it and is not
here: the two halves meet at `take_request()` and `report(id, ok)` and nothing else. Nothing takes
the request today, so the field ages out after 20s saying nothing answered — literally true of a
request nobody picked up, and the right read-out once somebody does and the address is wrong.

**A one-source failure now KEEPS the Source chip.** That toolbar row used to empty completely, which
was defensible only while the panel had nothing to offer a user with one server. It was the single
state in the app where somebody whose only server cannot be dialled had nowhere to type one — the
exact dead end this exists to remove. The design's rule is untouched where it argued about a WORKING
library: one source, nothing wrong, still no chip.

Five findings from `/code-review high`, all fixed and each with a test:

- **A panic that killed the app.** `has_prefix_ci` byte-sliced the typed text, and the field
  re-parses on EVERY keystroke to state the port — so a hostname in Cyrillic or Japanese whose 7th
  or 8th byte falls mid-codepoint panicked out of the SDL event loop. `str::get(..n)` now, and the
  simulator survives "привет" with the app still running.
- **The keyboard wedge Search is explicitly defended against.** An app-switch left
  `textinput::STARTED` true and `start()` early-returns on it, so the panel never rose again.
  `app.rs`'s background arm now calls `library::leave_keyboard()` beside `search::leave()` — keeping
  what was typed, because an app switch is the OS moving the screen, not the user abandoning it.
- **The tail vanished on an empty list.** It hung off the last GROUP, so a roster where nothing has
  libraries yet drew neither way out, in precisely the state both rows exist for. It is its own
  headerless section now, with no separator drawn over nothing.
- **The mailboxes had no request identity**, so a late answer for an attempt the user had already
  replaced would land on the new address. They carry a `ReqId` and a mismatched verdict is dropped.
- **`::32400` parsed as a machine NAME** and lit Connect, because the host whitelist allowed `:`
  unconditionally. A multi-colon host is shape-checked as an IPv6 literal instead.

1088 host tests (1075 on the commit before it). Prose corrected where this makes it false:
`ui/consts.rs`'s two "only the Search screen reads these" claims and `docs/distribution.md` §7.
`docs/lg-self-checklist.md` carries the same false sentence and is the integrator's file — the
replacement wording is in the PR body rather than in this diff.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G

* Revert "sources: an address you can type, and a seam for whoever dials it"

This reverts commit b61ce64.

---------

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
GLinnik21 added a commit that referenced this pull request Aug 27, 2026
* sources: four states where there were two, and the chip stops calling a signed-in owner signed out

Two things the Sources panel and the shared top bar were saying wrongly. Neither depends on the
other; both are the words a surface uses about a fact it already had.

**The Sources panel renders all four `SourceState` variants, and the winning tier.** It drew a
two-state "Not reachable" off `SrcGroup::reachable()`, which is the only question a `bool` could
answer. The group header's accessory is now `[state] · [tier] · handle`, state FIRST — the accessory
is the last run on that line and elides from the right, so leading with the state means a
34-character plex.tv handle is what gives way rather than the fact that a server is not answering.

`Not authorized` is the point of the change. A 401 is a sharing-grant problem whose remedy is one
row down in the same panel — "Check for new shares" IS the `/api/v2/resources` refetch that reissues
the per-(user, server) token. Calling it "not reachable" sends the user to look at a router for
something no router was ever part of. `NotProbed` says nothing, and that is not an omission: a group
only reaches this list once its libraries have landed, so "nobody has dialled" there is a fact about
our own instrumentation, and stating it would put a warning on a working server.

Relay and Remote are spoken; Local is not. Relay is a ~2 Mbit/s tunnel the server transcodes down to
fit, which reads as a broken server unless something says why; Remote explains a slower first frame
and a transcode on a file that direct-plays at home; Local is what a server is expected to be, and
annotating every group with it is noise. A tier is only spoken for a group that WORKS — "Not
reachable · Relay · friend" reads as three problems where there is one.

The dim is a new question. `SrcGroup::reachable()` answers the old two-state one, in which
`Unauthorized` comes back `true` — not because it is browsable but because a `bool` had no way to
say otherwise. `usable()` is an exhaustive match, so a fifth state has to be given an answer rather
than inheriting one, and it still defers to `reachable()` for the three states that method gets
right. `browse.rs` needed no edit.

**And the profile chip.** It decided signed-in-ness from `current().title.is_empty()`, but an
account without Plex Home never gets a profile written at all — so that title is empty for a
signed-in owner, and the chip offered them "Sign in" while the menu behind it already headed itself
with their name and offered "Sign out". On a fresh single-user test account that is the first thing
a reviewer sees. `ui/account_menu.rs`'s module doc has recorded it since the menu was converted, and
named `ui/widgets.rs` as the fix site.

Fixed by moving the words rather than writing the same match a second time: `chip_label` is the one
resolver, it lives beside the rows it has to agree with, and the chip calls it. The avatar's initial
comes off the same name, so a chip reading "Gleb" can never carry somebody else's letter. `peek`,
not `load` — drawing a chip must never be able to WRITE the session file — and the read is inside
the generation-keyed cache, which is the shape `session::peek`'s own "no per-frame reader" note asks
for.

1075 host tests (1069 on the base). Prose corrected where this makes it false: `plex/session.rs`'s
`Account` doc, and `docs/parity-gaps.md`'s now-closed chip entry.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G

* sources: an address you can type, and a seam for whoever dials it

**This commit contradicts a recorded OWNER RULING and is separated from the one before it for that
reason.** `docs/shared-servers.md` §12, dated 2026-08-21, quotes the owner — *"Servers are
configured on a PC or phone. On the television we only CHOOSE from the available servers"* — and
states the consequence: "There is no add-a-server-by-address on the television, and there will not
be." The ruling is left STANDING and annotated rather than rewritten; an agent may not overturn it.
Dropping this commit leaves the one before it building and green, which is the point of the split.

The case that argued for reopening it is `docs/lg-self-checklist.md` #20/#43/#47: a QA bench not on
the same IPv4 LAN as a plaintext-HTTP PMS dead-ends at "no server found", and the app had no surface
anywhere that could be typed an address. That is a question about a REVIEWER being unable to
evaluate the app at all, which is not the question the ruling answered — it may or may not move it.

**No new `Route` and no screen.** It is two rows in the tail of the popover that already exists,
beside "Check for new shares", which is the other answer to "my server is missing" — putting them
side by side is the point. Closed it is one row; open it is the field plus its action row, and the
COUNT holds still because a popover's height is measured from its rows and a sub-line appearing as
you type would resize the panel under the cursor. `Tail::Recheck` becomes `Tail::Panel(&Add)`,
carrying the field's state, so `ui/onboard.rs`'s `Tail::None` call site — which has no field and
never will — did not have to learn about a state it cannot reach.

The row model, the parse and every read-out are pure and tested that way. `ui/library.rs` is the
wiring; `app.rs` gains a `Route::Library` key guard mirroring the `Route::Search` one already there,
because the television's keyboard has no caret and delegates its delete and Clear-all to the app as
ordinary key syms.

**The seam.** The panel's job ends at a validated `Endpoint`. Dialling it, checking `/identity`,
merging by `machineIdentifier` and registering is worker-thread work with a socket in it and is not
here: the two halves meet at `take_request()` and `report(id, ok)` and nothing else. Nothing takes
the request today, so the field ages out after 20s saying nothing answered — literally true of a
request nobody picked up, and the right read-out once somebody does and the address is wrong.

**A one-source failure now KEEPS the Source chip.** That toolbar row used to empty completely, which
was defensible only while the panel had nothing to offer a user with one server. It was the single
state in the app where somebody whose only server cannot be dialled had nowhere to type one — the
exact dead end this exists to remove. The design's rule is untouched where it argued about a WORKING
library: one source, nothing wrong, still no chip.

Five findings from `/code-review high`, all fixed and each with a test:

- **A panic that killed the app.** `has_prefix_ci` byte-sliced the typed text, and the field
  re-parses on EVERY keystroke to state the port — so a hostname in Cyrillic or Japanese whose 7th
  or 8th byte falls mid-codepoint panicked out of the SDL event loop. `str::get(..n)` now, and the
  simulator survives "привет" with the app still running.
- **The keyboard wedge Search is explicitly defended against.** An app-switch left
  `textinput::STARTED` true and `start()` early-returns on it, so the panel never rose again.
  `app.rs`'s background arm now calls `library::leave_keyboard()` beside `search::leave()` — keeping
  what was typed, because an app switch is the OS moving the screen, not the user abandoning it.
- **The tail vanished on an empty list.** It hung off the last GROUP, so a roster where nothing has
  libraries yet drew neither way out, in precisely the state both rows exist for. It is its own
  headerless section now, with no separator drawn over nothing.
- **The mailboxes had no request identity**, so a late answer for an attempt the user had already
  replaced would land on the new address. They carry a `ReqId` and a mismatched verdict is dropped.
- **`::32400` parsed as a machine NAME** and lit Connect, because the host whitelist allowed `:`
  unconditionally. A multi-colon host is shape-checked as an IPv6 literal instead.

1088 host tests (1075 on the commit before it). Prose corrected where this makes it false:
`ui/consts.rs`'s two "only the Search screen reads these" claims and `docs/distribution.md` §7.
`docs/lg-self-checklist.md` carries the same false sentence and is the integrator's file — the
replacement wording is in the PR body rather than in this diff.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G

* Revert "sources: an address you can type, and a seam for whoever dials it"

This reverts commit d9513e523518ca362f9b92a797c9b762bebabbcc.

---------

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
GLinnik21 added a commit that referenced this pull request Aug 28, 2026
* sources: four states where there were two, and the chip stops calling a signed-in owner signed out

Two things the Sources panel and the shared top bar were saying wrongly. Neither depends on the
other; both are the words a surface uses about a fact it already had.

**The Sources panel renders all four `SourceState` variants, and the winning tier.** It drew a
two-state "Not reachable" off `SrcGroup::reachable()`, which is the only question a `bool` could
answer. The group header's accessory is now `[state] · [tier] · handle`, state FIRST — the accessory
is the last run on that line and elides from the right, so leading with the state means a
34-character plex.tv handle is what gives way rather than the fact that a server is not answering.

`Not authorized` is the point of the change. A 401 is a sharing-grant problem whose remedy is one
row down in the same panel — "Check for new shares" IS the `/api/v2/resources` refetch that reissues
the per-(user, server) token. Calling it "not reachable" sends the user to look at a router for
something no router was ever part of. `NotProbed` says nothing, and that is not an omission: a group
only reaches this list once its libraries have landed, so "nobody has dialled" there is a fact about
our own instrumentation, and stating it would put a warning on a working server.

Relay and Remote are spoken; Local is not. Relay is a ~2 Mbit/s tunnel the server transcodes down to
fit, which reads as a broken server unless something says why; Remote explains a slower first frame
and a transcode on a file that direct-plays at home; Local is what a server is expected to be, and
annotating every group with it is noise. A tier is only spoken for a group that WORKS — "Not
reachable · Relay · friend" reads as three problems where there is one.

The dim is a new question. `SrcGroup::reachable()` answers the old two-state one, in which
`Unauthorized` comes back `true` — not because it is browsable but because a `bool` had no way to
say otherwise. `usable()` is an exhaustive match, so a fifth state has to be given an answer rather
than inheriting one, and it still defers to `reachable()` for the three states that method gets
right. `browse.rs` needed no edit.

**And the profile chip.** It decided signed-in-ness from `current().title.is_empty()`, but an
account without Plex Home never gets a profile written at all — so that title is empty for a
signed-in owner, and the chip offered them "Sign in" while the menu behind it already headed itself
with their name and offered "Sign out". On a fresh single-user test account that is the first thing
a reviewer sees. `ui/account_menu.rs`'s module doc has recorded it since the menu was converted, and
named `ui/widgets.rs` as the fix site.

Fixed by moving the words rather than writing the same match a second time: `chip_label` is the one
resolver, it lives beside the rows it has to agree with, and the chip calls it. The avatar's initial
comes off the same name, so a chip reading "Gleb" can never carry somebody else's letter. `peek`,
not `load` — drawing a chip must never be able to WRITE the session file — and the read is inside
the generation-keyed cache, which is the shape `session::peek`'s own "no per-frame reader" note asks
for.

1075 host tests (1069 on the base). Prose corrected where this makes it false: `plex/session.rs`'s
`Account` doc, and `docs/parity-gaps.md`'s now-closed chip entry.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G

* sources: an address you can type, and a seam for whoever dials it

**This commit contradicts a recorded OWNER RULING and is separated from the one before it for that
reason.** `docs/shared-servers.md` §12, dated 2026-08-21, quotes the owner — *"Servers are
configured on a PC or phone. On the television we only CHOOSE from the available servers"* — and
states the consequence: "There is no add-a-server-by-address on the television, and there will not
be." The ruling is left STANDING and annotated rather than rewritten; an agent may not overturn it.
Dropping this commit leaves the one before it building and green, which is the point of the split.

The case that argued for reopening it is `docs/lg-self-checklist.md` #20/#43/#47: a QA bench not on
the same IPv4 LAN as a plaintext-HTTP PMS dead-ends at "no server found", and the app had no surface
anywhere that could be typed an address. That is a question about a REVIEWER being unable to
evaluate the app at all, which is not the question the ruling answered — it may or may not move it.

**No new `Route` and no screen.** It is two rows in the tail of the popover that already exists,
beside "Check for new shares", which is the other answer to "my server is missing" — putting them
side by side is the point. Closed it is one row; open it is the field plus its action row, and the
COUNT holds still because a popover's height is measured from its rows and a sub-line appearing as
you type would resize the panel under the cursor. `Tail::Recheck` becomes `Tail::Panel(&Add)`,
carrying the field's state, so `ui/onboard.rs`'s `Tail::None` call site — which has no field and
never will — did not have to learn about a state it cannot reach.

The row model, the parse and every read-out are pure and tested that way. `ui/library.rs` is the
wiring; `app.rs` gains a `Route::Library` key guard mirroring the `Route::Search` one already there,
because the television's keyboard has no caret and delegates its delete and Clear-all to the app as
ordinary key syms.

**The seam.** The panel's job ends at a validated `Endpoint`. Dialling it, checking `/identity`,
merging by `machineIdentifier` and registering is worker-thread work with a socket in it and is not
here: the two halves meet at `take_request()` and `report(id, ok)` and nothing else. Nothing takes
the request today, so the field ages out after 20s saying nothing answered — literally true of a
request nobody picked up, and the right read-out once somebody does and the address is wrong.

**A one-source failure now KEEPS the Source chip.** That toolbar row used to empty completely, which
was defensible only while the panel had nothing to offer a user with one server. It was the single
state in the app where somebody whose only server cannot be dialled had nowhere to type one — the
exact dead end this exists to remove. The design's rule is untouched where it argued about a WORKING
library: one source, nothing wrong, still no chip.

Five findings from `/code-review high`, all fixed and each with a test:

- **A panic that killed the app.** `has_prefix_ci` byte-sliced the typed text, and the field
  re-parses on EVERY keystroke to state the port — so a hostname in Cyrillic or Japanese whose 7th
  or 8th byte falls mid-codepoint panicked out of the SDL event loop. `str::get(..n)` now, and the
  simulator survives "привет" with the app still running.
- **The keyboard wedge Search is explicitly defended against.** An app-switch left
  `textinput::STARTED` true and `start()` early-returns on it, so the panel never rose again.
  `app.rs`'s background arm now calls `library::leave_keyboard()` beside `search::leave()` — keeping
  what was typed, because an app switch is the OS moving the screen, not the user abandoning it.
- **The tail vanished on an empty list.** It hung off the last GROUP, so a roster where nothing has
  libraries yet drew neither way out, in precisely the state both rows exist for. It is its own
  headerless section now, with no separator drawn over nothing.
- **The mailboxes had no request identity**, so a late answer for an attempt the user had already
  replaced would land on the new address. They carry a `ReqId` and a mismatched verdict is dropped.
- **`::32400` parsed as a machine NAME** and lit Connect, because the host whitelist allowed `:`
  unconditionally. A multi-colon host is shape-checked as an IPv6 literal instead.

1088 host tests (1075 on the commit before it). Prose corrected where this makes it false:
`ui/consts.rs`'s two "only the Search screen reads these" claims and `docs/distribution.md` §7.
`docs/lg-self-checklist.md` carries the same false sentence and is the integrator's file — the
replacement wording is in the PR body rather than in this diff.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G

* Revert "sources: an address you can type, and a seam for whoever dials it"

This reverts commit d9513e523518ca362f9b92a797c9b762bebabbcc.

---------

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
@GLinnik21
GLinnik21 deleted the b3-sources-ui branch September 3, 2026 18:09
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