Skip to content

fix: prevent dashboard stats overflow#1889

Open
Judel777 wants to merge 1 commit intoCap-go:mainfrom
Judel777:fix/update-stats-overflow
Open

fix: prevent dashboard stats overflow#1889
Judel777 wants to merge 1 commit intoCap-go:mainfrom
Judel777:fix/update-stats-overflow

Conversation

@Judel777
Copy link
Copy Markdown

@Judel777 Judel777 commented Apr 2, 2026

Summary

Fixes the dashboard statistics card layout so large totals and legend items stay within the card on narrower screens.

Test plan

  • Not run locally in this environment
  • Verified the diff is scoped to the dashboard stats card components only

Screenshots

Checklist

  • My code follows the code style of this project and passes bun run lint:backend && bun run lint
  • My change requires a change to the documentation
  • I have updated the documentation (https://github.com/Cap-go/website) accordingly.
  • My change has adequate E2E test coverage.
  • I have tested my code manually, and I have provided steps how to reproduce my tests

Summary by CodeRabbit

  • Style
    • Enhanced responsive design for dashboard components
    • Optimized layout spacing and text sizing for improved visual consistency
    • Refined component alignment for better presentation across devices

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 2, 2026

📝 Walkthrough

Walkthrough

Dashboard components receive responsive layout refinements. ChartCard.vue transitions from fixed flex row to responsive column-to-row structure with improved text wrapping. UpdateStatsCard.vue adjusts spacing, text sizes, and icon dimensions to align with responsive breakpoints.

Changes

Cohort / File(s) Summary
Dashboard Responsive Styling
src/components/dashboard/ChartCard.vue, src/components/dashboard/UpdateStatsCard.vue
Responsive layout adjustments with Tailwind classes. ChartCard shifts header to column-to-row flow with improved text wrapping and alignment. UpdateStatsCard reduces spacing and typography sizing with responsive overrides at breakpoints.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 Hop, hop, the layouts bend,
From column flows to screens that mend,
Icons shrink, and text wraps tight,
Responsive magic, pixel-bright!
Dashboard dances, mobile and wide.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description follows the template structure with Summary, Test plan, and Screenshots sections; however, all Checklist items are marked as unchecked despite the changes being made. Verify and update the Checklist section: confirm whether lint checks pass, documentation changes are needed, E2E tests exist, and manual testing was performed with clear reproduction steps.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically summarizes the main change: preventing overflow issues in dashboard statistics components on narrower screens.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@codspeed-hq
Copy link
Copy Markdown
Contributor

codspeed-hq bot commented Apr 2, 2026

Merging this PR will not alter performance

✅ 28 untouched benchmarks


Comparing Judel777:fix/update-stats-overflow (3a18299) with main (ad8a88d)

Open in CodSpeed

Copy link
Copy Markdown
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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/components/dashboard/ChartCard.vue (1)

62-75: ⚠️ Potential issue | 🟠 Major

shrink-0 can reintroduce clipping for very large totals.

In the row layout, keeping the total container non-shrinkable can force clipping (especially with overflow-hidden on the header), which conflicts with the overflow-fix objective.

🐛 Proposed layout-safe diff
-      <div v-if="total !== undefined" class="flex flex-col items-start min-w-0 text-left sm:items-end sm:text-right shrink-0">
+      <div v-if="total !== undefined" class="flex flex-col items-start min-w-0 text-left sm:items-end sm:text-right sm:max-w-[50%]">
...
-        <div class="max-w-full text-2xl font-bold break-words dark:text-white text-slate-600 sm:text-3xl">
+        <div class="w-full max-w-full text-2xl font-bold break-all dark:text-white text-slate-600 sm:text-3xl">
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/dashboard/ChartCard.vue` around lines 62 - 75, The outer total
container currently forces no shrinking via the "shrink-0" utility on the div
with v-if="total !== undefined", which can cause clipping for very large totals;
remove "shrink-0" (or replace it with a neutral/allowing flex-shrink class such
as keeping only "min-w-0") so the total can shrink within the header layout and
avoid overflow issues while preserving existing classes like "min-w-0" and the
total rendering block.
🧹 Nitpick comments (1)
src/components/dashboard/UpdateStatsCard.vue (1)

392-413: Replace inline legend dot colors with utility classes.

Use Tailwind utility/arbitrary value classes instead of inline style attributes for the status dots.

♻️ Suggested guideline-aligned diff
-            <div class="w-3 h-3 rounded-full" style="background-color: hsl(210, 65%, 55%)" />
+            <div class="w-3 h-3 rounded-full bg-[hsl(210,65%,55%)]" />
...
-            <div class="w-3 h-3 rounded-full" style="background-color: hsl(135, 55%, 50%)" />
+            <div class="w-3 h-3 rounded-full bg-[hsl(135,55%,50%)]" />
...
-            <div class="w-3 h-3 rounded-full" style="background-color: hsl(0, 50%, 60%)" />
+            <div class="w-3 h-3 rounded-full bg-[hsl(0,50%,60%)]" />

As per coding guidelines: "Avoid custom CSS in Vue components; prefer utility composition and DaisyUI theming with color palette from src/styles/style.css."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/dashboard/UpdateStatsCard.vue` around lines 392 - 413, Replace
the inline style="background-color: hsl(...)" on the small legend dot elements
(the divs with class "w-3 h-3 rounded-full") by using Tailwind utility classes
or arbitrary value utilities (e.g., bg-sky-500 / bg-green-500 / bg-red-400 or
bg-[hsl(...)]), so update each dot div in UpdateStatsCard.vue to remove the
style attribute and add the appropriate bg-* class that maps to your design
tokens in src/styles/style.css / DaisyUI palette; keep the existing structure
(the sibling div using actionDisplayNames and
effectiveTotalRequested/effectiveTotalInstalled) intact.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@src/components/dashboard/ChartCard.vue`:
- Around line 62-75: The outer total container currently forces no shrinking via
the "shrink-0" utility on the div with v-if="total !== undefined", which can
cause clipping for very large totals; remove "shrink-0" (or replace it with a
neutral/allowing flex-shrink class such as keeping only "min-w-0") so the total
can shrink within the header layout and avoid overflow issues while preserving
existing classes like "min-w-0" and the total rendering block.

---

Nitpick comments:
In `@src/components/dashboard/UpdateStatsCard.vue`:
- Around line 392-413: Replace the inline style="background-color: hsl(...)" on
the small legend dot elements (the divs with class "w-3 h-3 rounded-full") by
using Tailwind utility classes or arbitrary value utilities (e.g., bg-sky-500 /
bg-green-500 / bg-red-400 or bg-[hsl(...)]), so update each dot div in
UpdateStatsCard.vue to remove the style attribute and add the appropriate bg-*
class that maps to your design tokens in src/styles/style.css / DaisyUI palette;
keep the existing structure (the sibling div using actionDisplayNames and
effectiveTotalRequested/effectiveTotalInstalled) intact.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2be4a589-cf51-4970-bc7a-ac8fa9a385b3

📥 Commits

Reviewing files that changed from the base of the PR and between ad8a88d and 3a18299.

📒 Files selected for processing (2)
  • src/components/dashboard/ChartCard.vue
  • src/components/dashboard/UpdateStatsCard.vue

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 2, 2026

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