Skip to content

Conversation

@lionellc
Copy link
Contributor

@lionellc lionellc commented Feb 1, 2026

Motivation

  • Provide richer usage visibility directly from Home, enabling longer-range insights.
  • Keep the Home experience consistent with detailed usage exploration.

Description

  • Added a Usage details modal with date-range picker, quick presets, and chart rendering, and wired it into app-level modal management.
  • Added a “More” entry point on the Home usage card and threaded the open handler through layout/App props.
  • Extended local usage snapshot range to 90 days, fixed last-30-days totals to use only the latest 30 days, and added coverage tests.
  • Added tests for the Usage details modal and the Home “More” interaction, including empty state and Escape-close behavior.

Extensibility note

  • The modal uses a Settings-style sidebar + tabs structure. It currently has a single Usage tab, but the layout is designed to add new tabs (e.g., Models, Costs, Runs) without restructuring the modal.

@lionellc lionellc force-pushed the feat/usage-detail-modal branch from 3e43002 to 5d11529 Compare February 1, 2026 08:46
@Dimillian
Copy link
Owner

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5d11529a03

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

requestIdRef.current = requestId;
setState((prev) => ({ ...prev, isLoading: true, error: null }));
return localUsageSnapshot(30, workspaceRef.current ?? undefined)
return localUsageSnapshot(SNAPSHOT_DAYS, workspaceRef.current ?? undefined)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Fix last-30-day agent time after 90-day fetch

Because useLocalUsage now requests a 90‑day snapshot, Home.tsx computes last30AgentMs by reducing all usageDays (lines ~141–143 in src/features/home/components/Home.tsx), so the “Last 30 days” agent‑time card is inflated once there are >30 days of data. The regression only appears after this change because usageDays used to be capped at 30; now it spans 90. Consider slicing usageDays.slice(-30) for last30AgentMs (or adding an explicit 30‑day time total from the backend) so the time metric matches the 30‑day label.

Useful? React with 👍 / 👎.

@Dimillian
Copy link
Owner

way too bugy, don't like scrollable thing. Also wtf??
Screenshot 2026-02-01 at 11 54 44 AM

@Dimillian Dimillian closed this Feb 1, 2026
@lionellc
Copy link
Contributor Author

lionellc commented Feb 1, 2026

way too bugy, don't like scrollable thing. Also wtf?? Screenshot 2026-02-01 at 11 54 44 AM

Got it — I understand and accept your style preference. I can’t reproduce the ui issue on my side; it might be a local style conflict. Since the PR is already closed, I won’t dig further. Thanks for the feedback.

@lionellc lionellc deleted the feat/usage-detail-modal branch February 1, 2026 11:39
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.

2 participants