Repository navigation
fix(billing): wire workspace activity usage feed - #14811
dante01yoon wants to merge 2 commits into
Conversation
🎭 Playwright: ✅ 1786 passed, 0 failed · 3 flaky📊 Browser Reports
🎨 Storybook: ✅ Built — View Storybook📦 Bundle: 8.26 MB gzip 🔴 +878 BDetailsSummary
Category Glance App Entry Points — 3.64 kB (baseline 3.64 kB) • ⚪ 0 BMain entry bundles and manifests
Status: 1 added / 1 removed Graph Workspace — 1.35 MB (baseline 1.35 MB) • ⚪ 0 BGraph editor runtime, canvas, workflow orchestration
Status: 1 added / 1 removed / 1 unchanged Views & Navigation — 124 kB (baseline 124 kB) • ⚪ 0 BTop-level views, pages, and routed surfaces
Status: 13 added / 13 removed / 4 unchanged Panels & Settings — 552 kB (baseline 552 kB) • ⚪ 0 BConfiguration panels, inspectors, and settings screens
Status: 11 added / 11 removed / 16 unchanged User & Accounts — 27 kB (baseline 27 kB) • ⚪ 0 BAuthentication, profile, and account management bundles
Status: 6 added / 6 removed / 4 unchanged Editors & Dialogs — 124 kB (baseline 124 kB) • ⚪ 0 BModals, dialogs, drawers, and in-app editors
Status: 6 added / 6 removed / 1 unchanged UI Components — 72.1 kB (baseline 72.1 kB) • ⚪ 0 BReusable component library chunks
Status: 6 added / 6 removed / 9 unchanged Data & Services — 3.48 MB (baseline 3.48 MB) • ⚪ 0 BStores, services, APIs, and repositories
Status: 14 added / 14 removed / 3 unchanged Utilities & Hooks — 387 kB (baseline 387 kB) • ⚪ 0 BHelpers, composables, and utility bundles
Status: 19 added / 19 removed / 17 unchanged Vendor & Third-Party — 15.7 MB (baseline 15.7 MB) • ⚪ 0 BExternal libraries and shared vendor chunks Status: 16 unchanged Other — 12.8 MB (baseline 12.8 MB) • 🔴 +3.67 kBBundles that do not match a named category
Status: 78 added / 78 removed / 206 unchanged ⚡ Performance Report
✅ No regressions detected. All metrics
Historical variance (last 15 runs)
Trend (last 15 commits on main)
Raw data{
"timestamp": "2026-08-05T17:24:12.782Z",
"gitSha": "b77ebbaca0a64f5bf7054cd67e1e3b8ddea3c1d8",
"branch": "dante/workspace-activity-api-wiring",
"measurements": [
{
"name": "canvas-idle",
"durationMs": 2002.3759999999982,
"styleRecalcs": 12,
"styleRecalcDurationMs": 8.992999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 356.47499999999997,
"heapDeltaBytes": 5376684,
"heapUsedBytes": 69519156,
"domNodes": 24,
"jsHeapTotalBytes": 24903680,
"scriptDurationMs": 20.204,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "canvas-idle",
"durationMs": 2003.5650000000373,
"styleRecalcs": 10,
"styleRecalcDurationMs": 6.970999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 352.126,
"heapDeltaBytes": 5906448,
"heapUsedBytes": 70030680,
"domNodes": 20,
"jsHeapTotalBytes": 24903680,
"scriptDurationMs": 18.739,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1732.2619999999915,
"styleRecalcs": 72,
"styleRecalcDurationMs": 33.848000000000006,
"layouts": 12,
"layoutDurationMs": 3.661,
"taskDurationMs": 704.918,
"heapDeltaBytes": -68216,
"heapUsedBytes": 64135416,
"domNodes": 53,
"jsHeapTotalBytes": 25690112,
"scriptDurationMs": 106.854,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1744.8060000000396,
"styleRecalcs": 72,
"styleRecalcDurationMs": 30.596999999999998,
"layouts": 12,
"layoutDurationMs": 3.5080000000000005,
"taskDurationMs": 646.918,
"heapDeltaBytes": -13366820,
"heapUsedBytes": 50586216,
"domNodes": -280,
"jsHeapTotalBytes": 24621056,
"scriptDurationMs": 93.444,
"eventListeners": -151,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1683.3689999999706,
"styleRecalcs": 29,
"styleRecalcDurationMs": 14.235,
"layouts": 6,
"layoutDurationMs": 0.616,
"taskDurationMs": 289.98400000000004,
"heapDeltaBytes": 8301668,
"heapUsedBytes": 72455972,
"domNodes": 77,
"jsHeapTotalBytes": 24903680,
"scriptDurationMs": 22.098,
"eventListeners": 19,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1684.3170000000214,
"styleRecalcs": 31,
"styleRecalcDurationMs": 13.017,
"layouts": 6,
"layoutDurationMs": 0.603,
"taskDurationMs": 263.756,
"heapDeltaBytes": 8107324,
"heapUsedBytes": 72440156,
"domNodes": 77,
"jsHeapTotalBytes": 24903680,
"scriptDurationMs": 18.610000000000003,
"eventListeners": 19,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "dom-widget-clipping",
"durationMs": 404.88999999999464,
"styleRecalcs": 12,
"styleRecalcDurationMs": 7.204000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 270.02799999999996,
"heapDeltaBytes": -11269704,
"heapUsedBytes": 52740460,
"domNodes": 20,
"jsHeapTotalBytes": 25952256,
"scriptDurationMs": 43.49,
"eventListeners": 2,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000273
},
{
"name": "dom-widget-clipping",
"durationMs": 442.7959999999871,
"styleRecalcs": 13,
"styleRecalcDurationMs": 7.530000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 271.37699999999995,
"heapDeltaBytes": -11313940,
"heapUsedBytes": 52777172,
"domNodes": 22,
"jsHeapTotalBytes": 25165824,
"scriptDurationMs": 42.492000000000004,
"eventListeners": 2,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000273
},
{
"name": "large-graph-idle",
"durationMs": 2012.4829999999747,
"styleRecalcs": 11,
"styleRecalcDurationMs": 7.968000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 532.471,
"heapDeltaBytes": 5983216,
"heapUsedBytes": 67399244,
"domNodes": -278,
"jsHeapTotalBytes": 2990080,
"scriptDurationMs": 86.322,
"eventListeners": -147,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "large-graph-idle",
"durationMs": 2020.0639999999908,
"styleRecalcs": 10,
"styleRecalcDurationMs": 7.809,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 510.841,
"heapDeltaBytes": 7615316,
"heapUsedBytes": 66707248,
"domNodes": -280,
"jsHeapTotalBytes": 2990080,
"scriptDurationMs": 83.137,
"eventListeners": -147,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-pan",
"durationMs": 2075.0019999999836,
"styleRecalcs": 68,
"styleRecalcDurationMs": 15.432,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 921.9949999999999,
"heapDeltaBytes": 3164648,
"heapUsedBytes": 63957928,
"domNodes": -283,
"jsHeapTotalBytes": 3444736,
"scriptDurationMs": 294.735,
"eventListeners": -145,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-pan",
"durationMs": 2059.5500000000015,
"styleRecalcs": 68,
"styleRecalcDurationMs": 15.673,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 956.428,
"heapDeltaBytes": 21487372,
"heapUsedBytes": 82560672,
"domNodes": -282,
"jsHeapTotalBytes": 3969024,
"scriptDurationMs": 311.74600000000004,
"eventListeners": -179,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-zoom",
"durationMs": 3121.312000000046,
"styleRecalcs": 66,
"styleRecalcDurationMs": 15.693999999999999,
"layouts": 60,
"layoutDurationMs": 8.307,
"taskDurationMs": 1072.688,
"heapDeltaBytes": 22363756,
"heapUsedBytes": 86937392,
"domNodes": 16,
"jsHeapTotalBytes": 7602176,
"scriptDurationMs": 374.269,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66999999999998,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "large-graph-zoom",
"durationMs": 3187.4900000000252,
"styleRecalcs": 67,
"styleRecalcDurationMs": 16.933000000000003,
"layouts": 60,
"layoutDurationMs": 8.456,
"taskDurationMs": 1149,
"heapDeltaBytes": -5255632,
"heapUsedBytes": 59115476,
"domNodes": -282,
"jsHeapTotalBytes": 7184384,
"scriptDurationMs": 388.839,
"eventListeners": -181,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "minimap-idle",
"durationMs": 2020.2229999999872,
"styleRecalcs": 10,
"styleRecalcDurationMs": 7.079999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 499.9169999999999,
"heapDeltaBytes": 7375048,
"heapUsedBytes": 70080196,
"domNodes": -280,
"jsHeapTotalBytes": 3514368,
"scriptDurationMs": 81.828,
"eventListeners": -149,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66999999999998,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "minimap-idle",
"durationMs": 2033.7989999999877,
"styleRecalcs": 10,
"styleRecalcDurationMs": 6.982999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 507.52200000000005,
"heapDeltaBytes": 6559692,
"heapUsedBytes": 67274736,
"domNodes": -281,
"jsHeapTotalBytes": 4300800,
"scriptDurationMs": 83.44,
"eventListeners": -177,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 492.14900000004036,
"styleRecalcs": 49,
"styleRecalcDurationMs": 11.101999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 299.81,
"heapDeltaBytes": -10919840,
"heapUsedBytes": 53376936,
"domNodes": 24,
"jsHeapTotalBytes": 26214400,
"scriptDurationMs": 81.975,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 455.2940000000376,
"styleRecalcs": 48,
"styleRecalcDurationMs": 10.468,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 286.94199999999995,
"heapDeltaBytes": -10787856,
"heapUsedBytes": 53446304,
"domNodes": 22,
"jsHeapTotalBytes": 26476544,
"scriptDurationMs": 80.424,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000273
},
{
"name": "subgraph-idle",
"durationMs": 2010.9319999999968,
"styleRecalcs": 11,
"styleRecalcDurationMs": 7.807000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 349.504,
"heapDeltaBytes": 5270212,
"heapUsedBytes": 69550676,
"domNodes": 22,
"jsHeapTotalBytes": 25165824,
"scriptDurationMs": 15.665999999999999,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-idle",
"durationMs": 2007.944000000009,
"styleRecalcs": 10,
"styleRecalcDurationMs": 7.457999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 352.63800000000003,
"heapDeltaBytes": 4899120,
"heapUsedBytes": 69220624,
"domNodes": 20,
"jsHeapTotalBytes": 24903680,
"scriptDurationMs": 16.242,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1691.740999999979,
"styleRecalcs": 75,
"styleRecalcDurationMs": 29.525000000000002,
"layouts": 16,
"layoutDurationMs": 3.811,
"taskDurationMs": 626.0799999999999,
"heapDeltaBytes": -16213536,
"heapUsedBytes": 47838732,
"domNodes": -280,
"jsHeapTotalBytes": 24096768,
"scriptDurationMs": 79.792,
"eventListeners": -153,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1688.2400000000075,
"styleRecalcs": 77,
"styleRecalcDurationMs": 30.876,
"layouts": 16,
"layoutDurationMs": 3.9640000000000004,
"taskDurationMs": 569.774,
"heapDeltaBytes": -4300428,
"heapUsedBytes": 59982624,
"domNodes": 65,
"jsHeapTotalBytes": 25690112,
"scriptDurationMs": 78.58000000000001,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-transition-enter",
"durationMs": 849.3799999999965,
"styleRecalcs": 20,
"styleRecalcDurationMs": 20.993000000000006,
"layouts": 16,
"layoutDurationMs": 8.56,
"taskDurationMs": 607.419,
"heapDeltaBytes": 3664172,
"heapUsedBytes": 74350800,
"domNodes": 13673,
"jsHeapTotalBytes": 17039360,
"scriptDurationMs": 19.967,
"eventListeners": 2375,
"totalBlockingTimeMs": 60,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "viewport-pan-sweep",
"durationMs": 8085.432999999966,
"styleRecalcs": 249,
"styleRecalcDurationMs": 42.624,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 3252.627,
"heapDeltaBytes": 10189032,
"heapUsedBytes": 69950172,
"domNodes": -280,
"jsHeapTotalBytes": 5279744,
"scriptDurationMs": 985.557,
"eventListeners": -133,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "viewport-pan-sweep",
"durationMs": 8087.868000000015,
"styleRecalcs": 249,
"styleRecalcDurationMs": 43.096000000000004,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 3290.685,
"heapDeltaBytes": 8097564,
"heapUsedBytes": 69959916,
"domNodes": -281,
"jsHeapTotalBytes": 7114752,
"scriptDurationMs": 993.884,
"eventListeners": -131,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-large-graph-idle",
"durationMs": 11774.090999999999,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 11763.805999999999,
"heapDeltaBytes": -49842264,
"heapUsedBytes": 165213464,
"domNodes": -8312,
"jsHeapTotalBytes": -5447680,
"scriptDurationMs": 380.45099999999996,
"eventListeners": -16391,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.223333333333358,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-idle",
"durationMs": 11745.304000000033,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 11705.411,
"heapDeltaBytes": -67011916,
"heapUsedBytes": 159745432,
"domNodes": -8312,
"jsHeapTotalBytes": -5705728,
"scriptDurationMs": 411.28000000000003,
"eventListeners": -16400,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.223333333333358,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-pan",
"durationMs": 14055.799999999977,
"styleRecalcs": 66,
"styleRecalcDurationMs": 14.78299999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 14045.29,
"heapDeltaBytes": -22955888,
"heapUsedBytes": 182709496,
"domNodes": -8312,
"jsHeapTotalBytes": -10493952,
"scriptDurationMs": 644.632,
"eventListeners": -16391,
"totalBlockingTimeMs": 29,
"frameDurationMs": 16.66333333333338,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-pan",
"durationMs": 14183.266000000003,
"styleRecalcs": 70,
"styleRecalcDurationMs": 14.790999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 14171.717999999999,
"heapDeltaBytes": -47661944,
"heapUsedBytes": 158743284,
"domNodes": -8312,
"jsHeapTotalBytes": -7016448,
"scriptDurationMs": 663.44,
"eventListeners": -16389,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.219999999999953,
"p95FrameDurationMs": 16.80000000000291
},
{
"name": "workflow-execution",
"durationMs": 426.228999999978,
"styleRecalcs": 18,
"styleRecalcDurationMs": 16.656000000000002,
"layouts": 2,
"layoutDurationMs": 0.8320000000000001,
"taskDurationMs": 87.425,
"heapDeltaBytes": 5442852,
"heapUsedBytes": 68534212,
"domNodes": 160,
"jsHeapTotalBytes": 5505024,
"scriptDurationMs": 8.183,
"eventListeners": 99,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000273
},
{
"name": "workflow-execution",
"durationMs": 430.3540000000794,
"styleRecalcs": 14,
"styleRecalcDurationMs": 16.492,
"layouts": 3,
"layoutDurationMs": 1.0919999999999999,
"taskDurationMs": 85.84400000000001,
"heapDeltaBytes": 5088784,
"heapUsedBytes": 68297972,
"domNodes": 123,
"jsHeapTotalBytes": 4718592,
"scriptDurationMs": 8.275999999999998,
"eventListeners": 99,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
}
]
} |
📝 WalkthroughWalkthroughThe workspace activity panel now loads paginated billing events through a composable, converts usage events into activity records, and handles loading, errors, and refresh. The API uses generated billing-event types, with localization and test coverage added. ChangesWorkspace activity
Estimated code review effort: 3 (Moderate) | ~25 minutes Possibly related PRs
Suggested labels: Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant PlanCreditsPanelContent
participant useWorkspaceActivitySource
participant workspaceApi
participant billingEventToActivity
participant WorkspaceActivityContent
PlanCreditsPanelContent->>useWorkspaceActivitySource: initialize activity source
useWorkspaceActivitySource->>workspaceApi: request paginated billing events
workspaceApi-->>useWorkspaceActivitySource: return billing events
useWorkspaceActivitySource->>billingEventToActivity: convert usage events
billingEventToActivity-->>useWorkspaceActivitySource: return activity entries
useWorkspaceActivitySource-->>PlanCreditsPanelContent: provide events and state
PlanCreditsPanelContent->>WorkspaceActivityContent: pass activity events
Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 inconclusive)
✅ Passed checks (5 passed)
✨ Finishing Touches📝 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.
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 `@src/platform/workspace/composables/useWorkspaceActivitySource.ts`:
- Around line 14-56: Add a colocated Vitest test for useWorkspaceActivitySource
covering successful loading, member-name/email/ID resolution, failures clearing
events, and loading reset; update
src/platform/workspace/composables/useWorkspaceActivitySource.ts lines 14-56
with no direct production change required. In
src/platform/workspace/components/dialogs/settings/PlanCreditsPanelContent.test.ts
lines 11-18, expose resettable mock state and add component coverage for
loading, error/retry, and populated activity rendering.
- Around line 42-43: Update the billing-events fetch in
useWorkspaceActivitySource so it does not store only the first page from
workspaceApi.getBillingEvents(); instead, either aggregate all paged
BillingEventsResponse results in this flow before assigning rawEvents.value or
change getBillingEvents() to return the full combined event list. Keep the
refresh path in useWorkspaceActivitySource using the aggregated billing events
so later usage events are not omitted.
🪄 Autofix
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 Plus
Run ID: 49beb267-1b93-43d6-8412-6d38751de2cb
📒 Files selected for processing (6)
src/platform/workspace/api/workspaceApi.tssrc/platform/workspace/components/dialogs/settings/PlanCreditsPanelContent.test.tssrc/platform/workspace/components/dialogs/settings/PlanCreditsPanelContent.vuesrc/platform/workspace/composables/useWorkspaceActivitySource.tssrc/platform/workspace/utils/billingEventToActivity.test.tssrc/platform/workspace/utils/billingEventToActivity.ts
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## main #14811 +/- ##
==========================================
- Coverage 78.71% 78.69% -0.02%
==========================================
Files 1804 1806 +2
Lines 107023 107072 +49
Branches 30683 30695 +12
==========================================
+ Hits 84238 84259 +21
- Misses 22330 22358 +28
Partials 455 455
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-019fd293-f206-7568-aac5-3534ddb7a042
ea4581d to
e6f1fc6
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
|
Current-head route-mocked real-app evidence for Setup: mocked authenticated workspace and workspace-activity-clean.mp4 |
huang47
left a comment
There was a problem hiding this comment.
Requesting changes for three integration blockers:
- Current Cloud main rewrites
gpu_usage/api_node_usagetocloud_workflow_executed/api_usage_completed, while the mapper filters for the native names (existing inline). - Owner requests currently fall through to
scope=self. - Member visibility compares Cloud member IDs with Firebase UIDs.
CodeRabbit already covers first-page pagination and missing loading/error/retry coverage, so I did not duplicate those threads.
Amp-Thread-ID: https://ampcode.com/threads/T-019fd823-fe66-7616-873e-68ff236172f0 Co-authored-by: Amp <amp@ampcode.com>
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/platform/workspace/composables/useWorkspaceActivitySource.ts (1)
66-79: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winPrevent an earlier refresh from overwriting newer activity state.
Concurrent
refresh()calls are not ordered. If an earlier request settles after a newer request, it can replacerawEvents, restore an olderror, or setisLoadingtofalsewhile the newer request is pending.Track an active refresh token. Update state in
try,catch, andfinallyonly when the token is still current. Add a deferred-request test for this sequence.🤖 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/platform/workspace/composables/useWorkspaceActivitySource.ts` around lines 66 - 79, Update refresh() in useWorkspaceActivitySource to assign each invocation an active refresh token and guard all isLoading, error, and rawEvents updates in try, catch, and finally so only the latest refresh can mutate state. Preserve the current loading, success, and error behavior for the current request, and add a deferred-request test covering an older refresh settling after a newer one.
🤖 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.
Outside diff comments:
In `@src/platform/workspace/composables/useWorkspaceActivitySource.ts`:
- Around line 66-79: Update refresh() in useWorkspaceActivitySource to assign
each invocation an active refresh token and guard all isLoading, error, and
rawEvents updates in try, catch, and finally so only the latest refresh can
mutate state. Preserve the current loading, success, and error behavior for the
current request, and add a deferred-request test covering an older refresh
settling after a newer one.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 32029db8-dcb7-4abd-a404-781241907e0e
📒 Files selected for processing (9)
src/platform/workspace/api/workspaceApi.test.tssrc/platform/workspace/api/workspaceApi.tssrc/platform/workspace/components/dialogs/settings/PlanCreditsPanelContent.test.tssrc/platform/workspace/components/dialogs/settings/WorkspaceActivityContent.test.tssrc/platform/workspace/components/dialogs/settings/WorkspaceActivityContent.vuesrc/platform/workspace/composables/useWorkspaceActivitySource.test.tssrc/platform/workspace/composables/useWorkspaceActivitySource.tssrc/platform/workspace/utils/billingEventToActivity.test.tssrc/platform/workspace/utils/billingEventToActivity.ts
|
Current design has some blocking issue -we shouldn't have logic mapper from client. I'll set proper design before ask review again |
## Summary Adds deterministic browser coverage for the current-main partner-node, top-up, and responsive billing-cycle workflows. This PR is stacked on the isolated maximum-warning prerequisite #14815, which is itself stacked on #14713 so the Cloud Team recovery-banner slice remains independently reviewable. ## Why this is needed These journeys span stateful API polling, exact currency payloads, workspace-scoped balances, partner-node recovery, permission boundaries, and responsive pricing interactions. Main and #14713 did not deterministically exercise them, leaving regressions dependent on live billing state and timing. The maximum top-up test also exposed a current frontend bug: manually entering an amount at or above $10,000 clamps the input correctly, but the enterprise guidance was unreachable because the warning only appeared for values strictly greater than the maximum. ## Changes - Adds a typed stateful billing API fixture for deterministic status, balance, plans, preview, top-up, subscription, cancellation, and operation polling responses. - Adds partner-node coverage for price presentation, prompt execution request, sufficient-credit balance deduction/refresh, insufficient-credit recovery after a failed billing refresh, and member privacy/permissions. - Adds top-up coverage for exact-cent personal preset/custom payloads, active Team workspace scoping, pending completion, HTTP failure/retry, failed operation feedback, and the current $10,000/enterprise contract. - Adds monthly-to-yearly Creator pricing interaction through the direct supported pricing route on Cloud desktop and mobile, guarded by nonempty interactive-plan assertions. - Depends on #14815, which isolates the `showCeilingWarning` production prerequisite. ## Root cause and fix ### AS IS `showCeilingWarning` used `value > MAX_AMOUNT`. Because the input is clamped to `MAX_AMOUNT`, the observable value could never remain above the cap, hiding the warning and Contact us link at $10,000. [AS IS screenshot](https://ampcode.com/user-content/artifacts/6f5bcdc4d255307bdaed598273b88977160cebe70cc89f89baa56c5330e79c0f-file.png) ### TO BE The warning uses `value >= MAX_AMOUNT`, preserving the cap while exposing enterprise billing guidance at the reachable maximum. [TO BE screenshot](https://ampcode.com/user-content/artifacts/4ef8548ce8b54dee264330d27bcef202cc5633667fecacd04c46d170a3a4b44b-file.png) ## Review focus - Stateful billing operation polling and mocked balance refresh/deduction behavior. - Team member permission/privacy expectations. - The one-line maximum-warning prerequisite is isolated in #14815. - #14526 is an active draft for a future saved-payment-method UI contract with component tests; these browser tests remain scoped to current-main behavior and do not mock provider metering. - Workspace Activity API wiring and browser coverage are isolated in #14811 and #14813 rather than duplicated here. ## Validation - `pnpm typecheck` and `pnpm typecheck:browser` - Focused Cloud partner-node/top-up/pricing Playwright - Pricing mobile-chrome repeated 3 times and Cloud once after the responsive route fix - ESLint, oxfmt, oxlint, knip, and `git diff --check` ## Stacking - Base: `dante/topup-max-enterprise-warning` (#14815) - #14815 is based on `dante01yoon/test-billing-e2e-matrix` (#14713) - Workspace Activity prerequisite/tests: #14811 → #14813 --------- Co-authored-by: Amp <amp@ampcode.com>
|
Working the pre-17600 backlog. Recommending revive — and this is the third instance of a pattern worth naming once, which we are doing here rather than in three separate comments. On this PR specifically. Worth being precise that nothing is broken for users today. Also note #14813 cannot land without this one — it reads The pattern, stated once. Three items in this backlog are a finished component with no code path that reaches it:
Each was individually reasonable, and in two of the three the component genuinely landed first by design. The cost only shows up in aggregate: three components sitting on Not a criticism of the split — building the component first is often right. The gap is that the wiring follow-up has no tracked existence, so when it does not happen nothing notices. A linked issue at split time, or naming the wiring PR in the component PR's description, would make the second half visible without changing how you work. Happy to file that as a process issue if it is useful; we would rather raise it once here than keep finding instances. Recommend deciding #14811 and #14813 together: revive both, or close both and file the Activity feed design as one issue. |
Summary
Wire the existing Workspace Activity ledger to the current authenticated
/api/billing/eventsfeed and expose deterministic loading, refresh, empty, and retry states.Changes
gpu_usageandapi_node_usageevents into role-scoped Activity rows, resolve workspace member names, fetch on mount, and add Refresh/Try again actions.Root cause
The Activity table and its
eventsseam are onmain, butPlanCreditsPanelContentnever supplies events. As a result, the browser cannot issue the existing billing-events request and always renders the empty fixture state. The data-source composable also needs to preserveuserId; otherwise member-scoped filtering cannot enforce the existing role boundary.Review Focus
0because the current event contract has no cost field.Screenshots (if applicable)
Not included: this prerequisite wires data and recovery states into the existing Activity design without changing its layout.