The native right sidebar keeps at most ONE page tab per kind, so a side chat
tab is never a copy: every open re-delivers the same tab with fresh navigation
params and an incremented `navigation.revision` (verified in the pinned host's
client bundle: `TabDomain.navigate` replaces the whole target and bumps the
revision, and `openContent` settles an already-held page tab through it). Two
opposite mistakes followed from that: `records.ensure` only read the seed
`meta` when it MINTED a record (so the header thread menu closed and nothing
changed — #762), while adopting it on every pass would clobber the thread id
the view writes back through `updateTab` (the orphan `Side: New thread` half of
#684).
Adopt a navigation's `params.meta` exactly once per revision, and reattach an
unbound auto-creating tab to the thread its session was last in instead of
minting another empty one.
Rewritten against the current dev tree rather than merged from the PR:
- #776 (7cf9626) made a record key `(seat session, native tab id)`; the
revision ledger is keyed the same way and is dropped together with the
record — in `drop` AND in `retain(sessions)`, which also forgets records.
- dev's existing branch never wrote `meta` and folds a url seed into
`nextPath`, so the PR's url/meta merge has no counterpart here and is
deliberately not ported: "revision unchanged" simply leaves `meta` alone,
which is what keeps #684's other half fixed.
- `updateTab` takes the seat session as its third argument (same commit), so
the reattach names it like the rest of the view does.
- The "newest real thread, placeholders last" heuristic already exists on dev
(477f627, the archive fallback); it is extracted into `newestThreadId` and
reused instead of being copied a second time.
- The remembered thread uses the client store's key space
(`dsh-sidebar:v1:sidechat-thread`), not the PR's `dsh-better-sidebar:*`.
- `openNewThread` starts the thread first and parks it for `createTab`, and an
auto-creating tab no longer offers a manual create button while it binds.
Tests (the PR reported none): the revision gate, its no-revision guard (both
fail on the unported adapter), the call-site wiring through `NativeTabBody`,
plus the two dev-side records cases around them.
Refs #839
Co-authored-by: waser0434 <178004182+Waser750@users.noreply.github.com>