feat(desktop): show token and compute usage - #79066
Conversation
|
😎 Merged successfully - details. |
charlesvien
left a comment
There was a problem hiding this comment.
This is really good, gonna help answer a lot of questions users keep asking in the Discord
Prompt To Fix All With AI### Issue 1
products/desktop/packages/ui/src/features/settings/sections/PlanUsageSettings.tsx:343-345
**Disclosure resets selected window**
When a user selects another spend window, collapses “Your spend,” and expands it again, the conditional render remounts `SpendAnalysisSection` and resets its local state to the 30-day default, causing the analysis to display a different range than the user selected.
```suggestion
{children && (
<div
hidden={!expanded}
className="border-(--gray-5) border-t p-4"
>
{children}
</div>
)}
```
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "feat(desktop): collapse personal spend a..." | Re-trigger Greptile |
| {expanded && children && ( | ||
| <div className="border-(--gray-5) border-t p-4">{children}</div> | ||
| )} |
There was a problem hiding this comment.
Disclosure resets selected window
When a user selects another spend window, collapses “Your spend,” and expands it again, the conditional render remounts SpendAnalysisSection and resets its local state to the 30-day default, causing the analysis to display a different range than the user selected.
| {expanded && children && ( | |
| <div className="border-(--gray-5) border-t p-4">{children}</div> | |
| )} | |
| {children && ( | |
| <div | |
| hidden={!expanded} | |
| className="border-(--gray-5) border-t p-4" | |
| > | |
| {children} | |
| </div> | |
| )} |
Knowledge Base Used: Desktop App and Agent Framework
Prompt To Fix With AI
This is a comment left during a code review.
Path: products/desktop/packages/ui/src/features/settings/sections/PlanUsageSettings.tsx
Line: 343-345
Comment:
**Disclosure resets selected window**
When a user selects another spend window, collapses “Your spend,” and expands it again, the conditional render remounts `SpendAnalysisSection` and resets its local state to the 30-day default, causing the analysis to display a different range than the user selected.
```suggestion
{children && (
<div
hidden={!expanded}
className="border-(--gray-5) border-t p-4"
>
{children}
</div>
)}
```
**Knowledge Base Used:** [Desktop App and Agent Framework](https://app.greptile.com/posthog-org-19734/-/custom-context/knowledge-base/posthog/posthog/-/docs/desktop-app.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.|
/trunk merge |
|
Hey @adboio! 👋 It looks like your git author email on this PR isn't your
You can fix it for this repo with: git config user.email "you@posthog.com"Or set it globally with |
|
React Doctor found 1 issue in 1 file · 1 warning. 1 warning
Reviewed by React Doctor for commit |
|
/trunk merge |
Generated-By: PostHog Code Task-Id: 7cc3caf7-5e0e-4d3d-b896-ee51a2f01856
Generated-By: PostHog Code Task-Id: 7cc3caf7-5e0e-4d3d-b896-ee51a2f01856
Generated-By: PostHog Code Task-Id: 7cc3caf7-5e0e-4d3d-b896-ee51a2f01856
Generated-By: PostHog Code Task-Id: 7cc3caf7-5e0e-4d3d-b896-ee51a2f01856
Generated-By: PostHog Code Task-Id: 7cc3caf7-5e0e-4d3d-b896-ee51a2f01856
0114c31 to
ad939f3
Compare
|
Note 🤖 stamphog reviewed Gates denied this PR (deny-list match on billing-related content and it's classified as T2-never for size/scope), so it's outside auto-approval scope; also the author is not on the owning team and there's an unresolved inline concern about state reset on disclosure toggle.
Gate mechanics and policy version
|
Generated-By: PostHog Code Task-Id: 7cc3caf7-5e0e-4d3d-b896-ee51a2f01856
Problem
PostHog Desktop users can see combined organization usage but cannot distinguish token spend from cloud-compute usage. The page also mixes organization billing with personal analysis without clearly explaining their different scope and freshness.
Changes
How did you test this code?
👉 Stay up-to-date with PostHog coding conventions for a smoother review.
Automatic notifications
Docs update
No documentation changes. The Plan & Usage surface explains scope, units, and freshness in context.
🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Authored with PostHog Code using the local
/frontend-designskill. The page now treats combined organization usage as the billing ledger and personal analysis as a separate near-real-time workspace.Created with PostHog Code