GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — fix(browser): show saved tabs at once when the app reopens, and hold them while they load by Hona · Pull Request #65067 · anomalyco/opencode Conversation
|
| Phase | Main sends for the tab | dev |
808a2c4 |
Now |
|---|---|---|---|---|
| 1. Reopened, not attached | nothing | not drawn | Preview, saved icon, 87.03 px |
Preview, saved icon, 87.03 px |
| 2. First inventory, page not loaded | title: "" |
the address, globe | Preview, 87.03 px |
Preview, 87.03 px |
| 3. Page committed, still loading | before: title: "localhost:4173", no icon. Now: title: "", no icon |
localhost:4173, globe |
localhost:4173, globe, 126.52 px; the next tab moves 39.48 px |
Preview, saved icon, 87.03 px |
| 3b. Committed where the address redirected | title: "", the new address |
the new address | the new address, 192.23 px | Preview, saved icon, 87.03 px |
| 4. Title parsed, icon loaded, stopped | title: "Preview", the icon |
Preview, icon |
Preview, icon, 87.03 px |
Preview, icon, 87.03 px |
| A tab never selected (its page never loads) | title: "" for good |
its address | Docs, 69.59 px |
Docs, saved icon, 69.59 px |
| The server has no browser | closes the binding, unsupported |
not listed | a loader with no end | same box; "The browser couldn't open", Try again |
Red lines mark each tab's left and right edge, with its measured x and width.
808a2c4 |
Now | |
|---|---|---|
| 1. Reopened | ![]() |
![]() |
| 2. Attached | ![]() |
![]() |
| 3. Loading | ![]() |
![]() |
| 4. Loaded | ![]() |
![]() |
The whole restore, now:
On dev, reopened and then attached:

