Skip to content

release v0.9.1 - #1392

Merged
ding113 merged 4 commits into
mainfrom
dev
Aug 3, 2026
Merged

release v0.9.1#1392
ding113 merged 4 commits into
mainfrom
dev

Conversation

@ding113

@ding113 ding113 commented Aug 3, 2026

Copy link
Copy Markdown
Owner

Greptile Summary

This release improves dashboard filtering and presentation while correcting canonical session lookup and navigation behavior.

  • Synchronizes usage-log quick filters with date, time, error, and retry controls.
  • Adds localized cache-coefficient guidance and visual quality tiers to leaderboard tables.
  • Decodes encoded canonical session route parameters and aligns client calls with the REST API wrapper.
  • Reworks the reserved-session query to use the existing COALESCE expression index without changing its result set.
  • Expands regression coverage for session queries, filter linkage, time ranges, and leaderboard rendering.

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

Filename Overview
src/app/[locale]/dashboard/logs/_utils/time-range.ts Adds timezone-aware, exclusive-end ranges and exact preset detection consistent with repository query semantics.
src/app/[locale]/dashboard/logs/_components/usage-logs-filters.tsx Derives quick-filter highlights from actual filter state and permits independent time, error, and retry presets.
src/app/[locale]/dashboard/leaderboard/_components/leaderboard-table.tsx Adds an accessible optional tooltip trigger to reusable leaderboard column headers.
src/app/[locale]/dashboard/leaderboard/_components/leaderboard-view.tsx Adds localized cache-coefficient guidance and threshold-based cell coloring.
src/app/[locale]/dashboard/sessions/[sessionId]/messages/_components/session-messages-client.tsx Normalizes URL-encoded reserved canonical identities before invoking session API wrappers.
src/repository/message.ts Re-expresses reserved canonical-session matching through the indexed COALESCE expression while preserving prior row-selection semantics.

Reviews (1): Last reviewed commit: "fix(message): restore indexed reserved s..." | Re-trigger Greptile

Context used:

ding113 added 4 commits August 3, 2026 13:52
* 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
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

本次变更更新排行榜缓存系数展示和多语言提示,重构日志快速筛选联动,并规范化 canonical Session ID 的路由与查询处理。相关测试覆盖 tooltip、筛选状态、时区范围、会话解码和 SQL 条件。

Changes

排行榜缓存系数展示

