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

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.
@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 because the auth redirect code that drops the query string is unchanged in this PR.

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 sign-in redirect still hardcodes callbackPath=/usage, so a shared /usage?groupBy=model link falls back to the default day view after authentication.
src/lib/user.server.ts 759 appendCallbackPath() only preserves x-pathname, so organization usage links with ?groupBy=model also lose the new URL-backed state during auth redirects.
Files Reviewed (2 files)
  • src/app/(app)/usage/page.tsx
  • src/components/organizations/usage-details/OrganizationUsageDetails.tsx

Reviewed by gpt-5.4-20260305 · 403,046 tokens

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