From e93b9dfa5303ab119e7c40c83e49f04d7ee7d756 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Tue, 24 Mar 2026 19:10:20 +0100 Subject: [PATCH 1/2] Add git workflow rules to CLAUDE.md Never work on main directly; always switch back to development after merging to main. Co-Authored-By: Claude Sonnet 4.6 --- CLAUDE.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CLAUDE.md b/CLAUDE.md index c068d60..474907b 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -70,3 +70,9 @@ Dashboard has a chart toggle (Both / Portfolio / 1-Year BTC) using tab state in - `purchases`: id, amount_eur, price_eur, created_at, user_id (FK) Database persists via Docker volume at `/app/data/btc_portfolio.db`. + +## Git Workflow + +- **Never work directly on `main`.** All development happens on `development` (or a feature branch). +- After any merge/push to `main`, always switch back to `development` immediately. +- `main` is only touched to merge in completed work from `development`. From c1371e9c72584ba4d8615144dfcc0ff58f1e4187 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Tue, 24 Mar 2026 19:18:27 +0100 Subject: [PATCH 2/2] Extend portfolio chart to always show today's data point Previously the chart stopped at the last purchase date. Now a final point for today is appended so current portfolio value vs total invested is always visible. Co-Authored-By: Claude Sonnet 4.6 --- btc-portfolio/frontend/src/components/PortfolioChart.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/btc-portfolio/frontend/src/components/PortfolioChart.js b/btc-portfolio/frontend/src/components/PortfolioChart.js index a0e3e8d..f8a0ffd 100644 --- a/btc-portfolio/frontend/src/components/PortfolioChart.js +++ b/btc-portfolio/frontend/src/components/PortfolioChart.js @@ -42,6 +42,14 @@ export default function PortfolioChart({ purchases, stats }) { investedValues.push(parseFloat(cumInvested.toFixed(2))); }); + const todayLabel = new Date().toLocaleDateString(); + if (labels.length === 0 || labels[labels.length - 1] !== todayLabel) { + const currentVal = cumBtc * (stats?.current_price || 0); + labels.push(todayLabel); + portfolioValues.push(parseFloat(currentVal.toFixed(2))); + investedValues.push(parseFloat(cumInvested.toFixed(2))); + } + const currentPrice = stats?.current_price || 0; const breakEvenLine = labels.map(() => stats?.average_price || 0);