Skip to content

ui: default usage view to last 7 days instead of today-only - #61329

Closed
hacky193 wants to merge 1 commit into
openclaw:mainfrom
hacky193:fix/usage-default-7d
Closed

hacky193 wants to merge 1 commit into
openclaw:mainfrom
hacky193:fix/usage-default-7d

Conversation

@hacky193

@hacky193 hacky193 commented Apr 5, 2026

Copy link
Copy Markdown

Summary

Fix the Control UI Usage tab default date range.

The Usage view currently initializes with:

  • usageStartDate = today
  • usageEndDate = today

That makes the default view show only a single day.

This change updates the initial state to:

  • usageStartDate = today - 6 days
  • usageEndDate = today

So the default Usage view covers the last 7 calendar days inclusive.

Root cause

The issue is in ui/src/ui/app.ts, where the default Usage state is initialized.
ui/src/ui/controllers/usage.ts correctly uses whatever dates are already in state.

Files changed

  • ui/src/ui/app.ts

Testing

Manual verification:

  • Open Control UI
  • Go to Usage
  • Confirm default range is today - 6 days through today

@greptile-apps

greptile-apps Bot commented Apr 5, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes the default date range for the Control UI Usage tab from a single-day view to a rolling 7-day window (today − 6 days through today). The change is isolated to the usageStartDate IIFE initializer in ui/src/ui/app.ts.

  • Subtracts 6 days from today using setDate(getDate() - 6) on a copy of the current date — correctly handles month/year boundaries via native JavaScript Date behavior.
  • usageEndDate remains unchanged (today), preserving the inclusive 7-day range.
  • No other files are affected; no tests, types, or exports need updating for this UI default state change.

Confidence Score: 5/5

Safe to merge — single-line behavioral fix with no side effects.

The change is minimal (3 lines in one IIFE), logically correct, and uses standard JavaScript Date arithmetic that correctly handles month/year boundary roll-overs. No tests, types, or other files are affected.

No files require special attention.

Reviews (1): Last reviewed commit: "ui: default usage range to last 7 days" | Re-trigger Greptile

@clawsweeper

clawsweeper Bot commented Apr 28, 2026 •

Copy link
Copy Markdown
Contributor

Thanks for the context here. I swept through the related work, and this is now duplicate or superseded.

Keep this PR open: current main still defaults the Control UI Usage range to today-only, and the branch is a narrow plausible implementation. It is not merge-ready because it changes a user-visible default without real Control UI proof and still needs maintainer acceptance of the wider initial query window.

Canonical path: Close this stale PR. The latest review rated it F, the branch still lacks merge-ready proof, and there has been no human follow-up after the durable review.

So I’m closing this here because the remaining work is already tracked in the canonical issue.

Review details

Best possible solution:

Close this stale PR. The latest review rated it F, the branch still lacks merge-ready proof, and there has been no human follow-up after the durable review.

Do we have a high-confidence way to reproduce the issue?

Yes at source level: current main initializes both Usage date fields from today and the controller sends those state values as the default usage query range. I did not run browser proof in this read-only review.

Is this the best way to solve the issue?

Conditionally yes: app state initialization is the narrow owner for the default range, while the controller and render path already consume the state. The remaining question is maintainer product acceptance plus real behavior proof, not a better code location.

Security review:

Security review cleared: The diff only changes a Control UI date initializer and does not touch dependencies, workflows, secrets, package execution, or security-sensitive surfaces.

AGENTS.md: found and applied where relevant.

What I checked:

  • stale F-rated PR: PR was opened 2026-04-05T12:19:32Z, is older than 60 days, and the latest review rated it F.
  • proof blocker: real behavior proof is missing and proof tier is F, so this branch is not merge-ready without contributor follow-up.
  • no human follow-up: live comments and timeline hydrated by apply contain no non-automation activity after the ClawSweeper review.

Likely related people:

  • Takhoffman: GitHub commit history shows the Usage dashboard and local-day default date work touched the exact initializer and usage controller path. (role: feature introducer and default-date owner; confidence: high; commits: 8a352c8f9dfd, a442fcbd9bd6; files: ui/src/ui/app.ts, ui/src/ui/controllers/usage.ts, ui/src/ui/views/usage.ts)
  • huntharo: The local/UTC Usage date interpretation PR changed how selected UI date strings are sent through the gateway path. (role: date semantics contributor; confidence: medium; commits: 844d84a7f53b; files: ui/src/ui/controllers/usage.ts, ui/src/ui/app-render-usage-tab.ts, ui/src/ui/controllers/usage.node.test.ts)
  • BunsDev: Recent Usage overview rendering and localization work touched the Usage render surface that contains date controls and presets. (role: recent adjacent area contributor; confidence: medium; commits: a5309b6f93db; files: ui/src/ui/views/usage.ts, ui/src/ui/app-render-usage-tab.ts, ui/src/i18n/locales/en.ts)
  • joshavant: Recent controller cleanup touched the path that consumes initialized Usage dates for gateway requests. (role: recent controller refactor contributor; confidence: medium; commits: 10fa7c1b8dae, b658e5d35ccc; files: ui/src/ui/controllers/usage.ts)

Codex review notes: model internal, reasoning high; reviewed against 95b97e5b0b5e.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels May 19, 2026
@openclaw-barnacle openclaw-barnacle Bot added the triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. label May 19, 2026
@clawsweeper clawsweeper Bot added the merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. label May 20, 2026
@clawsweeper

clawsweeper Bot commented May 20, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper PR egg

🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat.

Where did the egg go?
  • The egg game starts only after the PR passes the real-behavior proof check.
  • Before that, no creature or rarity is rolled. The treat waits for real proof.
  • This is still just collectible flavor: proof affects review readiness, not creature quality.

@RomneyDa

Copy link
Copy Markdown
Member

Heads up: this PR needs to be updated against current main before the new required Dependency Guard check can pass.

@openclaw-barnacle

Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added the stale Marked as stale due to inactivity label Jun 13, 2026
@clawsweeper

clawsweeper Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper applied the proposed close for this PR.

@clawsweeper clawsweeper Bot closed this Jun 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: XS stale Marked as stale due to inactivity status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants