Repository navigation
refactor(cashtag): revised sidepanel open - #47430
Conversation
Builds ready [9b05e70]
⚡ Performance Benchmarks (Total: 🟢 8 pass · 🟡 3 warn · 🔴 2 fail)
Bundle Size Diffs
|
Builds ready [95db626]
⚡ Performance Benchmarks (Total: 🟢 6 pass · 🟡 4 warn · 🔴 3 fail)
Bundle Size Diffs
|
18b57ad to
97ec962
Compare
Builds ready [e7df298] [reused from f93aafe]
⚡ Performance Benchmarks (Total: 🟢 9 pass · 🟡 1 warn · 🔴 3 fail)
Bundle Size Diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [98caaee]
⚡ Performance Benchmarks (Total: 🟢 7 pass · 🟡 3 warn · 🔴 3 fail)
Bundle Size Diffs [🚨 Warning! Bundle size has increased!]
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit dbad883. Configure here.
Builds ready [dbad883]
⚡ Performance Benchmarks (Total: 🟢 5 pass · 🟡 6 warn · 🔴 2 fail)
Bundle Size Diffs [🚨 Warning! Bundle size has increased!]
|
Opens the MetaMask side panel to specific routes (token details or swap pages) when the user clicks cashtag links in the widget. Routes are saved in pendingRoutes before calling chrome.sidePanel.open() and consumed by the panel on mount. Cleanup policy: - Routes are cleared when consumed (CONSUME_PENDING_ROUTE message) - Routes are cleared when the window closes (windows.onRemoved listener) - Routes are cleared when open() fails (identity check in catch block) - Routes are NOT cleared on sidePanel.onClosed to avoid race conditions The chrome.sidePanel.open() promise resolves before the panel document loads. A close event from a previous panel instance can arrive after a new open() has resolved, making it impossible to distinguish which panel instance owns the route using only windowId. By not registering an onClosed handler, routes persist until explicitly consumed or the window closes, preventing late close events from deleting newer routes. Co-authored-by: Francis Nepomuceno <n3ps@users.noreply.github.com>
dbad883 to
cf4e0e7
Compare
Builds ready [cf4e0e7]
⚡ Performance Benchmarks (Total: 🟢 7 pass · 🟡 2 warn · 🔴 4 fail)
Bundle Size Diffs
|
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
Builds ready [7166895]
⚡ Performance Benchmarks (Total: 🟢 6 pass · 🟡 4 warn · 🔴 3 fail)
Bundle Size Diffs
|
Builds ready [507df0a]
⚡ Performance Benchmarks (Total: 🟢 9 pass · 🟡 1 warn · 🔴 3 fail)
Bundle Size Diffs
|
Co-authored-by: Francis Nepomuceno <n3ps@users.noreply.github.com>
Builds ready [c3ef2de]
⚡ Performance Benchmarks (Total: 🟢 9 pass · 🟡 0 warn · 🔴 4 fail)
Bundle Size Diffs
|
|




Description
Fixes intermittent bug where clicking "View details" or "Swap" on the cashtag widget opens the side panel but stays on home instead of navigating to the requested route.
New approach Implement route handoff via a
Map<windowId, route>. On click, store the route, callchrome.sidePanel.open({ windowId })immediately and broadcast. The side panel consumes the route once on mount or nudge viaCONSUME_PENDING_ROUTEmessage.Changelog
CHANGELOG entry: null
Related issues
Fixes: #47354, #47352
Manual testing steps
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Changes cashtag-to-side-panel messaging and navigation timing, but scope is limited to the X widget open flow with extensive new tests and no wallet/auth logic touched.
Reviewed by Cursor Bugbot for commit c3ef2de. Bugbot is set up for automated code reviews on this repo. Configure here.