Skip to content

fix(access-key): 收敛模型页只读展示 - #453

Merged
tbphp merged 2 commits into
v2from
codex/access-key-view-polish
Aug 21, 2026
Merged

fix(access-key): 收敛模型页只读展示#453
tbphp merged 2 commits into
v2from
codex/access-key-view-polish

Conversation

@tbphp

@tbphp tbphp commented Aug 21, 2026

Copy link
Copy Markdown
Owner

关联 Issue / Related Issue

无 / None

变更内容 / Change Content

  • Bug 修复 / Bug fix

  • 新功能 / New feature

  • 其他改动 / Other changes

  • AccessKey 模型页隐藏价格状态列,保留上游模型与渠道图标。

  • 只读渠道图标不再提供渠道 Tooltip、键盘焦点或帮助光标。

自查清单 / Checklist

  • 我已运行 make check,或在说明中写明无法运行的原因和未验证范围。 / I ran make check, or documented why it could not run and what remains unverified.
  • 本 PR 范围聚焦,未包含无关改动。 / This PR is focused and contains no unrelated changes.
  • 我已确认无需更新公开文档或发布说明。 / I confirmed no public documentation or release-note update is required.
  • 我已确认提交、日志和测试数据不包含敏感信息。 / I confirmed that commits, logs, and fixtures contain no sensitive data.
  • 本次没有兼容性或数据迁移影响。 / This change has no compatibility or data-migration impact.

Summary by CodeRabbit

  • 改进
    • 只读模式下隐藏状态列表头、状态单元格及对应网格列,界面更加简洁。
    • 只读模式下,上游渠道图标调整为装饰性图标并使用默认光标。
    • 编辑模式下保留可聚焦图标及定价身份提示。

@tbphp
tbphp marked this pull request as ready for review August 21, 2026 10:20
Copilot AI lite review requested due to automatic review settings August 21, 2026 10:20
Repository owner deleted a comment from coderabbitai Bot Aug 21, 2026
@coderabbitai

coderabbitai Bot commented Aug 21, 2026

Copy link
Copy Markdown

Caution

CodeRabbit couldn't update its existing comment. The review summary may be out of date.

Check that CodeRabbit still has permission to update comments.

Error details
Not Found - https://docs.github.com/rest/issues/comments#update-an-issue-comment

@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: d7ddfa3986

ℹ️ 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 thread internal/control/request_logs.go Outdated

Copilot AI 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.

Pull request overview

This PR adds an AccessKey-scoped “cost formula / pricing calculation” display for request log details while keeping sensitive routing/pricing internals redacted, and adjusts the model tree UI for read-only (AccessKey) views by hiding the price status column and removing the channel tooltip.

Changes:

  • Expose a new pricing_calculation payload (line items only) on AccessKey-scoped request log detail responses and render it in the log detail drawer.
  • Hide the model price status column and remove channel tooltip behavior when the model tree is in readOnly mode, while still showing the channel icon.
  • Add projection/types for pricing_calculation on the web client and extend backend tests to assert redaction plus calculation field presence.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
web/src/features/monitor/LogDetailDrawer.vue Uses pricing_calculation for self-scoped (AccessKey) log cost formula display while preserving existing receipt-based behavior for non-scoped views.
web/src/features/models/ModelTree.vue Hides status column and removes channel tooltip in readOnly mode; keeps channel icon visible.
web/src/app/resources/request-logs.ts Adds DTO + projector for pricing_calculation and reuses shared line-item projection logic.
internal/control/request_logs.go Adds pricing_calculation response struct and mapping for AccessKey detail endpoint; adjusts sanitization flow accordingly.
internal/control/request_logs_test.go Extends AccessKey redaction test to validate pricing_calculation includes only expected public line-item fields.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread internal/control/request_logs.go Outdated
Comment thread internal/control/request_logs.go

@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.

Note

Quiet mode is enabled, so only the most important comments were posted inline. Other review comments are grouped below.

🟡 Other comments (1)
web/src/features/models/ModelTree.vue-137-142 (1)

137-142: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

为只读渠道图标取消 help 光标。

只读分支已移除 AppTooltip,但仍使用 .model-tree__channel-icon。该类在 Line 388 设置 cursor: help。因此用户悬停时仍会看到帮助光标,但页面不会显示渠道提示。

为只读分支增加装饰性修饰类,并将光标改为 default。非只读分支继续保留 help 光标。

建议修改
-                <span v-else class="model-tree__channel-icon" aria-hidden="true">
+                <span
+                  v-else
+                  class="model-tree__channel-icon model-tree__channel-icon--decorative"
+                  aria-hidden="true"
+                >
+.model-tree__channel-icon--decorative {
+  cursor: default;
+}

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: QUIET

Plan: Pro Plus

Run ID: 95ee39df-5ece-4805-8f0b-d1bc24266bc6

📥 Commits

Reviewing files that changed from the base of the PR and between 8898421 and d7ddfa3.

📒 Files selected for processing (5)
  • internal/control/request_logs.go
  • internal/control/request_logs_test.go
  • web/src/app/resources/request-logs.ts
  • web/src/features/models/ModelTree.vue
  • web/src/features/monitor/LogDetailDrawer.vue

Included review availability: Your plan provides up to 8 included reviews per hour; 6 remain after this review.

@tbphp tbphp changed the title feat(access-key): 展示日志成本计算 fix(access-key): 收敛模型页只读展示 Aug 21, 2026
@coderabbitai

coderabbitai Bot commented Aug 21, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: QUIET

Plan: Pro Plus

Run ID: 9c250cc2-1eb8-48a7-8b5a-b00dc590cf37

📥 Commits

Reviewing files that changed from the base of the PR and between d7ddfa3 and 5db23b5.

📒 Files selected for processing (1)
  • web/src/features/models/ModelTree.vue

Included review availability: Your plan provides up to 8 included reviews per hour; 6 remain after this review.


📝 Walkthrough

Walkthrough

模型树在只读模式下隐藏状态列表头、状态单元格和状态网格列。上游渠道图标在只读模式下作为带 aria-hidden 的装饰性图标显示,并使用默认光标。非只读模式继续提供定价身份提示和可聚焦交互。

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 11 functions across 3 files. (1 skipped: 1 unsupported.) Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 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.
Title check ✅ Passed 标题准确概括了 AccessKey 模型页只读展示收敛的主要变更,内容简洁且与代码改动一致。
Description check ✅ Passed 描述包含关联 Issue、变更内容和自查清单,清楚说明了只读展示调整及验证结果。
✨ Finishing Touches
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch codex/access-key-view-polish

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.

@tbphp tbphp self-assigned this Aug 21, 2026
@tbphp tbphp added the enhancement New feature or request label Aug 21, 2026
@tbphp tbphp added this to the v2.0.0 milestone Aug 21, 2026
@tbphp
tbphp merged commit 986a211 into v2 Aug 21, 2026
7 checks passed
@tbphp
tbphp deleted the codex/access-key-view-polish branch August 21, 2026 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants