Skip to content

feat(share-pnl): redesign card and add field toggles#158

Merged
kostovster merged 1 commit into
mainfrom
feat/share-pnl-redesign
May 8, 2026
Merged

feat(share-pnl): redesign card and add field toggles#158
kostovster merged 1 commit into
mainfrom
feat/share-pnl-redesign

Conversation

@kostovster
Copy link
Copy Markdown
Member

Summary

Redesigns the Share PnL dialog so text now sits directly on the cover illustration rather than inside a white block. Adds three optional fields the user can include or omit: PnL Amount, Price (Entry + Mark), Position Size — all default on.

Changes

  • Removed the white card overlay drawn by canvas plus the matching divider lines. Cover 1's SVG had the same shape baked in, so cleared it from the asset too — otherwise the outline would have remained after the canvas-side card was removed.
  • Per-cover text palette so text stays legible on each illustration. Cover 2 uses light text on its dark navy backdrop; covers 1, 3, 4 keep the existing dark navy text.
  • New Checkbox row in the dialog body for the three field toggles, wired into the canvas via a reactive watch.
  • scheduleRender now chains renders per canvas through a WeakMap. Without it, a toggle flip during an in-flight image.onload could let stale paints from a prior render land on a newer frame, leaving ghost rows visible after toggling a field off.
  • Four new keys in backend/config/locales/en.json: optional-info-share, pnl-amount, entry-price, mark-price. The runtime translation pipeline propagates the rest.

Verification

  • npm run lint clean
  • npm run format:check clean
  • npm run build clean
  • npm test 760/760 passing

Follow-ups

  • Add the four new keys with English values to /opt/deploy/builds/{app,app-dev}/config/locales/en.json on the frontends server (rclone sync excludes config/), then restart webapp-prod and webapp-dev so the in-memory cache picks them up.

Drop the white card overlay on the Share PnL dialog. Text now sits
directly on each cover illustration, with a per-cover palette so it
stays legible (cover 2 uses light text on its dark navy backdrop;
covers 1, 3, 4 keep dark navy text).

Add three optional fields the user can include or omit before sharing:
PnL Amount (absolute USD next to the percent), Price (Entry + Mark
stacked), Position Size. All default on.

Cover 1's SVG had the same white card and divider lines baked in, so
clear them from the asset too — otherwise the outline would remain
after the canvas-side card was removed.

Renders are now serialized per canvas through a WeakMap promise chain.
Without it, a toggle flip during an in-flight image.onload could let
stale paints from a prior render land on a newer frame, leaving ghost
rows visible after toggling a field off.

Four new English keys live in backend/config/locales/en.json. The
runtime translation pipeline propagates the rest.
@kostovster kostovster merged commit 293374f into main May 8, 2026
2 checks passed
@kostovster kostovster deleted the feat/share-pnl-redesign branch May 8, 2026 12:45
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