Skip to content

fix: redesign financial dashboard with Evil Charts - #99

Merged
legions-developer merged 2 commits into
mainfrom
gurbinder/dashboard-design
Oct 4, 2026
Merged

legions-developer merged 2 commits into
mainfrom
gurbinder/dashboard-design

Conversation

@legions-developer

Copy link
Copy Markdown
Owner

The financial dashboard used oversized summary cards, a tall custom SVG chart, and a spacious client table that made the figures harder to scan. Redesign it using the compact headers, grouped metrics, subtle borders, and table density observed in Cloudflare's account analytics and Workers dashboard, while retaining Invoicely's purple theme and custom dashboard icon.

Use the official Evil Charts composed-chart registry components for billed bars and a collected line. The chart has a fixed height, exact decimal totals and tooltips, keyboard-accessible values, and a monthly figures disclosure. Add touch-accessible financial help, responsive controls, and loading/empty states. All amounts remain separated by currency and existing financial aggregation is unchanged.

Database migrations: 0. No tests added.

Validation:

  • Production Next.js build, including TypeScript checks: passed.
  • Full web ESLint and diff whitespace checks: passed.
  • Browser checks: populated and empty states, light/dark themes, 390px mobile layout, currency switching, 6/12-month periods, refunded-only currency, help popovers, and keyboard chart tooltips. Temporary preview fixtures removed.

@coderabbitai

coderabbitai Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ff1823d9-aecf-45a3-98eb-2d8e983b79b0
📥 Commits

Reviewing files that changed from the base of the PR and between e88d6c0 and 4a13414.

📒 Files selected for processing (1)
  • apps/web/src/app/(dashboard)/dashboard/dashboard-view.client.tsx
📝 Walkthrough

Walkthrough

The dashboard now has a client-side view for its loading, empty, error, and populated states. Monthly trends use a responsive Recharts chart. The changes also add reusable chart components, brush controls, and dashboard presentation components.

Changes

Dashboard and charting

Layer / File(s) Summary
Chart configuration and presentation primitives
apps/web/package.json, apps/web/src/components/evilcharts/*
Adds Recharts dependencies and shared chart configuration, styling, background, dot, legend, and tooltip components. Adds the chart source README and MIT license.
Composed chart and brush
apps/web/src/components/evilcharts/charts/*, apps/web/src/components/evilcharts/ui/recharts-brush.tsx
Adds a compound chart with configurable bars, lines, axes, selection, animations, and loading states. The brush supports draggable ranges, previews, and deferred data slicing.
Dashboard view and panels
apps/web/src/app/(dashboard)/dashboard/dashboard.client.tsx, apps/web/src/app/(dashboard)/dashboard/dashboard-view.client.tsx, apps/web/src/app/(dashboard)/dashboard/dashboard-panels.tsx, apps/web/src/components/ui/empty.tsx
Moves dashboard rendering into DashboardView, which handles loading, empty, error, and populated states. Updates the overview and top-client panels and adds shared empty-state components.
Monthly trend visualization
apps/web/src/app/(dashboard)/dashboard/monthly-trend.client.tsx
Replaces the SVG chart with responsive billed bars and a collected line. Adds exact-value tooltips, a monthly figures table, and handling for negative and all-zero values.

Estimated code review effort: 4 (Complex) | ~60 minutes

Change: Feature

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 48.89% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 45 functions across 12 files. (3 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: redesigning the financial dashboard with Evil Charts.
Description check ✅ Passed The description explains the dashboard redesign, chart changes, added states, and validation. It is directly related to the changeset.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 48.89% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 45 functions across 12 files. (3 skipped: 3 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview URL: https://gurbinder-dashboard-design.preview.invoicely.gg (commit 4a13414)

This URL reflects your latest Preview deployment

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://8c5706d3.preview.invoicely.gg 4a13414 2026-10-04T12:59:31.163Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://56128ec8.preview.invoicely.gg e88d6c0 2026-10-04T12:55:10.190Z Visit the dashboard ↗

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ce43a507-09ba-445b-9a2f-6895f4701f68
📥 Commits

Reviewing files that changed from the base of the PR and between 71996e7 and e88d6c0.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (15)
  • apps/web/package.json
  • apps/web/src/app/(dashboard)/dashboard/dashboard-panels.tsx
  • apps/web/src/app/(dashboard)/dashboard/dashboard-view.client.tsx
  • apps/web/src/app/(dashboard)/dashboard/dashboard.client.tsx
  • apps/web/src/app/(dashboard)/dashboard/monthly-trend.client.tsx
  • apps/web/src/components/evilcharts/LICENSE
  • apps/web/src/components/evilcharts/README.md
  • apps/web/src/components/evilcharts/charts/recharts-composed-chart.tsx
  • apps/web/src/components/evilcharts/ui/recharts-background.tsx
  • apps/web/src/components/evilcharts/ui/recharts-brush.tsx
  • apps/web/src/components/evilcharts/ui/recharts-chart.tsx
  • apps/web/src/components/evilcharts/ui/recharts-dot.tsx
  • apps/web/src/components/evilcharts/ui/recharts-legend.tsx
  • apps/web/src/components/evilcharts/ui/recharts-tooltip.tsx
  • apps/web/src/components/ui/empty.tsx

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

}
const descriptionId = useId();
const values = data.monthly.flatMap((month) => [new Money(month.billed), new Money(month.collected)]);
const magnitude = Money.max(1, ...values.map((value) => value.abs()));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Scale the chart by a power of ten so Y-axis ticks show round amounts.

magnitude is the largest exact absolute amount. After normalization, the largest value is always exactly 1 or -1, so the domain is [0, 1] or [-1, 1] in normalized units. With tickCount={5}, Recharts places ticks at 0, 0.25, 0.5, 0.75 and 1. compactAmount(magnitude.times(value)) then maps those ticks to fractions of an arbitrary total. Example: a maximum of 12,345.67 gives the labels "3.1K", "6.2K", "9.3K" and "12.3K". These labels do not show round amounts, so the axis is harder to read.

Normalize by the next power of ten instead. The normalized maximum then falls between 0.1 and 1. Recharts' rounded ticks in that range map back to round currency amounts. Tooltips, totals and the table keep using the exact strings.

🐛 Proposed fix
-  const magnitude = Money.max(1, ...values.map((value) => value.abs()));
+  const maxAbs = Money.max(0, ...values.map((value) => value.abs()));
+  // Power-of-ten scale keeps normalized ticks aligned with round currency amounts.
+  const magnitude = maxAbs.lte(1) ? new Money(1) : new Money(10).pow(maxAbs.log(10).ceil());
📝 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 magnitude = Money.max(1, ...values.map((value) => value.abs()));
const maxAbs = Money.max(0, ...values.map((value) => value.abs()));
// Power-of-ten scale keeps normalized ticks aligned with round currency amounts.
const magnitude = maxAbs.lte(1) ? new Money(1) : new Money(10).pow(maxAbs.log(10).ceil());

@github-actions

github-actions Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Preview database and deployment

Commit: 4a13414be82c

Migration command and Cloudflare build/deploy completed successfully. There may have been no pending migrations.

Cloudflare build logs

Migration status is inferred from the required migration hook and the overall Cloudflare result. Build logs contain the individual migration output.

@legions-developer
legions-developer merged commit 20ec36a into main Oct 4, 2026
3 of 4 checks passed
@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown

Production database and deployment

Commit: 20ec36ad3b0b

Migration command and Cloudflare build/deploy completed successfully. There may have been no pending migrations.

Cloudflare build logs

Migration status is inferred from the required migration hook and the overall Cloudflare result. Build logs contain the individual migration output.

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