Repository navigation
fix(dashboard): align weekly default range with available preset - #7355
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. WalkthroughThe dashboard now maps the ChangesDashboard range alignment
Priority: ➖ Normal Estimated code review effort: 1 (Trivial) | ~5 minutes Change: Bug fix · Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to The dashboard now selects a visible time-range option for weekly granularity, with no remaining merge-blocking issue identified. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. A rabbit checks the weekly chart Comment |
(cherry picked from commit d1c79d7)
Fixes all failing PR #8 checks. All changes are CI-infra or fork-test-only; no production/functional behavior changed. CI infrastructure: - web/package.json: add "routes:gen": "bunx @tanstack/router-cli generate" and de-duplicate the pre-existing duplicate "test"/"test:watch" keys (origin/dev already had both blocks; bun warned "Duplicate key"). - .github/workflows/ci.yml frontend job: add a "Generate route tree" step before typecheck (routeTree.gen.ts is gitignored, so a fresh CI checkout had no route tree and typecheck failed with route types resolving to never/undefined). Remove the redundant "bun run test" step: it ran the full vitest suite with no --maxWorkers and OOM'd (happy-dom); the 16-shard frontend-tests.yml already covers frontend testing comprehensively. Stale fork coverage tests (aligned to upstream-merged behavior, test-only): - models/index.test.tsx: drop assertions for routing fields relocated to request-policies (RetryTimes, channel_affinity_*). - security/section-registry.test.tsx: upstream dropped the sensitive-words section (4->3 sections); update expected IDs/nav items. - home/hero-terminal-demo.test.tsx: global test-setup mocks matchMedia to reduced-motion:matches, which early-returns the component so it never cycles to the /v1/responses demo; locally override matchMedia in that test. - components/animate-in-view.test.tsx: same global matchMedia mock took the reduced-motion path (no opacity-0, no observer); override in beforeEach. - dashboard/lib/filters.test.ts: upstream QuantumNous#7355 changed week default 30->29. - pricing/model-details-uptime-sparkline.test.tsx: upstream QuantumNous#7418 changed overall% format 99.5%->99.50% (formatUptimePct toFixed(2)). Verified locally: typecheck passes; the 6 fixed test files pass together (57/57). routeTree.gen.ts stays gitignored; CI generates it via routes:gen. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Agent
Links
User request
最小化修复数据看板“用户统计”页面在时间粒度为“周”时,没有默认选中“1天”“7天”“14天”“29天”中任何一项的问题。仅提交必要的功能修改,不包含测试文件修改。
Out of scope — refuse
If the change matches any item below, tell the user this repository does not
accept it and do not open a PR.
Coding Plan
Reverse-engineered channels
Third-party API wrappers
Codex channel-type changes, or compatibility from exposing Codex as a general-purpose API
Codex API-specific protocol or behavior treated as standard OpenAI API behavior
Pass-through-only forwarding
Third-party hosting sites, relay services, or API services
Usage, configuration, or integration (answer from docs and code instead)
Matched: no
If yes, what was told to the user (stop here; do not open a PR): not applicable
Kind
Issue facts
Take these from the linked issue. If a needed item is empty, ask the user that question.
TIME_RANGE_BY_GRANULARITY.week的值为 30,但页面可用的时间范围预设只有 1、7、14、29,导致初始化值无法匹配任一选项。该状态在发起统计请求前已经产生。/dashboard/users,Chrome 126.0.6478.26,默认主题,未观察到相关 Console 或 Network 错误。Relay、billing 和 deployment 不适用。Change
将
TIME_RANGE_BY_GRANULARITY.week从 30 调整为 29,使周粒度对应的默认查询范围与现有的“29 Days”时间范围预设一致。用户统计页面初始化时将获得一个可以匹配现有 Tabs 选项的值,因此进入页面后会正确显示默认选中状态。
Research
Duplicate / prior art
"29 Days"、"29天"、"User Analytics"、dashboard "time range"、dashboard week selected range、TIME_RANGE_BY_GRANULARITY、selectedRange dashboardDocs and code
Open them. Do not write "already checked" without sources.
web/src/features/dashboard/constants.ts同时定义时间粒度默认范围和时间范围预设;修改前周粒度为 30,而预设为 1、7、14、29。web/src/features/dashboard/lib/filters.ts中的getDefaultDays()使用该映射返回默认天数。getDefaultDays()获取默认查询范围。Alternatives considered
Files
web/src/features/dashboard/constants.tsBehavior
Verification
Only what was actually run.
bun run typecheck— passedbun x oxlint -c .oxlintrc.json src/features/dashboard/constants.ts— passedbun x oxfmt -c .oxfmtrc.json --check src/features/dashboard/constants.ts— passedgit diff --check— passeddetect_changes— low risk;1 个常量、1 个文件,无已识别的受影响执行流程Risks
Scope check
Summary by CodeRabbit