fix(web): render and filter usage as environments respond #9860
Mergedjuliusmarmingemerged 3 commits into
main fromrefs/pull/9860/headmerged by juliusmarminge View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:L
juliusmarminge changed the title
- @@ -426,7 +426,15 @@426426 * Countdowns anchor to render time rather than ticking: a live clock would427427 * repaint the page every minute for no decision-changing gain.428428 */429-export function UsageLimitsSection() {429+export function UsageLimitsSection({430+ selectedEnvironmentIds,431+}: {432+ readonly selectedEnvironmentIds: ReadonlySet<EnvironmentId> | null;433+}) {430434 const presentations = useAtomValue(environmentPresentations.presentationsAtom);431- const groups = collectLimitsGroups(presentations);432- const sources = collectLimitSources(presentations);435+ const selected =436+ selectedEnvironmentIds === null437+ ? presentations438+ : new Map([...presentations].filter(([id]) => selectedEnvironmentIds.has(id)));439+ const groups = collectLimitsGroups(selected);440+ const sources = collectLimitSources(selected);
- @@ -646,2 +665,19 @@646- </span>647- </div>665+ </MenuTrigger>666+ <MenuPopup align="start" className="w-80 max-w-[calc(100vw-2rem)]">667+ <MenuCheckboxItem668+ checked={allSelected}669+ closeOnClick={false}670+ onCheckedChange={(checked) => onSelectionChange(checked ? null : new Set())}671+ >672+ All environments673+ </MenuCheckboxItem>674+ <MenuSeparator />675+ {environments.map((environment) => {676+ const checked =677+ selectedEnvironmentIds === null ||678+ selectedEnvironmentIds.has(environment.environmentId);679+ const status =680+ environment.error !== null681+ ? "Unavailable"682+ : staleEnvironments.includes(environment.environmentId)683+ ? "Update required"
juliusmarminge merged this7ee52b0
juliusmarminge closed this
Sign in to join this conversation.




cursor[bot](GitHub profile, opens in a new tab) reviewed
Stale Bugbot comment from a previous run.