-
Notifications
You must be signed in to change notification settings - Fork 2.3k
feat: Experiment: Show a bit of stats in Cloud tab to help users discover there's more in Cloud #8415
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found some issues that need attention. See inline comments for concrete suggestions.
@roomote-agent implement the feedback I responded to. |
Acknowledged. I will implement the feedback you responded to: clear the 10s timeout when usagePreviewData arrives to prevent a stale error; and compute bar height as Math.round((cost / maxCost) * 100) with a minimum of 1. I will push changes to bb/experiment-stats shortly. |
…bar height calc; robust array transform
Implemented the feedback. Summary:
Local vitest suites for src and webview-ui passed. Changes pushed to bb/experiment-stats. CI checks are green. |
packages/cloud/src/CloudAPI.ts
Outdated
import { AuthenticationError, CloudAPIError, NetworkError, TaskNotFoundError } from "./errors.js" | ||
|
||
// Usage stats schemas | ||
const usageStatsSchema = z.object({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this should go in packages/types/src/cloud.ts? I think we could then share it with the cloud side.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This usually ends up being easiest (arguably...) to sequence as
- Add the types to packages/types.
- Update @roo-code/types
- Update @roo-code/types in cloud + ship the cloud functionality.
- Finally actually use the cloud functionality back here.
Co-authored-by: Roo Code <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Matt Rubens <[email protected]>
…8423) Co-authored-by: Roo Code <[email protected]> Co-authored-by: Matt Rubens <[email protected]>
Co-authored-by: roomote[bot] <219738659+roomote[bot]@users.noreply.github.com>
🚀 Preview deployed! Your changes have been deployed to Vercel: Preview URL: https://roo-code-website-gvmlsyrvx-roo-code.vercel.app This preview will be updated automatically when you push new commits to this PR. |
* origin/main: fix: Addresses overeager 'there are unsaved changes' dialog in settings (#8410) Add structured data to the homepage (#8427) fix: show send button when only images are selected in chat textarea (#8423) Include reasoning messages in cloud tasks (#8401) chore: Remove unsupported Gemini 2.5 Flash Image Preview free model (#8359) A couple more sonnet 4.5 fixes (#8421) Changeset version bump (#8414) chore: add changeset for v3.28.14 (#8413) feat: add GLM-4.6 model support for z.ai provider (#8408)
…into bb/experiment-stats * 'bb/experiment-stats' of github.com:RooCodeInc/Roo-Code:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found some issues that need attention. See inline comments for concrete suggestions.
<div className="p-4"> | ||
{/* Chart with daily usage bars */} | ||
<div className="h-24 min-[450px]:h-40 rounded mb-3 flex items-end gap-1 pb-2"> | ||
{data && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P2: Add accessible name/role for the chart container so assistive tech announces the widget meaningfully.
{data && | |
<div | |
className="h-24 min-[450px]:h-40 rounded mb-3 flex items-end gap-1 pb-2" | |
role="img" | |
aria-label={t("cloud:usagePreview.costPastDays", { count: data.days.length })}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found some issues that need attention. Focused on new, deduped findings only.
} | ||
|
||
return ( | ||
<div className="cursor-pointer group rounded-lg bg-vscode-editor-background relative" onClick={onViewDetails}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[P2] Interactive container is not keyboard-accessible. Add role, tabIndex, and Enter/Space key handling so users can activate the chart via keyboard.
<div className="cursor-pointer group rounded-lg bg-vscode-editor-background relative" onClick={onViewDetails}> | |
<div | |
className="cursor-pointer group rounded-lg bg-vscode-editor-background relative" | |
role="button" | |
tabIndex={0} | |
onClick={onViewDetails} | |
onKeyDown={(e) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); onViewDetails(); } }}> |
// Loading state | ||
if (isLoading) { | ||
return ( | ||
<div |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[P2] Loading state container is clickable but not keyboard-accessible. Mirror the same a11y affordances as the main chart.
<div | |
<div | |
className="cursor-pointer group rounded-lg bg-vscode-editor-background hover:bg-vscode-list-hoverBackground transition-colors relative" | |
role="button" | |
tabIndex={0} | |
onClick={onViewDetails} | |
onKeyDown={(e) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); onViewDetails(); } }}> |
// Error state | ||
if (error || !data) { | ||
return ( | ||
<div |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[P2] Error state is also a clickable retry affordance; add keyboard support (role, tabIndex, Enter/Space handler).
<div | |
<div | |
className="cursor-pointer group rounded-lg bg-vscode-editor-background hover:bg-vscode-list-hoverBackground transition-colors relative" | |
role="button" | |
tabIndex={0} | |
onClick={handleRetry} | |
onKeyDown={(e) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); handleRetry(); } }}> |
cloudIsAuthenticated && | ||
"cursor-pointer hover:bg-vscode-dropdown-background hover:border-vscode-dropdown-border transition-colors", | ||
)} | ||
style={{ opacity: cost !== null && cost !== undefined && cost > 0 ? 1 : 0 }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[P2] Invisible cost pill still intercepts clicks (opacity: 0 retains pointer events). This can trigger a navigation when the pill is visually hidden. Disable pointer events and hide from a11y when not visible.
style={{ opacity: cost !== null && cost !== undefined && cost > 0 ? 1 : 0 }} | |
style={{ | |
opacity: cost !== null && cost !== undefined && cost > 0 ? 1 : 0, | |
pointerEvents: cost !== null && cost !== undefined && cost > 0 ? 'auto' : 'none' | |
}} | |
aria-hidden={!(cost !== null && cost !== undefined && cost > 0)} |
Description
utm_source=extension&utm_medium=stats_preview&utm_campaign=stats_preview
)Screenshots / Videos
Important
Adds a bar chart in
CloudView
to display usage stats, with API and UI updates for enhanced user interaction with the Cloud app.CloudView
to display usage stats when logged in./usage
in the Cloud app.CloudView
.utm_source=extension&utm_medium=stats_preview&utm_campaign=stats_preview
.getUsagePreview()
inCloudAPI.ts
to fetch usage data.CloudAPI.ts
.webviewMessageHandler.ts
to handlegetUsagePreview
messages.UsagePreview
component inCloudView.tsx
.ChatRow.tsx
to handle cost click events.formatCost()
informat.ts
for consistent cost formatting.This description was created by
for 35154ef. You can customize this summary. It will automatically update as commits are pushed.