You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Remember the Usage page's environment selection
#31291
The environment menu at the top of the Usage page resets to "All environments" every time the page opens. With more than one environment connected, like a desktop and a laptop or a remote server, I have to pick the same environment again on every visit to see its Limits, Cost, or Tokens.
The page already remembers the metric, the time window, and hidden providers between visits (usagePagePreferences.ts), so the environment choice is the only filter that resets. Limits is a page I check often, for example before starting a long task, so re-picking the environment each time adds up.
Proposal
Save the selected environments with the other Usage page preferences, in the same local storage entry and per device like the rest:
When the page opens, use the saved environments that still exist.
If none of them exist anymore, show All environments, as today.
Choosing "All environments" clears the saved choice.
Edge cases
A saved environment is removed: it's dropped from the selection.
A new environment is connected later: it isn't added to a saved selection, since the user picked a subset. "All environments" still includes it.
A saved environment is offline: it stays selected and shows "Connecting…" in the menu, as it does now.
Where it would go
UsagePage.tsx keeps selectedEnvironmentIds in component state that starts as null (all environments). usagePagePreferences.ts already validates and saves metric, windowDays, and hiddenProviders, so an optional list of environment IDs would fit there. No server or contract change is needed.
Related: "Web: break Usage down by project, thread, account and environment" asks for a per-environment breakdown. This one only keeps the existing filter between visits.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Problem
The environment menu at the top of the Usage page resets to "All environments" every time the page opens. With more than one environment connected, like a desktop and a laptop or a remote server, I have to pick the same environment again on every visit to see its Limits, Cost, or Tokens.
The page already remembers the metric, the time window, and hidden providers between visits (
usagePagePreferences.ts), so the environment choice is the only filter that resets. Limits is a page I check often, for example before starting a long task, so re-picking the environment each time adds up.Proposal
Save the selected environments with the other Usage page preferences, in the same local storage entry and per device like the rest:
Edge cases
Where it would go
UsagePage.tsxkeepsselectedEnvironmentIdsin component state that starts asnull(all environments).usagePagePreferences.tsalready validates and savesmetric,windowDays, andhiddenProviders, so an optional list of environment IDs would fit there. No server or contract change is needed.Related: "Web: break Usage down by project, thread, account and environment" asks for a per-environment breakdown. This one only keeps the existing filter between visits.
All reactions