Skip to content

fix(ui): persist selected usage view across refreshes#1057

Open
shssoichiro wants to merge 1 commit intoKilo-Org:mainfrom
shssoichiro:usage-persist-view
Open

fix(ui): persist selected usage view across refreshes#1057
shssoichiro wants to merge 1 commit intoKilo-Org:mainfrom
shssoichiro:usage-persist-view

Conversation

@shssoichiro
Copy link

Summary

Currently the Usage page will always reset to the "By Day" view when a user refreshes the page. This change persists the user's selected view by using a query parameter, so that "By Model & Day" can have a permanent URL.

Verification

  • Login and go to the Usage page
  • Select "By Day & Model"
  • Refresh the page
  • Ensure that "By Day & Model" is still the active view after refresh

Note that I was not able to manually e2e verify the changes myself, even following the instructions in DEVELOPMENT.md. I suspect it is because I don't have vercel access.

Visual Changes

N/A

@kilo-code-bot
Copy link
Contributor

kilo-code-bot bot commented Mar 12, 2026

Code Review Summary

Status: 2 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 2
SUGGESTION 0

Fix these issues in Kilo Cloud

Issue Details (click to expand)

No new issues are inline-commentable; the remaining regressions are in unchanged auth redirect code that this PR now depends on.

Other Observations (not in diff)

Issues found in unchanged code that cannot receive inline comments:

File Line Issue
src/app/(app)/usage/page.tsx 178 The new URL-backed groupBy state is still dropped on auth failures because the redirect hardcodes callbackPath=/usage, so a shared /usage?groupBy=model link returns on the default day view after sign-in.
src/lib/user.server.ts 759 appendCallbackPath() still serializes only x-pathname, so organization usage links like /organizations/:id/usage?groupBy=model lose the query string during the server-side auth redirect and return on the default day view.
Files Reviewed (2 files)
  • src/app/(app)/usage/page.tsx - 1 issue
  • src/components/organizations/usage-details/OrganizationUsageDetails.tsx - 0 issues

Reviewed by gpt-5.4-20260305 · 424,007 tokens

Currently the Usage page will always reset to the "By Day" view when a
user refreshes the page. This change persists the user's selected view
by using a query parameter, so that "By Model & Day" can have a
permanent URL.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant