Conversation
* feat(leaderboard): add tooltip and tiered coloring to cache coefficient column - Add headerTooltip support to leaderboard table headers with a help icon - Explain cache coefficient: higher value means fewer provider account switches and less noticeable cache degradation - Tiered coloring aligned with cache hit rate: >=0.9 excellent (green), >=0.8 good (yellow), below 0.8 orange - Add i18n copy for all 5 locales and unit tests * fix(leaderboard,logs): address review feedback and single-line session id - Make header tooltip trigger a focusable button with aria-label so keyboard users can open the field explanation (a11y review) - Strengthen cache coefficient tests: scope tooltip query to the column header, assert clicking the help icon does not toggle sorting, cover 0.90/0.80 boundary tiers and null display - Show Canonical Session ID on a single truncated line in the session info drawer; full value stays in the DOM for select-copy and the link navigation is unchanged
…1390) Derive quick filter highlight states from the actual filter values so the quick filters bar, date range picker and time inputs stay in sync no matter which control changed the range. Selecting "today" anywhere now lights up the matching period everywhere and fills the date/time display, and every quick condition supports click-to-select and click-again-to-clear. Time and status presets can also stay highlighted at the same time, and editing the start/end clock clears the exact-day preset highlight to avoid stale state.
* fix(message): restore canonical expression-index lookup for reserved identities The canonical session lookup for reserved identities had drifted away from the messageSessionIdentity expression index, causing queries to miss the optimised index path. The condition now always anchors on the expression-index column while still allowing owner-scoped lookups to match legacy null-identity rows via the session_id fallback. Unscoped reserved lookups remain narrow and do not pick up unrelated null-identity rows, preserving reserved identity isolation. * test(repository): assert coalesce in owner-scoped legacy identity fallback Extend the reserved identity SQL contract test to verify that the generated where clause uses coalesce when resolving owner-scoped session requests for legacy clients. * test(sessions): strengthen reserved identity query and route coverage Add encoded-identity regression cases to the v1 session requests route test, verifying that URL-encoded session identities (pfx: and sid: prefixed) resolve correctly through the endpoint. Rewrite the repository-level session request query tests to compile the generated SQL via PgDialect instead of string matching, and parameterize them across both pfx: and sid: identity prefixes. The assertions now verify the exact coalesce expression, identity guards, and parameter bindings for both owner-scoped legacy fallback and unscoped canonical lookups. * style(message): normalize comment punctuation to half-width comma
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
📝 WalkthroughWalkthrough本次变更更新排行榜缓存系数展示和多语言提示,重构日志快速筛选联动,并规范化 canonical Session ID 的路由与查询处理。相关测试覆盖 tooltip、筛选状态、时区范围、会话解码和 SQL 条件。 Changes排行榜缓存系数展示
日志快速筛选联动
规范会话标识处理
Estimated code review effort: 4 (Complex) | ~45 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 2 | ❌ 3❌ Failed checks (1 warning, 2 inconclusive)
✅ Passed checks (2 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 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. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8baef8be7f
ℹ️ 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".
| if (activeQuickPeriod === period) { | ||
| onDateRangeChange({ startDate: undefined, endDate: undefined }); |
There was a problem hiding this comment.
Distinguish custom-clock ranges before toggling date presets
After selecting Today and then changing the start or end clock, activeQuickPeriod still reports today because it compares only the date strings. Clicking the Today button therefore enters this new branch and clears the entire range, even though the exact-range quick-filter logic correctly considers the custom-clock range inactive. This makes the two Today controls disagree and causes a preset click to discard the filter instead of applying the full-day preset; the toggle should use the same exact timestamp predicate or account for the clocks.
Useful? React with 👍 / 👎.
| const colorClass = | ||
| value >= 0.9 | ||
| ? "text-green-600 dark:text-green-400" | ||
| : value >= 0.8 | ||
| ? "text-yellow-600 dark:text-yellow-400" |
There was a problem hiding this comment.
Match coefficient precision to the displayed tier
The repository computes cacheCoefficientBp as an arbitrary integer basis-point value, but this renderer assigns the tier using the unrounded value while displaying only two decimals. Values from 8950 through 8999 therefore appear as 0.90 in yellow rather than the documented green 0.9+ tier, and 7950 through 7999 similarly appear as 0.80 in orange. Either display enough precision to justify the tier or classify the same rounded value that users see.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/app/[locale]/dashboard/logs/_components/usage-logs-filters.tsx (1)
25-25: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value改用路径别名
@/导入。第 25 行新增的导入使用相对路径
../_utils/time-range。根据编码规范,.ts/.tsx文件应使用@/别名映射到./src/。Based on coding guidelines:
**/*.{ts,tsx,js,jsx}: "Use path alias@/to map to ./src/ for imports".♻️ 建议修改
-import { detectQuickTimePreset, getQuickTimeRange } from "../_utils/time-range"; +import { detectQuickTimePreset, getQuickTimeRange } from "`@/app/`[locale]/dashboard/logs/_utils/time-range";🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/app/`[locale]/dashboard/logs/_components/usage-logs-filters.tsx at line 25, Update the import in the usage logs filters module to use the configured `@/` path alias instead of the relative ../_utils/time-range path, while preserving the existing detectQuickTimePreset and getQuickTimeRange imports.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/app/`[locale]/dashboard/logs/_components/usage-logs-filters.tsx:
- Line 25: Update the import in the usage logs filters module to use the
configured `@/` path alias instead of the relative ../_utils/time-range path,
while preserving the existing detectQuickTimePreset and getQuickTimeRange
imports.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: ca9c1e0c-b3e8-4eea-9dcb-5ce708791aaf
📒 Files selected for processing (20)
messages/en/dashboard.jsonmessages/ja/dashboard.jsonmessages/ru/dashboard.jsonmessages/zh-CN/dashboard.jsonmessages/zh-TW/dashboard.jsonsrc/app/[locale]/dashboard/leaderboard/_components/leaderboard-table.tsxsrc/app/[locale]/dashboard/leaderboard/_components/leaderboard-view.tsxsrc/app/[locale]/dashboard/logs/_components/error-details-dialog/components/SummaryTab.tsxsrc/app/[locale]/dashboard/logs/_components/filters/quick-filters-bar.tsxsrc/app/[locale]/dashboard/logs/_components/logs-date-range-picker.tsxsrc/app/[locale]/dashboard/logs/_components/usage-logs-filters.tsxsrc/app/[locale]/dashboard/logs/_utils/time-range.tssrc/app/[locale]/dashboard/sessions/[sessionId]/messages/_components/session-messages-client-actions.test.tsxsrc/app/[locale]/dashboard/sessions/[sessionId]/messages/_components/session-messages-client.tsxsrc/repository/message.tstests/api/v1/sessions/sessions.test.tstests/unit/dashboard-logs-quick-filters-linkage.test.tsxtests/unit/dashboard-logs-time-range-utils.test.tstests/unit/dashboard/leaderboard-view-cache-coefficient.test.tsxtests/unit/repository/message-session-request-query.test.ts
🧪 测试结果
总体结果: ✅ 所有测试通过 |
There was a problem hiding this comment.
Code Review Summary
No significant issues identified in this PR. I reviewed the new session identity handling, quick-filter synchronization, leaderboard cache-coefficient UI changes, and the related regression coverage in the diff.
PR Size: L
- Lines changed: 767
- Files changed: 20
- Split suggestions: Consider separating the session identity fixes, dashboard log filter UX changes, and leaderboard cache-coefficient work into distinct PRs to reduce review surface on future releases.
Review Coverage
- Logic and correctness - Clean
- Security (OWASP Top 10) - Clean
- Error handling - Clean
- Type safety - Clean
- Documentation accuracy - Clean
- Test coverage - Adequate
- Code clarity - Good
Automated review by Codex AI
There was a problem hiding this comment.
- Reviewed PR
#1392end-to-end against the current diff, with extra focus on the new session identity handling, dashboard log filter changes, leaderboard cache-coefficient UI, and added regression tests. - Applied the
size/Llabel and submitted the GitHub review summary. - Result: no inline findings survived full-context validation, so I did not post line comments.
- Included split suggestions in the summary because this PR is
767changed lines across20files. - Note: I could not run local tests in this runner because
bunandnode_modulesare not available.
Greptile Summary
This release improves dashboard filtering and presentation while correcting canonical session lookup and navigation behavior.
Confidence Score: 5/5
The PR appears safe to merge, with no concrete changed-code defect identified.
The new filter ranges match the backend’s exclusive-end timestamp contract, canonical session normalization covers the generated reserved identity formats, and the repository predicate remains logically equivalent while improving index eligibility.
Important Files Changed
Reviews (1): Last reviewed commit: "fix(message): restore indexed reserved s..." | Re-trigger Greptile
Context used: