Skip to content

feat(share-pnl): add leverage to meta row and canvas-rendered logo#160

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

feat(share-pnl): add leverage to meta row and canvas-rendered logo#160
kostovster merged 1 commit into
mainfrom
feat/share-pnl-leverage-logo

Conversation

@kostovster
Copy link
Copy Markdown
Member

Summary

Third polish iteration for the Share PnL dialog. Drops the asset coin icon from the meta row in favor of a leverage-aware single-line layout, collapses PnL colors to a single brand pair across all four covers, and starts canvas-rendering the Nolus logo + a nolus.io footer.

Changes

  • Meta row: drops the asset icon; new format LONG x2.5 | BTC (SHORT x2.5 | BTC for shorts). Direction in caps colored by position direction, leverage as xN.N from (downPayment + totalDebt) / downPayment, separator | muted, ticker in primary text color. Leverage segment omits if downPayment is non-positive.
  • PnL colors consolidated: per-cover pnlPositive / pnlNegative from PR-A is removed. Two module-level constants PNL_POSITIVE = #1AB171 and PNL_NEGATIVE = #AB1F3B apply to every cover. Visual consistency wins over the orange-cover contrast trade-off; if that cover ends up unreadable in practice it gets dropped from the options rather than forking the palette.
  • Canvas-rendered logo: setLogo paints logo-light.svg on the dark cover and logo-dark.svg on the three light covers, top-left at 252×64. Awaited inside renderCard so it slots into the existing per-canvas WeakMap chain. Sits on top of the baked-in logo for now — this is a preview pass to validate placement before the cover assets are re-exported without the logo.
  • nolus.io footer: small muted text below the timestamp at bottom-left, matching the brand placement on Nolus marketing creatives.

Verification

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

Follow-ups

  • Cover assets re-exported without the baked-in Nolus logo — once those land, the canvas-rendered logo no longer overlaps and we can fine-tune position / size with a single source of truth.
  • If the orange cover's brand-red contrast turns out unreadable on staging, drop it from the cover options.

Drop the asset coin icon from the meta row and replace the row with a
single-line, synchronous text layout: direction in caps colored by
position direction, leverage as xN.N, separator, ticker. Format reads
LONG x2.5 | BTC or SHORT x2.5 | BTC and aligns with the convention used
by Binance / MEXC / Hyperliquid share cards.

Effective leverage is computed from (downPayment + totalDebt) /
downPayment off LeaseDisplayData. The segment is omitted when
downPayment is non-positive — defensive only; should not happen in
practice. Slight upward drift from accrued interest is documented in a
code comment and accepted for the lifetime of a share card.

Collapse per-cover PnL colors to a single brand pair so the green and
red read consistently across the share library: PNL_POSITIVE #1AB171
and PNL_NEGATIVE #AB1F3B. The orange cover may show low contrast on
the brand red — known trade-off; the cover gets dropped from the
options if it doesn't read in practice rather than forking colors per
illustration.

Canvas-render the Nolus logo top-left at 252x64. Light variant on the
dark navy cover, dark variant on the three light covers. Slots into
the existing per-canvas render chain (awaited inside renderCard before
the meta row paints). Sits on top of the baked-in logo on the current
cover assets — preview pass before the assets are re-exported without
the logo.

Add nolus.io as a small muted footer below the timestamp. Matches the
brand placement pattern used on Nolus marketing creatives.
@kostovster kostovster merged commit 1c40946 into main May 8, 2026
2 checks passed
@kostovster kostovster deleted the feat/share-pnl-leverage-logo branch May 8, 2026 15:10
kostovster added a commit that referenced this pull request May 8, 2026
The light grey SVG cover (share-image-1.svg) had a different design
language from the other three and was visually inconsistent in the
share library. Drop it from the cover options entirely.

Replace the remaining three PNG covers with re-exported versions that
no longer bake in the Nolus logo. The canvas-rendered logo from #160
now stands alone instead of overlapping a baked-in twin.

images and palettes arrays shrink from 4 to 3 entries in lockstep so
their indices stay aligned. imageIndex defaults to 0, which now points
at the dark navy cover (was the deleted SVG).
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