Layout.stored), but a stored tab stayed hidden until the model's chunk had loaded and main's inventory named it (renderer.tsx:522 and model-machine.ts:84 on dev), and its title came only from that inventory. Main saves { id, url } (restore.ts:11) and restores with title: "" (pane-machine.ts:488).page-machine.ts:251, fed by contents.getTitle() at chromium.ts:782). In real Electron that is 127.0.0.1:52433/saved until the <title> parses. The label drew any non-empty title, in a content-sized max-w-40 truncate span.sessionTabs returned [] outside sessionPending (machine.ts:397-400): in backoff, or while the server had no browser yet.Main: a restored document keeps the title it was restored with through its first commit, as a navigation on the same site already does, until it names itself or stops loading.
// page-machine.ts, committed() title: same || state.status === "restoring" ? state.title : event.title,
Saved tabs: a window store tabs (Store.global, loaded before setup) keeps each session's { id, url, title?, icon? } from every inventory and page icon (saved-tabs.ts; icons bounded as in the history).
Label: the page's own title, else the saved one at the same address or while the tab loads. The page's own icon, else the saved one on the same site. An empty title or a missing icon never replaces a saved one.
Strip: a saved tab is not hidden, and Panel.list keeps the stored ids until an inventory names the desktop's tabs, so the same tab objects stay and no trigger remounts.
Content, every wait ends: a Loader only while an inventory is on its way (registering, the Ipc starting, the first 4 retries). After that, or when the server has no browser, the existing "The browser couldn't open" view with Try again (session.retry); the retries go on behind it. A paused pane says so. The tabs keep their box in each state.
Before the attach: the attachment machine remembers a saved tab the person closed or picked (strip.dismissed, strip.selected) and sends tabs.close or tabs.focus with the first inventory that has it.
On 808a2c4 |
Covers | |
|---|---|---|
browser-pane-restore.spec.ts "holds every restored tab's box, label and icon…" |
fails: Preview becomes the redirected address, 87.03 → 192.23 px |
Ipc pending, inventory with the titles main sends, loading, commit at a redirected address without title or icon, title, icon, loaded, and a tab never selected. At every step: x, width, label and icon of all three tabs equal the first frame, and the tab elements are the same nodes |
| same file, "a restored tab on a server without a browser…" | fails: loader with no end | the view, Try again, the boxes |
electron-restore.test.ts (real Electron, a page whose title arrives late) |
fails: publishes 127.0.0.1:…/saved |
a restored page publishes Saved title, or none, then Real title |
page-machine.test.ts, machine.test.ts, saved-tabs.test.ts |
fail | the commit rule; listing, pending, unavailable and retry in every binding state; close and pick before the first inventory; titles, icons, pruning, a stored record without title or icon |
dev, each drawn by its address; a tab changes once, to its title, when its page has loaded.No feature flag: a fix.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I couldn't verify this end to end. The change only shows in the desktop side panel, and the Playwright component spec couldn't start Chromium in this environment. The browser machine, saved-tabs and model-machine unit tests pass (96/96), and tsc -b for packages/gui-plugins is clean. I read the diff: the saved-tabs store, keeping the stored ids listed, and replaying an early close or pick with the first inventory all look sound.
Public API: unchanged. The new tabs store is internal to the built-in browser plugin, and the SDK, server API, config and Ipc are untouched.
One concern is worth fixing: when a server has no browser (blocked/unsupported), its saved tabs now show a loader that never ends (see the inline comment). Before this change those tabs were not listed at all.
I couldn't produce screenshots here; the before/after images and video in the description cover the visible change.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| phase.status === "registering" || | ||
| phase.status === "ready" || | ||
| phase.status === "backoff" || | ||
| (phase.status === "blocked" && phase.reason === "unsupported") || |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Counting blocked/unsupported as pending also changes what the strip shows when a server has no browser. Before this change, sessionTabs returned [], so the server's stored tabs were not listed. Now its saved tabs are drawn, and each one's content is the Waiting loader until the server's plugins change. That may never happen, and nothing tells the person why. The description lists this under Limits, but packages/gui-plugins/AGENTS.md says an action must always answer: "Never a silent return or an endless spinner." Could unsupported keep its saved tabs listed but not pending, so the pane says the browser is unavailable (or keep the old empty strip)? Backoff is fine as pending, since a retry is already scheduled.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
A server without a browser no longer counts as pending: its saved tabs stay listed in the same box, and the pane shows the existing "The browser couldn't open" view with Try again instead of the loader. Backoff stays pending only for the first 4 failures in a row, then shows the same view while the retries go on.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I checked this against the current head, 5c449eaa3, and it works the way you describe. This resolves my concern.
sessionPending (machine.ts:407-420) no longer counts blocked/unsupported. sessionTabs (:456) still lists the saved tabs. sessionUnavailable (:428-438) returns true, so the pane's Switch (renderer.tsx:625-631) shows Failed with Try again instead of Waiting.registering/backoff count as pending while attempts <= PENDING_RETRIES (4), and as unavailable above that. The retry timer keeps running. attempts resets to 0 only in wake, and backoff() adds to the count it carries over (:1236-1244).session.retry (:731-742) sets attempts back to 0 if a registration is already running. From backoff or unsupported, it stops the timer, marks the session idle and registers again at once. If the server still has no browser, main closes the binding, the phase becomes unsupported again, and the pane returns to Failed after a short loader. So it always ends in a state, never an endless spinner.bun test src/browser/machine.test.ts gives 90 pass, 0 fail. That includes the test that steps through PENDING_RETRIES + 1 failures and the retry cases at :599-635.I didn't run the app or the component fixture, so I haven't seen the Failed view render in the restored tab's box.
Workspace: the shared repo/ checkout is still at your older head, 808a2c4, and has a bun.lock change I didn't make. I left both alone. I read and tested pr/head in a temporary worktree, which I've removed, and I made no edits.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
The only new change is the tabs store in the hand-built context of browser-pane-model.test.ts. That test file now passes. No runtime code changed, so the earlier review still applies: the loader that never ends for a server without a browser is not addressed yet. Public API: unchanged.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
808a2c4 to
5c449ea
Compare
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
The earlier point is fixed: a server with no browser, or one past PENDING_RETRIES failed registrations, now shows "The browser couldn't open" with Try again (session.retry) instead of a loader with no end. I read the new browser hunks: the title kept on a restored page's first commit, saved icons with a size limit, and sessionTabs listing nothing for an unattached session that isn't about to attach. They look sound. The browser machine, page machine and saved-tabs unit tests pass (124/124) and tsc -b is clean. The new real-Electron test couldn't start here because a system library is missing, and the desktop side panel can't be run in this environment. Public API: unchanged.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.