Feat/mos 0014#19
Merged
Merged
Conversation
- 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)
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.
No description provided.