Repository navigation
Commit 8668dbd
fix(navigation): keep a shown page when a background reopen times out (#2270)
## Summary
- A channel that had already loaded could be replaced, with no click, by
the full-page "This page isn’t available — It didn’t load this time"
card.
- The cause: when something re-opens the page that is already on screen
(a retry, an open of the same channel, a reopen after the organization
sign-in refreshes), Buzz waits up to 15 seconds for that page to say
"loaded" again. If the answer did not come in time, the card replaced a
page that was working.
- Now a page or Settings section that is already on screen stays on
screen when such a repeat open times out. If the page answers late, it
is back to normal. The card still appears when the page itself reports a
problem (for example, the channel was deleted or you lost access), for a
page that never loaded, and for a failed incoming link.
## Details
- The rule lives in the navigation controller
(`src/features/navigation/controller.ts`), which already owns each open
and its 15 s deadline. It remembers the visit whose page is on screen. A
timeout on a later open of that same visit is recorded as "presented in
place", so the host keeps the page mounted and its request live.
- Only the controller's own deadline is treated this way: `finish` is
told whether its deadline fired, so the reason string alone does not
decide. Failures a page reports itself (`unavailable`, `denied`,
`not-found`, and `timeout` too) still draw the host card and its Retry,
because the page has nothing useful to show.
- A kept open stays answerable: it can still update its address
(`resolve`) and answer late. A late `opened` returns the visit to
normal, and a late failure is handled exactly like an on-time one (the
card replaces the page). The original caller's promise is settled once,
at the deadline.
- Once the host card covers a page, that visit no longer counts as on
screen, so a later timeout cannot reveal a page that never answered.
- The exact background trigger in the original report was not
identified: the dev build kept no webview log. This change does not
depend on which trigger fired.
- Settings used the same card for any failed open. `src/app/App.tsx`
(FOUNDATION; the owner approved this edit) now applies the same rule as
pages, so a kept timeout leaves the Settings section on screen.
- A kept timeout keeps only content that is drawn. This is decided once,
when the deadline passes. If the host was drawing its loading state in
place of the page or Settings editor then (for example, a Settings
section whose authorization is reloading), the host reports the timeout
as its own failure: the card and Try again show and stay, as on `main`.
If loading starts later, over a kept page, the host shows its loading
state, never the card, and the page's late answer reopens the visit.
## Not covered
- A page whose plugin registration disappears still gets the "may have
been removed" card. That page can no longer render, so the card stays.
## Tests
- `controller.test.ts`: a timed-out repeat open keeps the page; a late
`opened` recovers it; a kept page can update its address and then
answer; the host can turn a kept timeout into its own failure; a late or
early `unavailable` / `denied`, or a `timeout` the page reports itself,
still shows the card; a card covering the page clears the kept state;
another visit, Back to an older visit, and a failed incoming link still
show their cards.
- `src/app/retained-page.test.tsx` (new, real `App`; it passes the
controller's own 15 s timer, with only timeouts faked): a background
reopen that times out keeps the page content with no card; a page that
reports `unavailable`, on time or after the deadline (through its own
request), or reports a `timeout` itself, gets the card; another page's
open rejects the kept page's late answers; a Settings section kept
through a timeout never draws the card in any rendered frame; a timeout
while the host shows its loading state draws the card, which stays until
Try again; loading that starts after a kept timeout (a background plugin
restart) never draws the card, and the page's late answer reopens it.
- The "keeps the page", Settings, address-update and loading-state tests
fail without their changes and pass here. Browser cases: 0 added, 0
removed.
- Not yet exercised in the running desktop app.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Signed-off-by: Logan Johnson <[email protected]>
Co-authored-by: Larry <627498bd4bd1f281a16431e3c6cce3b5c25b6692798c78672298aefbf2f8f8b5@buzz.block.builderlab.xyz>
Co-authored-by: Claude Opus 5.5 <[email protected]>1 parent cbc71c8 commit 8668dbd
5 files changed
Lines changed: 678 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
13 | 21 | | |
14 | 22 | | |
15 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
301 | 301 | | |
302 | 302 | | |
303 | 303 | | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
304 | 327 | | |
305 | 328 | | |
306 | 329 | | |
| |||
367 | 390 | | |
368 | 391 | | |
369 | 392 | | |
| 393 | + | |
370 | 394 | | |
371 | | - | |
372 | | - | |
| 395 | + | |
373 | 396 | | |
374 | 397 | | |
375 | 398 | | |
| |||
0 commit comments