Compare commits

..

3 Commits

Author SHA1 Message Date
Jonathan aedc6a8a17 Merge branch 'development' 2026-03-24 19:18:56 +01:00
Jonathan c1371e9c72 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 <noreply@anthropic.com>
2026-03-24 19:18:27 +01:00
Jonathan e93b9dfa53 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 <noreply@anthropic.com>
2026-03-24 19:10:20 +01:00
2 changed files with 14 additions and 0 deletions
+6
View File
@@ -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`.
@@ -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);