9.3 KiB
phase, plan, type, wave, depends_on, files_modified, autonomous, requirements, must_haves
| phase | plan | type | wave | depends_on | files_modified | autonomous | requirements | must_haves | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 02-dashboard-charts-and-layout | 01 | execute | 1 |
|
true |
|
|
Purpose: Provides the URL-based month selection hook, the MonthNavigator UI (prev/next arrows + month dropdown), and a shared ChartEmptyState placeholder. These are foundational pieces consumed by all chart components and the dashboard layout in Plan 03.
Output: Three new files (useMonthParam hook, MonthNavigator component, ChartEmptyState component) plus updated i18n files with new translation keys.
<execution_context> @/home/jlmak/.claude/get-shit-done/workflows/execute-plan.md @/home/jlmak/.claude/get-shit-done/templates/summary.md </execution_context>
@.planning/PROJECT.md @.planning/ROADMAP.md @.planning/STATE.md @.planning/phases/02-dashboard-charts-and-layout/02-CONTEXT.md @.planning/phases/02-dashboard-charts-and-layout/02-RESEARCH.mdFrom src/lib/types.ts:
export type CategoryType = "income" | "bill" | "variable_expense" | "debt" | "saving" | "investment"
export interface Budget {
id: string; user_id: string; start_date: string; end_date: string;
currency: string; carryover_amount: number; created_at: string; updated_at: string;
}
From src/hooks/useBudgets.ts:
export function useBudgets(): {
budgets: Budget[]; loading: boolean;
getBudget: (id: string) => ReturnType<typeof useBudgetDetail>;
createBudget: UseMutationResult; generateFromTemplate: UseMutationResult;
updateItem: UseMutationResult; createItem: UseMutationResult;
deleteItem: UseMutationResult; deleteBudget: UseMutationResult;
}
From src/components/shared/PageShell.tsx:
interface PageShellProps {
title: string; description?: string; action?: React.ReactNode; children: React.ReactNode;
}
export function PageShell({ title, description, action, children }: PageShellProps): JSX.Element
From src/components/ui/chart.tsx:
export type ChartConfig = { [k in string]: { label?: React.ReactNode; icon?: React.ComponentType } & ({ color?: string; theme?: never } | { color?: never; theme: Record<"light" | "dark", string> }) }
MonthNavigator component (src/components/dashboard/MonthNavigator.tsx):
- Accept props:
availableMonths: string[](array ofYYYY-MMstrings that have budgets),t: (key: string) => string - Import
useMonthParamfrom hooks - Import
ChevronLeft,ChevronRightfromlucide-react - Import
Buttonfrom@/components/ui/button - Import
Select,SelectContent,SelectItem,SelectTrigger,SelectValuefrom@/components/ui/select - Layout: horizontal flex row with left arrow button, month selector (Select dropdown), right arrow button
- Left arrow:
Buttonvariant="ghost" size="icon" withChevronLeft, onClick callsnavigateMonth(-1) - Right arrow:
Buttonvariant="ghost" size="icon" withChevronRight, onClick callsnavigateMonth(1) - Center:
Selectcomponent whose value is the currentmonthfrom hook.onValueChangecallssetMonth. SelectTrigger shows formatted month name (useDateto formatYYYY-MMinto locale-aware month+year display, e.g., "March 2026") - SelectItems: map over
availableMonthsprop, displaying each as formatted month+year - Arrow buttons allow navigating beyond existing budgets (per user decision) -- they just call navigateMonth regardless
- Dropdown only lists months that have budgets (per user decision)
- Keep presentational -- accept
t()as prop (follows Phase 1 pattern) - Export as named export
MonthNavigatorcd /home/jlmak/Projects/jlmak/SimpleFinanceDash && bun run build useMonthParam hook reads/writes month URL param with fallback to current month. MonthNavigator renders prev/next arrows and a dropdown of available months. Build passes with no type errors.
i18n keys (add to both en.json and de.json):
Add new keys under the existing "dashboard" object. Do NOT remove any existing keys. Add:
"monthNav": "Month",
"noData": "No data to display",
"expenseDonut": "Expense Breakdown",
"incomeChart": "Income: Budget vs Actual",
"spendChart": "Spending by Category",
"budgeted": "Budgeted",
"actual": "Actual",
"noBudgetForMonth": "No budget for this month",
"createBudget": "Create Budget",
"generateFromTemplate": "Generate from Template"
German translations:
"monthNav": "Monat",
"noData": "Keine Daten vorhanden",
"expenseDonut": "Ausgabenverteilung",
"incomeChart": "Einkommen: Budget vs. Ist",
"spendChart": "Ausgaben nach Kategorie",
"budgeted": "Budgetiert",
"actual": "Tatsaechlich",
"noBudgetForMonth": "Kein Budget fuer diesen Monat",
"createBudget": "Budget erstellen",
"generateFromTemplate": "Aus Vorlage generieren"
<success_criteria>
- useMonthParam reads
?month=YYYY-MMfrom URL, falls back to current month, provides setMonth and navigateMonth - MonthNavigator shows prev/next arrows and a month dropdown
- ChartEmptyState renders a visually muted placeholder for empty charts
- All new i18n keys present in en.json and de.json
bun run buildpasses </success_criteria>