feat(share-pnl): redesign card and add field toggles#158
Merged
Conversation
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.
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.
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
Checkboxrow in the dialog body for the three field toggles, wired into the canvas via a reactivewatch.scheduleRendernow chains renders per canvas through aWeakMap. Without it, a toggle flip during an in-flightimage.onloadcould let stale paints from a prior render land on a newer frame, leaving ghost rows visible after toggling a field off.backend/config/locales/en.json:optional-info-share,pnl-amount,entry-price,mark-price. The runtime translation pipeline propagates the rest.Verification
npm run lintcleannpm run format:checkcleannpm run buildcleannpm test760/760 passingFollow-ups
/opt/deploy/builds/{app,app-dev}/config/locales/en.jsonon the frontends server (rclone sync excludesconfig/), then restartwebapp-prodandwebapp-devso the in-memory cache picks them up.