feat(super-user): auto-activate via subdomain and add persistent cache#256
feat(super-user): auto-activate via subdomain and add persistent cache#256AugustoL wants to merge 16 commits intoopenscan-explorer:mainfrom
Conversation
…text - zh: use 发送方/接收方 (sender/receiver) instead of 发件人/收件人 (mail sender/recipient) for from/to fields - zh: use 金额 (amount) instead of 价值 (abstract value) for ETH transaction amounts - ja: use 金額 (amount) instead of 価値 (abstract value) for ETH transaction amounts - ja: use 勝者 (winner) instead of 優勝者 (champion) for RPC race winner
…ost-rpcs 251 fix localhost rpcs
Add super user mode auto-activation when accessing via the "super" subdomain (e.g., super.openscan.io). Add a persistent localStorage cache with LRU eviction for blockchain data when in super user mode, with configurable size limit (5-100MB) and a dedicated Settings section. Closes openscan-explorer#240, closes openscan-explorer#242
|
🚀 Preview: https://pr-256--openscan.netlify.app |
Add violet accent glow on navbar and footer borders, a "Super User" badge in the navbar, and violet styling on the active toggle button to provide clear visual feedback when super user mode is enabled.
…languages feat(i18n): add Chinese Simplified, Japanese, and Portuguese (BR) translations
…tribution-rule chore(claude): add no AI attribution rule
- New /rpcs page with network dropdown (EVM + Bitcoin), sortable table (provider, latency, status, privacy), and one-click "Add" to config - Latency test via eth_blockNumber (EVM) / getblockcount (Bitcoin) using JSON-RPC 2.0, batched in parallel groups of 6 with 10s timeout - Status dots: green (online), red (offline), yellow (timeout), pulsing gray (pending); offline endpoints always sort last on latency column - Active row highlight for endpoints already in user RPC config - Full i18n support (en/es) with new rpcs namespace - Add "Test RPCs" button in Settings → RPC Endpoints section linking to the new page - Mobile responsive layout
…utton Display the block number returned by each RPC endpoint so users can easily identify which providers are up to date. Remove the redundant "Active" badge and "Add" button since endpoints are managed in settings. Center all non-provider columns for better readability.
… quality Tests all configured RPCs in parallel and reorders them by privacy tier (open source > closed source > tracking) then latency, pushing offline endpoints to the end. Auto-saves the new order after sync completes.
feat(rpcs): add RPCs page for testing and comparing RPC endpoints
…o feat/improve-super-user-mode # Conflicts: # src/components/pages/settings/index.tsx
🧪 Persistent Cache — Test ReportPreview: ✅ What works
|
Description
Improves super user mode with two enhancements: auto-activation via the
supersubdomain and a persistent localStorage cache for blockchain data.Related Issue
Closes #240, Closes #242
Type of Change
Changes Made
Issue #240 — Subdomain-based super user activation
supersubdomain entry tosrc/config/subdomains.tssosuper.openscan.iois recognizedSettingsContext.tsx, detectsupersubdomain on init and forceisSuperUser: trueIssue #242 — Persistent storage in super user mode
persistentCacheSizeMBfield toUserSettingstype (default: 10 MB)src/utils/persistentCache.ts— localStorage-based cache with LRU eviction,OPENSCAN_PCACHE_prefix keys, andQuotaExceededErrorhandlingsrc/hooks/usePersistentCache.ts— React hook providinggetCached/setCachedthat are no-ops when super user mode is disabledisSuperUseris trueclearPersistentCache()into the existingclearAllCaches()functionScreenshots (if applicable)
N/A — Settings section only visible when super user mode is active.
Checklist
npm run format:fixandnpm run lint:fixnpm run typecheckwith no errors (pre-existing errors only)npm run test:runAdditional Notes
The
usePersistentCachehook is ready for page-level components (block, tx, address pages) to integrate — they can wrap their data fetches withgetCached/setCachedto persist blockchain data across sessions.