Layer / File(s) Summary
缓存系数提示与展示
messages/*/dashboard.json, src/app/[locale]/dashboard/leaderboard/_components/leaderboard-table.tsx, src/app/[locale]/dashboard/leaderboard/_components/leaderboard-view.tsx, tests/unit/dashboard/leaderboard-view-cache-coefficient.test.tsx
排行榜表头支持 tooltip。缓存系数统一格式化并按 >=0.9>=0.8 分层着色。帮助按钮不会触发表头排序。新增五种语言文案和对应测试。

日志快速筛选联动

Layer / File(s) Summary
快捷时间范围计算与识别
src/app/[locale]/dashboard/logs/_utils/time-range.ts, tests/unit/dashboard-logs-time-range-utils.test.ts
新增 Today 和 This Week 的时区范围计算、独占结束时间和精确预设识别。测试覆盖 UTC、指定时区及非完整范围。
多预设状态与筛选切换
src/app/[locale]/dashboard/logs/_components/usage-logs-filters.tsx, src/app/[locale]/dashboard/logs/_components/logs-date-range-picker.tsx
筛选激活状态改为根据实际过滤器值派生集合。时间、错误和重试预设可同时激活。重复点击当前时间预设会清空日期范围。
快速筛选控件状态
src/app/[locale]/dashboard/logs/_components/filters/quick-filters-bar.tsx
QuickFiltersBar 改为接收预设集合,并通过 aria-pressed 表示各按钮状态。
快速筛选联动验证
tests/unit/dashboard-logs-quick-filters-linkage.test.tsx
测试覆盖日期同步、重复点击清除、手动时间修改、Yesterday 不匹配,以及时间和状态预设并存。

规范会话标识处理

Layer / File(s) Summary
会话路由参数规范化
src/app/[locale]/dashboard/sessions/[sessionId]/messages/_components/session-messages-client.tsx, src/app/[locale]/dashboard/sessions/[sessionId]/messages/_components/session-messages-client-actions.test.tsx
客户端安全解码 sessionId,仅接受 pfx:sid: 前缀,并使用规范化值加载会话详情。新增 URL 编码 ID 测试。
会话查询条件调整
src/repository/message.ts, tests/api/v1/sessions/sessions.test.ts, tests/unit/repository/message-session-request-query.test.ts
查询允许用户范围内的空 session_identity,并保留规范 Session 表达式条件。新增特殊字符路由和 PostgreSQL SQL 条件测试。
会话标识显示调整
src/app/[locale]/dashboard/logs/_components/error-details-dialog/components/SummaryTab.tsx
超长会话标识链接改为单行截断显示。

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related PRs

Suggested reviewers: tesgth032, brisbanehuang

🚥 Pre-merge checks | ✅ 2 | ❌ 3

❌ Failed checks (1 warning, 2 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 18.75% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive 标题仅说明发布版本,没有概括本次包含的排行榜、日志筛选和会话处理变更。 请在标题中概括主要变更,例如“完善排行榜缓存系数提示并修复日志筛选与会话标识处理”。
Description check ❓ Inconclusive 作者未提供拉取请求描述,因此无法确认描述是否与变更集相关。 请补充说明本次版本发布包含的主要功能、修复和测试变更。
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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

Copy link
Copy Markdown

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: 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".

Comment on lines +110 to +111
if (activeQuickPeriod === period) {
onDateRangeChange({ startDate: undefined, endDate: undefined });

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

Comment on lines +110 to +114
const colorClass =
value >= 0.9
? "text-green-600 dark:text-green-400"
: value >= 0.8
? "text-yellow-600 dark:text-yellow-400"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

@ding113
ding113 merged commit 5b6cb4d into main Aug 3, 2026
19 of 20 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in Claude Code Hub Roadmap Aug 3, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 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

📥 Commits

Reviewing files that changed from the base of the PR and between 07fdc53 and 8baef8b.

📒 Files selected for processing (20)
  • messages/en/dashboard.json
  • messages/ja/dashboard.json
  • messages/ru/dashboard.json
  • messages/zh-CN/dashboard.json
  • messages/zh-TW/dashboard.json
  • src/app/[locale]/dashboard/leaderboard/_components/leaderboard-table.tsx
  • src/app/[locale]/dashboard/leaderboard/_components/leaderboard-view.tsx
  • src/app/[locale]/dashboard/logs/_components/error-details-dialog/components/SummaryTab.tsx
  • src/app/[locale]/dashboard/logs/_components/filters/quick-filters-bar.tsx
  • src/app/[locale]/dashboard/logs/_components/logs-date-range-picker.tsx
  • src/app/[locale]/dashboard/logs/_components/usage-logs-filters.tsx
  • src/app/[locale]/dashboard/logs/_utils/time-range.ts
  • src/app/[locale]/dashboard/sessions/[sessionId]/messages/_components/session-messages-client-actions.test.tsx
  • src/app/[locale]/dashboard/sessions/[sessionId]/messages/_components/session-messages-client.tsx
  • src/repository/message.ts
  • tests/api/v1/sessions/sessions.test.ts
  • tests/unit/dashboard-logs-quick-filters-linkage.test.tsx
  • tests/unit/dashboard-logs-time-range-utils.test.ts
  • tests/unit/dashboard/leaderboard-view-cache-coefficient.test.tsx
  • tests/unit/repository/message-session-request-query.test.ts

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

🧪 测试结果

测试类型 状态
代码质量
单元测试
集成测试
API 测试

总体结果: ✅ 所有测试通过

@github-actions github-actions Bot added size/M Medium PR (< 500 lines) size/L Large PR (< 1000 lines) and removed size/M Medium PR (< 500 lines) labels Aug 3, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

  • Reviewed PR #1392 end-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/L label 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 767 changed lines across 20 files.
  • Note: I could not run local tests in this runner because bun and node_modules are not available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/L Large PR (< 1000 lines)

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant