-
Notifications
You must be signed in to change notification settings - Fork 0
Add popup to show when desktop app is not running #72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
naps62
commented
Jan 23, 2026
- Add browser action popup with React and @ethui/ui components
- Show connection status (connected/disconnected) in popup
- Display badge indicator ("!") on extension icon when disconnected
- Show browser notification on first connection failure
- Add link to ethui.dev when desktop app is not running
- Add browser action popup with React and @ethui/ui components
- Show connection status (connected/disconnected) in popup
- Display badge indicator ("!") on extension icon when disconnected
- Show browser notification on first connection failure
- Add link to ethui.dev when desktop app is not running
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Show address (truncated with copy button), network name, and balance when the ethui desktop app is connected. Uses dedicated WebSocket connection to make eth_accounts, eth_chainId, and eth_getBalance RPC calls. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Instead of showing "disconnected" when no tab has made a request yet, the popup now proactively checks the connection to the desktop app by attempting a WebSocket connection. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add viem dependency for comprehensive chain definitions - Build chain name map from viem/chains instead of hardcoded list - Use black icon for notifications instead of purple 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Added onclose handler and deduplication flag to ensure the connection check always resolves, even when the WebSocket closes without firing the error event first. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove center alignment from all popup views - Make title smaller (text-sm) and black in all states - Remove unused cn import 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Poll for connection every 2 seconds when the popup shows disconnected state. Once the desktop app is detected, automatically switch to connected state and show wallet info. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Poll for connection changes in both connected and disconnected states, so the popup updates when the app is closed while viewing connected. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Use @ethui/ui Alert component with destructive variant to show the disconnected error message. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Split the monolithic App component into: - hooks/useConnectionState.ts - connection state management and polling - hooks/useWalletInfo.ts - wallet info fetching - components/Header.tsx - shared header with logo - components/ConnectedView.tsx - connected state UI - components/DisconnectedView.tsx - disconnected state UI - utils.ts - utility functions (truncateAddress, formatBalance, getChainName) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The hook is only used in ConnectedView, so call it there directly instead of passing props from App. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds a browser action popup to the ethui extension that displays connection status and wallet information, providing users with visibility into whether the desktop app is running and accessible.
Changes:
- Added popup UI with React components showing connection status (connected/disconnected/unknown)
- Implemented connection state monitoring with badge indicators and browser notifications
- Integrated @ethui/ui component library and Tailwind CSS v4 for styling
- Added WebSocket-based connection checking and wallet info fetching
Reviewed changes
Copilot reviewed 14 out of 17 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| package.json, yarn.lock | Added dependencies: @ethui/ui, @tailwindcss/vite, tailwindcss, viem, @fontsource/source-code-pro |
| vite/base.ts | Added Tailwind CSS plugin and popup entry point to build configuration |
| manifest/base.json | Added popup HTML reference and notifications permission |
| src/background/index.ts | Integrated connection state tracking into WebSocket lifecycle events |
| src/background/connectionState.ts | New file implementing connection monitoring, badge updates, and wallet info fetching |
| src/popup/* | New popup UI with React components, hooks, and utilities for displaying connection/wallet state |
| .gitignore | Added .claude directory to ignore list |
Comments suppressed due to low confidence (1)
vite/base.ts:50
- The output configuration on lines 47-50 has a ternary condition that produces the same result for both branches:
"[name]/index.js"in both cases. This makes the conditional check forchunk.name === "devtools" || chunk.name === "panel"redundant. Consider simplifying this to just return"[name]/index.js"directly, or if different behavior was intended for different chunks, correct the logic to implement the intended distinction.
entryFileNames: (chunk) =>
chunk.name === "devtools" || chunk.name === "panel"
? "[name]/index.js"
: "[name]/index.js",
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| export function formatBalance(balanceHex: string): string { | ||
| try { | ||
| const wei = BigInt(balanceHex); | ||
| const eth = Number(wei) / 1e18; | ||
| if (eth === 0) return "0 ETH"; | ||
| if (eth < 0.0001) return "<0.0001 ETH"; | ||
| return `${eth.toFixed(4)} ETH`; | ||
| } catch { | ||
| return "0 ETH"; | ||
| } |
Copilot
AI
Jan 27, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The formatBalance function on line 22 converts wei to a number by dividing Number(wei) / 1e18. This approach can lose precision for large balance values because JavaScript's Number type has limited precision (53 bits). For balances larger than about 9007 ETH, this will result in precision loss. Consider using string-based arithmetic or a library like viem (which is already a dependency) to handle wei-to-ETH conversion with full precision, or at minimum document that balances may be imprecise for very large values.