TJHHHH: after a jump to Codex's requests on the Usage page, every later
visit listed only Codex's. The Requests' filters are module state in
plugins/usage/page.js and nothing ever reset them, so a click on Codex in
the ranking split by agent stuck for the app's lifetime.
Now a filter a click lent the Requests (a ranking click on an agent,
provider, model or gateway key, a chart day, the address's ?agent= and
the like, a route from Routing) is remembered in ledLent and given back
by ledLeave when the reader leaves the Requests: for another Usage tab
(renderUsageTab), or another page through a new page hook, `leave`, that
show() calls on the page it leaves. A filter picked in its own menu or
typed in the search stays, as a menu choice does in a Mac app. A route's
saved filters keep their lent marks, and leaving with a route on gives
back the route too. Docs: plugin-runtime.md's Usage hooks.
Siblings judged and left: the tray panel's Usage tab ranking (its own
view, not the page's Requests), the Sessions reveal (per agent, no "all"), the KPI
failed/retried jumps (shown in the status segment, read as own picks).
Test: tests/usage-ledger-leave.test.cjs, chromium and webkit, en zh
zh-TW ja de: ranking click leaves for a page and for a tab, menu pick
stays, ?agent= goes, a route goes. On the old app.js/page.js/client.js
it is red, 20 of 25 in chromium ("back from another page: last asked
period=today&agent=codex"); only the menu-pick case passes there.
Green with the fix, in both engines.
Run at 5b267fbd8 (load 200-400):
- gofmt -l clean; go vet darwin, GOOS=linux -tags nogui, GOOS=windows ok.
- go test -timeout 45m ./...: 60 ok; internal/agent, gateway, library
past 45m (#2544, #2870, #2853), internal/gui
TestSetAnswersWhileDevinAndProvidersHang 13s (#1375). All filed, none
touch these files.
- Whole GUI suite (node --test --test-concurrency=4, both engines):
i18n-keys was red on my comment saying "View usage" (routing's word);
reworded, i18n-keys green. codex-auto-reset, codex-auto-reset-settings
and codex-predictions red in the full run; rerun alone: codex-auto-reset 20/20 and codex-auto-reset-settings 22/22
green (load); codex-predictions 7 of 20 red at 420px, the same as
#2624 on main. usage-ledger-leave 52/52 alone. The whole suite was
still running at commit time (load ~400); its reds so far are these.