Skip to content

Feat/mos 0014#19

Merged
Lidizz merged 3 commits into
mainfrom
feat/MOS-0014
Mar 1, 2026
Merged

Feat/mos 0014#19
Lidizz merged 3 commits into
mainfrom
feat/MOS-0014

Conversation

@Lidizz
Copy link
Copy Markdown
Owner

@Lidizz Lidizz commented Mar 1, 2026

No description provided.

Lidizz added 3 commits March 1, 2026 00:58
- generatePortfolioCSV(): builds CSV from SimulationResponse
  - Summary section: total invested, current value, gain, return%, CAGR
  - Holdings section: per-holding breakdown with all metrics
  - Timeline section: date, portfolio value, S&P 500 benchmark,
    per-holding values (when available)
- downloadCSV(): triggers browser download from string content
- buildExportFilename(): generates 'moshimo-simulation-YYYY-MM-DD.csv'
- Proper CSV escaping (commas, quotes, newlines)
- UTF-8 BOM prefix for Excel compatibility
- tsc clean
- Add 'Export CSV' button with Download icon (lucide-react) in a
  results toolbar row, aligned right, below the metrics cards
- On click: generates CSV from current results and triggers download
- Button styled as subtle outline matching the design system
- Hover accent treatment, 0.97 scale on active
- 107 tests passing, tsc clean
- 14 unit tests for generatePortfolioCSV:
  - UTF-8 BOM prefix, CRLF line endings
  - Summary section with all metrics
  - Holdings section with all columns
  - Timeline section with portfolio values
  - Benchmark column included when present
  - Per-holding timeline columns when present
  - Multiple holdings in holdings section
  - CSV escaping for commas and double quotes
  - Empty holdings handled gracefully
  - Results without benchmark/holdingsTimelines
- 2 tests for buildExportFilename (date format, .csv extension)
- 1 component test for export button rendering
- Total: 122 tests passing (was 107)
@Lidizz Lidizz merged commit c28d6d1 into main Mar 1, 2026
2 checks passed
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.

1 participant