Skip to content

fix(web): polish analytics dashboard charts#981

Merged
AmanVarshney01 merged 3 commits intomainfrom
aman/analytics-dashboard-polish
Mar 19, 2026
Merged

fix(web): polish analytics dashboard charts#981
AmanVarshney01 merged 3 commits intomainfrom
aman/analytics-dashboard-polish

Conversation

@AmanVarshney01
Copy link
Owner

@AmanVarshney01 AmanVarshney01 commented Mar 19, 2026

Summary

  • switch ranked analytics charts to vertical bar layouts and rebalance dense distributions into grouped views
  • improve analytics chart spacing and sizing for dense environment and stack sections
  • align chart titles and descriptions with the CLI terminology and remove internal layout-oriented copy

Verification

  • bun run check
  • bun run build:web
  • browser pass on /analytics (desktop)

Summary by CodeRabbit

  • New Features

    • Added horizontal layout and multi-column rendering for preference charts; improved count formatting and dynamic margins.
    • Expanded CLI version data scope in analytics.
  • UI/UX Improvements

    • Updated analytics card titles, subtitles and descriptions for clearer wording.
    • Removed eyebrow badges from chart headers.
    • Preference charts now show primary counts with secondary percentages.
    • Refined bar chart styling (corner rounding) and adjusted chart layouts.

@vercel
Copy link

vercel bot commented Mar 19, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
create-better-t-stack-web Ready Ready Preview, Comment Mar 19, 2026 0:14am

Request Review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 19, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ef49bd22-c082-429e-a3b1-21ffa7d9378f

📥 Commits

Reviewing files that changed from the base of the PR and between c9cefa5 and dab6ac1.

📒 Files selected for processing (1)
  • apps/web/src/app/(home)/analytics/_components/dev-environment-charts.tsx

Walkthrough

Updated analytics UI copy and chart presentations; removed the eyebrow prop across chart components; added number formatting and horizontal-margin helpers; refactored PreferenceChartCard for horizontal/vertical, chunked rendering; adjusted chart layouts and analytics-client distribution slicing.

Changes

Cohort / File(s) Summary
Header / Copy
apps/web/src/app/(home)/analytics/_components/analytics-header.tsx, apps/web/src/app/(home)/analytics/_components/metrics-cards.tsx, apps/web/src/app/(home)/analytics/_components/timeline-charts.tsx
Rewrote visible copy to emphasize project-creation volume and live/archive telemetry; updated metric/card descriptions and reduced bar corner radii in timeline charts.
ChartCard & Consumers
apps/web/src/app/(home)/analytics/_components/chart-card.tsx, apps/web/src/app/(home)/analytics/_components/dev-environment-charts.tsx, apps/web/src/app/(home)/analytics/_components/stack-configuration-charts.tsx
Removed eyebrow prop from ChartCard and callers; simplified header spacing and adjusted grid/layouts and conditional rendering in dependent components.
PreferenceChartCard
apps/web/src/app/(home)/analytics/_components/preference-chart-card.tsx
Added props (className, chartClassName, layout, columnCount, columnGridClassName); removed eyebrow; switched from single Plot to chunked Plot children; added horizontal and vertical rendering modes; use formatCount for labels and countMax for axes.
Helpers
apps/web/src/app/(home)/analytics/_components/analytics-helpers.ts
Added formatCount(value) number formatter; removed default xLimit/yLimit in buildComboMatrix so limits are now optional; added resolveHorizontalBarMargins() to compute margins based on label/value lengths.
Analytics client data
apps/web/src/app/(home)/analytics/analytics-client.tsx
Stopped truncating CLI-version distribution: removed .slice(0, 10) so full filtered CLI version set is preserved when building precomputed data.

Possibly related PRs

  • AmanVarshney01/create-better-t-stack PR 709 — touches the same analytics UI and helper files (header, helpers, preference card, analytics client).
  • AmanVarshney01/create-better-t-stack PR 973 — overlaps on chart/component prop/layout changes and margin/formatting logic in analytics components.
  • AmanVarshney01/create-better-t-stack PR 712 — modifies analytics-client buildFromPrecomputed behavior related to distribution handling.
🚥 Pre-merge checks | ✅ 2 | ❌ 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%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix(web): polish analytics dashboard charts' accurately summarizes the main change—improving and refining the analytics dashboard charts through layout adjustments, spacing improvements, and copy updates.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

📝 Coding Plan
  • Generate coding plan for human review comments

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 and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b6ed8c09-4e55-4eea-ba74-f3b558bae992

📥 Commits

Reviewing files that changed from the base of the PR and between 7f751a9 and c9cefa5.

