Skip to content

Fix/mos 0008#13

Merged
Lidizz merged 4 commits into
mainfrom
fix/MOS-0008
Feb 27, 2026
Merged

Fix/mos 0008#13
Lidizz merged 4 commits into
mainfrom
fix/MOS-0008

Conversation

@Lidizz
Copy link
Copy Markdown
Owner

@Lidizz Lidizz commented Feb 27, 2026

No description provided.

New hook: useCountUp(target, duration)  animates numbers from 0 to
target over 800ms using requestAnimationFrame with ease-out cubic easing.
Respects prefers-reduced-motion for accessibility.

Applied to all 5 metric cards in SimulationResults: Total Invested,
Current Value, Absolute Gain, Percent Return, and CAGR.

Holdings table values remain static (no animation) for readability.

Test setup: added matchMedia mock defaulting to prefers-reduced-motion
so useCountUp resolves immediately in jsdom  all 90 tests pass.
Tooltip fix: in individual view, the crosshair now shows ALL holding
values at the cursor position with colored dots matching the legend,
instead of only showing the first series value.

Tooltip redesign: entries display as symbol + value rows with color
indicators, separated from the date by a subtle border. Works for
both combined (single 'Portfolio' entry) and individual (per-holding).

Watermark: added subtle 'Moshimo' text centered in chart area at 4%
opacity, pointer-events: none so it doesn't interfere with interaction.
Holdings table converts to card layout at 768px breakpoint:
- Table headers hidden, each row becomes a bordered card
- data-label attributes on <td> elements render as left-aligned
  labels via CSS ::before pseudo-elements
- Asset name spans full width with bottom border separator

Sticky summary bar: shows Current Value and Return % at the top
of the viewport when scrolling on mobile (<768px). Hidden on desktop.

Additional 640px breakpoint: full-width holdings cards (no border
radius, flush to edges) for narrow phone screens.

Updated test to scope percentage assertion with within() to avoid
duplicate match from the new mobile summary element.
New component: AllocationChart  pure SVG donut chart showing each
holding's percentage of total portfolio value. No external dependencies.

Features:
- Color-coded ring segments matching PortfolioChart holding colors
- Center text showing total portfolio value
- Legend with symbol, percentage, and dollar value per holding
- Only rendered when there are 2+ holdings
- Responsive: stacks vertically on mobile (<640px)

Positioned above the holdings table in SimulationResults for a visual
overview before the detailed breakdown.

Updated test to scope holdings row assertions with within() to avoid
duplicate matches from the allocation chart legend.
@Lidizz Lidizz merged commit 50ddd21 into main Feb 27, 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