feat(dashboard): fall back to nearest upcoming plan when none active#20
Merged
Merged
Conversation
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>
There was a problem hiding this comment.
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, andgetActivePlaninsrc/lib/plans.tsto resolve “current month or nearest upcoming” plans. - Updated
getDashboardStats()to use the new active-plan resolver and to expose anisUpcomingflag incurrentPlan. - 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
getNextUpcomingPlanandgetActivePlan(current-month-or-nearest-upcoming resolver) tosrc/lib/plans.tsTest plan
bun test src/lib/plans.test.ts src/lib/dashboard.test.ts(41 passing, including new coverage forgetNextUpcomingPlanandgetActivePlan)bun run lint --type-awarebun run astro checkbunx vue-tsc --noEmitbun run fallow(audit gate clean)🤖 Generated with Claude Code