feat: add customer detail sheet and remove inline usage section from customer sheet - #4026
Conversation
|
Warning Review limit reached
More reviews will be available in 10 minutes and 29 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThe PR refactors the customer management UI by separating view and edit flows. ChangesCustomer Detail View Refactor
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
971a46b to
bd91e3f
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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.
Inline comments:
In `@ui/app/workspace/governance/views/customerTable.tsx`:
- Around line 301-309: The row-level onKeyDown handler (the onKeyDown prop that
calls setViewingCustomer) is reacting to Enter/Space events bubbled from child
controls; update that handler to ignore events not originating on the row itself
by checking that the event target equals the event currentTarget (i.e., only
proceed when e.target === e.currentTarget), and only then preventDefault and
call setViewingCustomer(customer); keep the existing role="button" and tabIndex
handling unchanged.
- Line 24: Replace the unresolved import of CustomerDetailSheet by importing the
correct exported component (or creating a local fallback) instead of
"`@enterprise/components/user-groups/sheets/customerDetailSheet`" so module
resolution/TS2307 is fixed; locate where CustomerDetailSheet is referenced in
the CustomerTable component and point the import at the real module export (or
add an exported wrapper in this repo). Also prevent row activation when focus is
inside the actions menu by updating the table row onKeyDown handler in the
CustomerTable component to ignore Enter/Space when the event originates from a
descendant (add guard like e.target !== e.currentTarget) or alternatively stop
propagation on the CustomerActionsMenu trigger element (handle keydown in
CustomerActionsMenu to e.stopPropagation() for Enter/Space). Ensure changes
reference the CustomerTable onKeyDown handler and the CustomerActionsMenu
trigger to locate the edits.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: eb007a48-d7d5-4e78-ac7c-a8e3f91117c1
📒 Files selected for processing (3)
ui/app/workspace/governance/views/customerSheet.tsxui/app/workspace/governance/views/customerTable.tsxui/app/workspace/virtual-keys/views/virtualKeyDetailsSheet.tsx
bd91e3f to
7c059ec
Compare
Confidence Score: 5/5Safe to merge; changes are confined to UI presentation and event-handling wiring with no impact on data or backend logic All four changed files touch only React rendering and event handling. Existing data-testid attributes are preserved, stopPropagation is correctly placed, and the onKeyDown guard prevents the detail sheet from opening when buttons inside the row are keyboard-activated. The one noted issue is a cosmetic missing label in BudgetLineBar. ui/app/_fallbacks/enterprise/components/user-groups/sheets/customerDetailSheet.tsx — the BudgetLineBar empty label span Important Files Changed
Reviews (3): Last reviewed commit: "feat: governance views fixes" | Re-trigger Greptile |
7c059ec to
d7f1ea6
Compare
6711ce3 to
bea42b4
Compare
d7f1ea6 to
79ff813
Compare
79ff813 to
84ce67a
Compare
bea42b4 to
0dbda30
Compare
781b187 to
ad7050f
Compare
bff15f1 to
3fb0215
Compare
3fb0215 to
c2e4366
Compare
ad7050f to
91a986a
Compare
91a986a to
f120472
Compare
Merge activity
|
…customer sheet (#4026) ## Summary Introduces a dedicated read-only `CustomerDetailSheet` that opens when clicking a customer row, separating the "view usage details" concern from the edit sheet. The "Current Usage" section previously embedded in the edit sheet has been removed and will live in this new detail view instead. ## Changes - Removed the "Current Usage" block (budget and rate limit usage stats with badges) from `CustomerSheet`, along with the now-unused `Badge`, `formatCurrency`, and `formatDistanceToNow` imports. - Made the `CustomerSheet` header sticky and the footer sticky so they remain visible while scrolling long forms. - Added `CustomerDetailSheet` (from the enterprise components library) to `CustomerTable`, wired to a new `viewingCustomer` state. - Made each customer table row clickable (mouse and keyboard accessible) to open the `CustomerDetailSheet`. - Added `stopPropagation` to the Edit and Delete action menu items so clicking those actions no longer also triggers the row click handler. - Normalized `Token Limits` and `Request Limits` label font size to `text-sm` in `VirtualKeyDetailSheet` for visual consistency. ## Type of change - [ ] Bug fix - [x] Feature - [x] Refactor - [ ] Documentation - [ ] Chore/CI ## Affected areas - [ ] Core (Go) - [ ] Transports (HTTP) - [ ] Providers/Integrations - [ ] Plugins - [x] UI (React) - [ ] Docs ## How to test 1. Navigate to the Governance → Customers page. 2. Click any customer row — the `CustomerDetailSheet` should open showing that customer's details. 3. Open the action menu (⋯) on a row and select **Edit** — the edit sheet should open without also triggering the detail sheet. 4. Open the action menu and select **Delete** — the delete confirmation should appear without triggering the detail sheet. 5. Open the edit sheet for a customer that has budgets or rate limits configured and confirm the "Current Usage" section is no longer present there. 6. Verify the sheet header and footer remain visible (sticky) when the edit form is long enough to scroll. ```sh cd ui pnpm i pnpm build ``` ## Screenshots/Recordings _Add before/after screenshots showing the new clickable row behavior and the detail sheet._ ## Breaking changes - [x] No ## Related issues ## Security considerations No new auth surfaces introduced. The detail sheet respects existing RBAC checks inherited from the customer data already loaded in the table. ## Checklist - [ ] I read `docs/contributing/README.md` and followed the guidelines - [ ] I added/updated tests where appropriate - [ ] I updated documentation where needed - [ ] I verified builds succeed (Go and UI) - [ ] I verified the CI pipeline passes locally if applicable <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added customer detail view accessible by clicking customer rows in the table * **Improvements** * Restructured customer sheet dialog layout with optimized scrolling behavior * Removed usage information display from customer sheet * Enhanced event handling for customer actions * Updated styling for virtual key detail section headers <!-- end of auto-generated comment: release notes by coderabbit.ai -->
## ✨ Features - **OpenAI Compaction** — Added OpenAI conversation compaction support across core, framework, logging, and the API surface (#4053) - **Multi-Customer & Org Hierarchy** — Logs and usage tracking now support multiple customers, teams, and business units, including business unit CRUD, team assignment, and governance endpoints in the OpenAPI spec (#4066, #4041, #4082) - **Provider-Level Governance** — Budgets & limits are now scope-aware and can be applied at the virtual-key top level and per provider, wired from the model configs table, with UI filters for scope and providers (#3938, #3937, #3939, #3981, #3962) - **Customer Budgets** — Customers support multiple budgets and `calendar_aligned` budget windows (#3998, #3997) - **Virtual Key Attribution & Controls** — Added a `created_by` user attribution column and a `blacklisted_models` column for virtual key provider configs (#3672, #3653) - **Request Header Capture** — OTel and Maxim observability plugins capture `request_headers` by pattern, with wildcard support (e.g. `x-custom-*`); logging gained the same wildcard header capture (#4012, #3958) - **OTel Content Controls & Collectors** — New `disable_content_logging` option drops message/tool content from exported spans, plus support for multiple OTel collectors (#4064, #3894) - **xAI x_search** — Added xAI `x_search` tool support (#3976) - **URL Validation** — Added fetch URL validation with private-network configuration and link-local blocking (#3947, #3991) - **File Scheme Pricing URLs** — Pricing source URLs now accept the `file://` scheme for air-gapped and self-hosted deployments (#4045) - **Paginated Virtual Keys** — Virtual key fetching is paginated to handle deployments with very large numbers of keys (#3957) - **Client IP Resolution** — Resolve client IP from `X-Forwarded-For`/`X-Real-IP` headers - **SCIM Provisioning** — Added `attributeType`/`attributeValue` SCIM provisioning fields - **Helm/Config Schema** — Added `roles` RBAC governance config and `per_user_oauth` MCP auth to the Helm chart and config schema (#4004, #4009) - **Log Navigation UI** — Added a "View logs" menu item to customer, team, and virtual key tables, clickable links in log detail views, a customer detail sheet, and a reusable `BudgetDisplay` component (#4073, #4054, #4026, #4055) - **Faster First Paint** — Added an inline loading shell to `#root` before React mounts (#4063) - **Materialized View Alias** — Added an `alias` column to the materialized view with filter support (#4078) ## 🐞 Fixed - **Fetch URL IP Checks** — Hardened fetch URL IP checks against SSRF (#4092) - **Mantle Model Matching** — Broadened Mantle model matching to all `gpt` variants (#4091) - **Empty Thinking Blocks** — Strip thinking blocks when the signature is empty (#4079) - **OpenAI Stream Usage** — Removed usage from the `responses.created` event in the OpenAI stream (#4080) - **Prompt Cache Key** — Set the prompt cache key from the Anthropic integration (#4086) - **Upstream Failure Status** — Map upstream connection failures to 502 instead of 400 (#3929) (thanks [@chris-colinsky](https://github.com/chris-colinsky)!) - **Gemini Schema Constraints** — Accept numeric schema integer constraints for Gemini (#3994) (thanks [@yanhao98](https://github.com/yanhao98)!) - **Files Provider Param** — Accept the `?provider=` query param on `GET /v1/files` (#3971) (thanks [@alexef](https://github.com/alexef)!) - **Optional Batch Model** — Made the `model` field optional on `POST /v1/batches` (#3973) (thanks [@alexef](https://github.com/alexef)!) - **Helm Azure Config** — Added missing `azure_key_config` fields to the Helm schema (#3996) (thanks [@axelray-dev](https://github.com/axelray-dev)!) - **Text Completion Chunk Model** — Added the missing `Model` field to `TextCompletionChunkResponse` (#3970) (thanks [@kuishou68](https://github.com/kuishou68)!) - **MCP Inline stdio Env** — MCP stdio server configs accept inline environment variable assignments (#3861) (thanks [@Shushmitaaaa](https://github.com/Shushmitaaaa)!) - **Orphaned Tool Results** — Orphaned tool results in the OpenAI to Anthropic conversion flow are no longer rejected by the Anthropic API (#3919) - **Node Usage Reconciliation** — Added a monotonic `inc_number` log cursor so node usage reconciliation does not skip late async log writes (#3664) - **Bedrock Output Assessments** — Corrected the type of `outputAssessments` in Bedrock responses (#4028) - **Model Pool Pricing Reloads** — Preserve non-pricing model pool entries across pricing reloads (#3999) - **Ghost Node Reconciliation** — Replicate the VK hierarchy flow for ghost node reconciliation (#4088) - **VK Double Usage Counting** — Fixed double usage counting when creating a virtual key (#4070) - **Model Config Lifecycle** — Cascade deletes for model configs and removal of stale in-memory model configs (#4051, #4043) - **FTS Index Cap** — Reduced the FTS index `left()` cap from 800k to 250k chars to stay within the tsvector limit (#4057) - **Sync Worker Drift** — Reduced the sync worker ticker period to 5m to prevent threshold drift (#4023) - **Passthrough** — Fixed passthrough budgets, gated passthrough models per VK, model extraction for Azure passthrough, and restricted fallbacks/provider selection to the VK boundary (#3941, #3988, #3983, #3924) - **Provider Response Headers** — Strip provider response headers and add a content-type filter (#3955, #4024) - **Stream Handling** — Drain non-SSE stream readers and retry stale connections (#3956, #3967) - **Azure Claude** — Strip Azure diagnostic property for Claude models (#3925) - **Compat max_tokens** — Preserve chat `max_tokens` during param filtering (#3992) - **Raw Request Flag** — Removed the raw request flag from providers that don't support it (#4058) - **UI Fixes** — Standardized page container layout, virtual key model configs UI, and dashboard chart tooltips (#4046, #4052, #4044) ## 🔧 Maintenance - **Dependency Upgrades** — Bumped transitive `golang.org/x` dependencies (crypto, net, sys, text) for Docker Scout CVE remediation and `recharts` to 3.8.1; cascaded version bumps across all modules (#3900, #4003)

Summary
Introduces a dedicated read-only
CustomerDetailSheetthat opens when clicking a customer row, separating the "view usage details" concern from the edit sheet. The "Current Usage" section previously embedded in the edit sheet has been removed and will live in this new detail view instead.Changes
CustomerSheet, along with the now-unusedBadge,formatCurrency, andformatDistanceToNowimports.CustomerSheetheader sticky and the footer sticky so they remain visible while scrolling long forms.CustomerDetailSheet(from the enterprise components library) toCustomerTable, wired to a newviewingCustomerstate.CustomerDetailSheet.stopPropagationto the Edit and Delete action menu items so clicking those actions no longer also triggers the row click handler.Token LimitsandRequest Limitslabel font size totext-sminVirtualKeyDetailSheetfor visual consistency.Type of change
Affected areas
How to test
CustomerDetailSheetshould open showing that customer's details.cd ui pnpm i pnpm buildScreenshots/Recordings
Add before/after screenshots showing the new clickable row behavior and the detail sheet.
Breaking changes
Related issues
Security considerations
No new auth surfaces introduced. The detail sheet respects existing RBAC checks inherited from the customer data already loaded in the table.
Checklist
docs/contributing/README.mdand followed the guidelinesSummary by CodeRabbit
New Features
Improvements