Skip to content

fix(DEX2-874): Fix every context rendering a second time in CDS Chart for performance#339

Merged
hcopp merged 2 commits intocoinbase:masterfrom
avocado-cb:tristyn/bridge-whitelist
Jan 29, 2026
Merged

fix(DEX2-874): Fix every context rendering a second time in CDS Chart for performance#339
hcopp merged 2 commits intocoinbase:masterfrom
avocado-cb:tristyn/bridge-whitelist

Conversation

@avocado-cb
Copy link
Copy Markdown
Contributor

@avocado-cb avocado-cb commented Jan 29, 2026

What changed? Why?

This improves rendering speed of line charts in JS by 31% or 13.4ms (43.1ms->29.7ms). This brings 26.8ms savings per price update in ADP due to each price change updating chart twice (a separate bug).

Root cause (required for bugfixes)

Adds a whitelist to ChartContextBridge. This reduces the number of non-skia components bridged and rendered from 250 to 9.

Benchmarks (and react component tree visualized) before/after:
Screenshot 2026-01-29 at 11 28 38 AMScreenshot 2026-01-28 at 10 09 55 PM

UI changes

No visual differences.

iOS Old iOS New
old screenshot new screenshot
Android Old Android New
old screenshot new screenshot
Web Old Web New
old screenshot new screenshot

Testing

I've tested this change on Coinbase ADP and Home pages in simulator. I did this by editing cds-internal packages locally, then installing them into react-native locally using npx yalc which was a pleasant workflow.

I confirmed across Coinbase and TBA codebases with AI that only these 3 whitelisted contexts are used.

How has it been tested?

  • Unit tests
  • Interaction tests
  • Pseudo State tests
  • Manual - Web
  • Manual - Android (Emulator / Device)
  • Manual - iOS (Emulator / Device)

Testing instructions

Illustrations/Icons Checklist

Required if this PR changes files under packages/illustrations/** or packages/icons/**

  • verified visreg changes with Terran (include link to visreg run/approval)
  • all illustration/icons names have been reviewed by Dom and/or Terran

Change management

type=routine
risk=low
impact=sev5

automerge=false

@cb-heimdall
Copy link
Copy Markdown
Collaborator

cb-heimdall commented Jan 29, 2026

✅ Heimdall Review Status

Requirement Status More Info
Reviews 1/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 1
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1
CODEOWNERS ✅ See below

CODEOWNERS

Code Owner Status Calculation
ui-systems-eng-team 1/1
Denominator calculation
Additional CODEOWNERS Requirement
Show calculation
Sum 0
0
From CODEOWNERS 1
Sum 1

@avocado-cb avocado-cb changed the title chore: Add whitelist to ChartContextBridge for performance chore: Fix every context rendering a second time in CDS Chart for performance Jan 29, 2026
@avocado-cb avocado-cb changed the title chore: Fix every context rendering a second time in CDS Chart for performance chore(DEX2-874): Fix every context rendering a second time in CDS Chart for performance Jan 29, 2026
@avocado-cb avocado-cb changed the title chore(DEX2-874): Fix every context rendering a second time in CDS Chart for performance fix(DEX2-874): Fix every context rendering a second time in CDS Chart for performance Jan 29, 2026
@avocado-cb avocado-cb force-pushed the tristyn/bridge-whitelist branch from 24f0e4b to 9aa9ab0 Compare January 29, 2026 07:58
@avocado-cb avocado-cb marked this pull request as ready for review January 29, 2026 07:59
import { ThemeContext } from '@coinbase/cds-mobile/system/ThemeProvider';

import { CartesianChartContext } from './ChartProvider';
import { ScrubberContext } from './utils/context';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@avocado-cb can you run yarn nx run mobile-visualization:lint --fix?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure done!

@hcopp hcopp merged commit f3e766c into coinbase:master Jan 29, 2026
22 checks passed
cb-ekuersch pushed a commit that referenced this pull request Jan 30, 2026
… for performance (#339)

* bugfix and changelog

* lint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

3 participants