Skip to content

fix(frontend): make ticker logos exchange-aware (#623)#734

Open
AtomicTrxn wants to merge 2 commits intoafadil:mainfrom
AtomicTrxn:codex/fix-623-exchange-aware-logos
Open

fix(frontend): make ticker logos exchange-aware (#623)#734
AtomicTrxn wants to merge 2 commits intoafadil:mainfrom
AtomicTrxn:codex/fix-623-exchange-aware-logos

Conversation

@AtomicTrxn
Copy link
Contributor

Description

Root cause:

  • Asset avatars currently resolve logos with a simple fullSymbol -> baseSymbol lookup against /ticker-logos/*.png.
  • For ambiguous tickers like DTE, that means a German/Xetra asset with symbol DTE falls back to DTE.png, which is the US listing logo.
  • The rest of the app already carries exchange context (exchangeMic), but the logo lookup path was ignoring it.

Lookup method in this PR:

  • If the symbol is already exchange-qualified, keep it unchanged.
  • If the symbol is unsuffixed and the view has an exchangeMic, derive the Yahoo-style suffix from that MIC (for example XETR -> .DE, XFRA -> .F, XLON -> .L) and try the exchange-qualified logo first.
  • Only allow the unsuffixed base-symbol fallback when the exchange is unknown or canonically unsuffixed (US-style cases).
  • If a non-US exchange-qualified logo asset is missing, fall back to initials instead of showing an incorrect logo.

Fix summary:

  • Made TickerAvatar exchange-aware in both frontend/shared components.
  • Propagated exchangeMic through asset, activity, holdings, dashboard, and allocation avatar call sites.
  • Added optional exchangeMic to holdings Instrument and allocation HoldingSummary payloads and populated them in core services.
  • Added regressions for the avatar lookup, UI wiring, and core payload propagation.

User-visible tradeoff:

  • Some non-US assets may now show initials instead of borrowing an incorrect unsuffixed US logo when no exchange-specific logo asset exists. This is intentional to prefer no logo over a wrong-company logo.

Validation:

  • pnpm --filter frontend test -- ticker-avatar
  • pnpm --filter frontend test -- top-holdings
  • cargo test -p wealthfolio-core exchange_mic
  • cargo test -p wealthfolio-core portfolio::holdings
  • cargo test -p wealthfolio-core allocation_service
  • pnpm --filter frontend lint (passes with existing repo warning baseline)
  • cargo fmt --all -- --check
  • pnpm exec prettier --check ... on all touched frontend/package files
  • pnpm --filter frontend type-check still fails on pre-existing unrelated issues in apps/frontend/src/addons/type-bridge.ts and apps/frontend/src/pages/holdings/components/alternative-holdings-table.tsx

Fixes #623

Checklist

By submitting this PR, I agree to the
CLA.

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.

[Bug] Incorrect Logo for DTE (Deutsche Telekom) - Defaults to DTE Energy

1 participant