refactor(OrderbookDepth): hoist icon components to module scope#33
Open
wmagev wants to merge 1 commit intoentrius:testfrom
Open
refactor(OrderbookDepth): hoist icon components to module scope#33wmagev wants to merge 1 commit intoentrius:testfrom
wmagev wants to merge 1 commit intoentrius:testfrom
Conversation
BtcIcon, TaoIcon, and AssetIcon were declared inside the OrderbookDepth render body, which created new component types on every parent render and caused React to unmount and remount the SVG subtrees. Hoist all three to module scope. Each component calls useTheme() internally instead of closing over the parent's theme object. No prop threading, no React.memo. Also inline the two remaining BTC_COLOR / TAO_COLOR aliases at the call sites where they're still needed. Fixes the 'don't define components inside components' anti-pattern flagged against upstream PR entrius#15, without adopting that PR's prop-threading or React.memo machinery.
nightmare0329
added a commit
to nightmare0329/allways-ui
that referenced
this pull request
Apr 18, 2026
…back Issue entrius#33 — refactor(OrderbookDepth): hoist BtcIcon, TaoIcon, AssetIcon to module scope so they are not recreated on every parent render. Each icon calls useTheme() internally instead of closing over the parent component's theme variables. Issue entrius#31 — a11y: add aria-label to 4 icon-only interactive controls: - Docs link button (aria-label="Documentation") - Theme toggle button (dynamic: "Switch to dark/light mode") - Orderbook info button (aria-label="Orderbook depth information") - EventFeed scroll-to-top button (aria-label="Scroll to top of event feed") Issue entrius#36 — fix: add QueryError component with retry button and wire it into all four dashboard panels (StatsPanel, MinerRatesTable, OrderbookDepth, EventFeed). Panels now render a QueryError with a refetch button instead of staying on a shimmer skeleton when useApiQuery errors. Closes entrius#31, entrius#33, entrius#36
5 tasks
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.
BtcIcon, TaoIcon, and AssetIcon were declared inside the OrderbookDepth render body, which created new component types on every parent render and caused React to unmount and remount the SVG subtrees.
Hoist all three to module scope. Each component calls useTheme() internally instead of closing over the parent's theme object. No prop threading, no React.memo.
Also inline the two remaining BTC_COLOR / TAO_COLOR aliases at the call sites where they're still needed.
Fixes the 'don't define components inside components' anti-pattern flagged against upstream PR #15, without adopting that PR's prop-threading or React.memo machinery.
Fixes #32