From beff1dd1bfb211a314037cef878aae7e276d920e Mon Sep 17 00:00:00 2001 From: kostovster Date: Fri, 8 May 2026 15:35:57 +0300 Subject: [PATCH] feat(share-pnl): redesign card and add field toggles MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- backend/config/locales/en.json | 4 + src/assets/icons/share-image-1.svg | 2 +- .../single-lease/SharePnLDialog.vue | 466 +++++++++--------- 3 files changed, 237 insertions(+), 235 deletions(-) diff --git a/backend/config/locales/en.json b/backend/config/locales/en.json index c4ea64a9b..8c5a7097d 100644 --- a/backend/config/locales/en.json +++ b/backend/config/locales/en.json @@ -143,6 +143,10 @@ "download": "Download", "timestamp": "Timestamp", "price-per-symbol": "Price per {symbol}", + "optional-info-share": "Optional information to share", + "pnl-amount": "PnL Amount", + "entry-price": "Entry Price", + "mark-price": "Mark Price", "supply-limit-error": "The current deposit limit is {amount}", "lease-min-amount": "The position past this close should worth at least {amount} {symbol}", "partial-close-action": "Close {amount} {ticker} from position {contract}", diff --git a/src/assets/icons/share-image-1.svg b/src/assets/icons/share-image-1.svg index 7a9affbfb..30ef137b1 100644 --- a/src/assets/icons/share-image-1.svg +++ b/src/assets/icons/share-image-1.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/modules/leases/components/single-lease/SharePnLDialog.vue b/src/modules/leases/components/single-lease/SharePnLDialog.vue index 53fea16e8..08ce5eaa6 100644 --- a/src/modules/leases/components/single-lease/SharePnLDialog.vue +++ b/src/modules/leases/components/single-lease/SharePnLDialog.vue @@ -31,6 +31,29 @@ ref="canvas" > +
+ {{ $t("message.optional-info-share") }} +
+ + + +
+

@@ -57,8 +80,8 @@