📒 Files selected for processing (9)
  • apps/web/src/app/(home)/analytics/_components/analytics-header.tsx
  • apps/web/src/app/(home)/analytics/_components/analytics-helpers.ts
  • apps/web/src/app/(home)/analytics/_components/chart-card.tsx
  • apps/web/src/app/(home)/analytics/_components/dev-environment-charts.tsx
  • apps/web/src/app/(home)/analytics/_components/metrics-cards.tsx
  • apps/web/src/app/(home)/analytics/_components/preference-chart-card.tsx
  • apps/web/src/app/(home)/analytics/_components/stack-configuration-charts.tsx
  • apps/web/src/app/(home)/analytics/_components/timeline-charts.tsx
  • apps/web/src/app/(home)/analytics/analytics-client.tsx
💤 Files with no reviewable changes (1)
  • apps/web/src/app/(home)/analytics/analytics-client.tsx

Comment on lines 56 to 58
const webDeployTargets = data.webDeployDistribution;
const serverDeployTargets = data.serverDeployDistribution;
const hasDeployTargets = webDeployTargets.length > 0 || serverDeployTargets.length > 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Keep the "none" sentinel out of the deployment-provider charts.

These assignments now feed skipped deployments into cards labeled as deployment options. If "none" is common, the largest bar becomes a non-selection, which makes the “Web deployment” and “Server deployment” charts misleading and hides the real provider breakdown.

Suggested fix
-  const webDeployTargets = data.webDeployDistribution;
-  const serverDeployTargets = data.serverDeployDistribution;
+  const webDeployTargets = data.webDeployDistribution.filter((item) => item.name !== "none");
+  const serverDeployTargets = data.serverDeployDistribution.filter(
+    (item) => item.name !== "none",
+  );
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const webDeployTargets = data.webDeployDistribution;
const serverDeployTargets = data.serverDeployDistribution;
const hasDeployTargets = webDeployTargets.length > 0 || serverDeployTargets.length > 0;
const webDeployTargets = data.webDeployDistribution.filter((item) => item.name !== "none");
const serverDeployTargets = data.serverDeployDistribution.filter(
(item) => item.name !== "none",
);
const hasDeployTargets = webDeployTargets.length > 0 || serverDeployTargets.length > 0;

Comment on lines +65 to +77
contentClassName={
chunks.length > 1
? cn(
"grid gap-4",
columnGridClassName ??
(layout === "horizontal"
? columnCount >= 3
? "xl:grid-cols-2 2xl:grid-cols-3"
: "xl:grid-cols-2"
: "xl:grid-cols-2"),
)
: undefined
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

find apps/web/src/app \( -name "preference-chart-card.tsx" -o -name "chart-card.tsx" \) -type f

Repository: AmanVarshney01/create-better-t-stack

Length of output: 212


🏁 Script executed:

cat -n apps/web/src/app/\(home\)/analytics/_components/preference-chart-card.tsx | head -80

Repository: AmanVarshney01/create-better-t-stack

Length of output: 2786


🏁 Script executed:

cat -n apps/web/src/app/\(home\)/analytics/_components/chart-card.tsx

Repository: AmanVarshney01/create-better-t-stack

Length of output: 1758


🏁 Script executed:

find apps/web -name "utils.ts" -o -name "utils.js" | head -5

Repository: AmanVarshney01/create-better-t-stack

Length of output: 154


🏁 Script executed:

cat -n apps/web/src/lib/utils.ts | head -50

Repository: AmanVarshney01/create-better-t-stack

Length of output: 290


Clear the inherited vertical spacing when this wrapper becomes a grid.

ChartCard applies space-y-4 to its content container (line 38 of chart-card.tsx). When this container is switched to grid gap-4 in the multi-column case, both spacing mechanisms are active: space-y-4 adds direct margins to child elements while gap-4 applies grid spacing. This causes overlapping spacing that stagers the layout in the first row.

Suggested fix
       contentClassName={
         chunks.length > 1
           ? cn(
-              "grid gap-4",
+              "grid gap-4 space-y-0",
               columnGridClassName ??
                 (layout === "horizontal"
                   ? columnCount >= 3
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
contentClassName={
chunks.length > 1
? cn(
"grid gap-4",
columnGridClassName ??
(layout === "horizontal"
? columnCount >= 3
? "xl:grid-cols-2 2xl:grid-cols-3"
: "xl:grid-cols-2"
: "xl:grid-cols-2"),
)
: undefined
}
contentClassName={
chunks.length > 1
? cn(
"grid gap-4 space-y-0",
columnGridClassName ??
(layout === "horizontal"
? columnCount >= 3
? "xl:grid-cols-2 2xl:grid-cols-3"
: "xl:grid-cols-2"
: "xl:grid-cols-2"),
)
: undefined
}

@AmanVarshney01 AmanVarshney01 enabled auto-merge (squash) March 19, 2026 12:14
@AmanVarshney01 AmanVarshney01 merged commit 36bac5f into main Mar 19, 2026
3 checks passed
@AmanVarshney01 AmanVarshney01 deleted the aman/analytics-dashboard-polish branch March 19, 2026 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant