Skip to content

feat(dashboard): fall back to nearest upcoming plan when none active#20

Merged
florivdg merged 1 commit into
mainfrom
feat/dashboard-upcoming-plan-fallback
Jun 30, 2026
Merged

feat(dashboard): fall back to nearest upcoming plan when none active#20
florivdg merged 1 commit into
mainfrom
feat/dashboard-upcoming-plan-fallback

Conversation

@florivdg

Copy link
Copy Markdown
Owner

Summary

  • Dashboard now falls back to the nearest upcoming plan when no plan exists for the current month, instead of showing the empty state
  • Added getNextUpcomingPlan and getActivePlan (current-month-or-nearest-upcoming resolver) to src/lib/plans.ts
  • Balance card shows "Nächster Saldo" + a "Bevorstehend" badge, and the dashboard shows a notice banner, when displaying an upcoming plan instead of the current month's

Test plan

  • bun test src/lib/plans.test.ts src/lib/dashboard.test.ts (41 passing, including new coverage for getNextUpcomingPlan and getActivePlan)
  • bun run lint --type-aware
  • bun run astro check
  • bunx vue-tsc --noEmit
  • bun run fallow (audit gate clean)
  • Manual check in browser: confirm badge/banner render when no current-month plan exists but a future plan does

🤖 Generated with Claude Code

Shows the nearest future plan with an upcoming indicator instead of the
empty state, so users who have planned ahead still see useful data when
no plan exists for the current month yet.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 30, 2026 20:34

Copilot AI 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.

Pull request overview

This PR improves the dashboard UX by showing the nearest upcoming plan when there is no plan for the current month, instead of falling back to the empty state. It introduces shared plan-resolution helpers and surfaces the “upcoming” state in both backend stats and the dashboard UI.

Changes:

  • Added formatYearMonth, getNextUpcomingPlan, and getActivePlan in src/lib/plans.ts to resolve “current month or nearest upcoming” plans.
  • Updated getDashboardStats() to use the new active-plan resolver and to expose an isUpcoming flag in currentPlan.
  • Updated dashboard components to render an “upcoming plan” banner and show “Nächster Saldo” with a “Bevorstehend” badge.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/lib/plans.ts Adds month formatting + plan selection helpers (current vs upcoming).
src/lib/plans.test.ts Adds unit tests for the new plan selection helpers.
src/lib/dashboard.ts Refactors dashboard stats building to support upcoming-plan fallback + isUpcoming.
src/lib/dashboard.test.ts Adds coverage for upcoming-plan fallback behavior and isUpcoming flag.
src/components/dashboard/DashboardContent.vue Renders an upcoming-plan notice banner and passes isUpcoming to the balance card.
src/components/dashboard/DashboardBalanceCard.vue Shows “Nächster Saldo” + “Bevorstehend” badge when plan is upcoming.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@florivdg florivdg merged commit a4055c1 into main Jun 30, 2026
1 check passed
@florivdg florivdg deleted the feat/dashboard-upcoming-plan-fallback branch June 30, 2026 20:41
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.

2 participants