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(app): keep an open session's side tabs when old sessions are forgotten by Hona · Pull Request #65328 · anomalyco/opencode Conversation
|
| Before | After |
|---|---|
![]() |
![]() |
The app's e2e build, with 52 stored side strips: 51 closed sessions and one session open in a background shell tab. The pictures show that session's side panel after the person switches to it.
layout.tsx:383, prune at :428). pruneSessionKeys (helpers.ts:21) ranked them only by used (layout.tsx:386), the time each was last on screen in this run. Once 50 others were used, a session still open in a shell tab went.used starts empty, so every session not used yet ranks equal, and .slice(input.max) (helpers.ts:42) dropped the keys stored last: the newest sessions, open or not.TabsProvider in app.tsx, LayoutProvider in routes.tsx). AppLayout, which has both, hands the layout the fact, so the layout does not import the tabs:const open = () => (tabs.restoreReady() ? (key: string) => sessionKeyOpen(key, tabs.store, servers.scope) : undefined) <LayoutProvider open={open}>
open is undefined until the saved shell tabs have loaded. The first prune waits for it, and a later one returns at once without it.For a session that is not open in a shell tab and falls outside the 50, the layout still forgets (dropSessionState, layout.tsx:407, and prune):
Not changed here.
All fail on dev.
e2e/regression/side-panels.spec.ts: the real app with 52 stored strips. At startup the two oldest closed sessions go and the open one, stored last, stays. A file scrolled in the session on screen prunes again and drops the next oldest. The background session then shows its file tab. On dev the startup prune drops the open session.layout.test.ts: pruneSessionKeys keeps open sessions, also when they outnumber the cap, and drops the keys stored first in a new run; sessionKeyOpen matches a tab's shown or routed session on the same server.used is still not stored.createSessionKeyReader changes one line (typeof to Predicate.isString): lint:changed fails on anti-slop/no-runtime-typeof there once the file is touched.No feature flag: a fix.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
… prove it end to end
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
No blocking problems. On pr/base, the new e2e test fails at the startup prune: the oldest closed sessions are kept and the session open in a background shell tab (ses_background) is dropped. With this PR, all of e2e/regression/side-panels.spec.ts (10 tests) and layout.test.ts (12 tests) pass, and tsc -b in packages/app is clean.
Re-dispatching hydrated when the shell tabs change is a no-op in the scoped machine, so making the first prune wait on open() is safe.
Public API: unchanged. LayoutProvider now requires an open prop, but it is internal to the app.
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.