chore: codebase cleanup — remove legacy CSS, stubs, and unused components#22
Conversation
…ents Net effect: ~7.1k lines deleted across 76 files. Removed: - api/vertexAuth.ts (server Vertex auth helper, unused) - src/components/SimpleGridUI.tsx (legacy thin-stub) - src/components/SmartDecoder.tsx (legacy thin-stub) - src/components/shared/Card.tsx, Input.tsx (unused shared primitives) - src/components/icons/IconMap.tsx (unused icon mapping) - src/components/integrations/lifi-earn/SparkleShowcase.tsx (dev/experiment file) - src/components/transaction-builder/SimulationReplayResults.tsx (unused replay UI) - src/styles/ContractComponents.css, SimulatorWorkbench.css (gutted CSS stubs) Modifications: 66 files trimmed for dead code, unused imports, and consolidated styles.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
This PR performs a broad cleanup pass across HexKit, removing legacy CSS/stub components and dead exports, while also tightening configuration (Vite/Vercel/ESLint/TypeScript) and refactoring some React components to avoid hook-order pitfalls.
Changes:
- Removed legacy/stub components and CSS files, plus many unused types/exports.
- Updated Blockscout proxy routing (Vercel rewrites + corresponding client URL construction changes).
- Refactored selected React components (notably LiFi Earn concierge UI) to keep hooks in valid, unconditional execution paths.
Reviewed changes
Copilot reviewed 74 out of 76 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| vite.config.ts | Removes unused buffer alias/dependency prebundle and walletconnect chunking. |
| vercel.json | Fixes Blockscout proxy rewrites by inserting /api/ segment. |
| tsconfig.app.json | Collapses exclude list formatting (no functional change). |
| src/utils/universalTokenDetector.ts | Const-ification/cleanup in token detection function locals. |
| src/utils/transaction-simulation/bridgeSimulation.ts | Const-ification of normalized libraries map. |
| src/utils/traceDecoder/pcMapper.ts | Const-ification of last source map tuple (mutated by index). |
| src/utils/traceDecoder/jumpAnalysis.ts | Const-ification of promoted source file. |
| src/utils/traceDecoder/decodeTraceInit.ts | Const-ification of raw trace text reference. |
| src/utils/resultFormatter.ts | Const-ification of formatted output array. |
| src/utils/diamondFacetFetcher.ts | Aligns Blockscout fetch URLs with updated proxy rewrites. |
| src/types/transaction.ts | Removes unused AssetChange type. |
| src/types/debug.ts | Removes unused RpcCapabilities type. |
| src/types/contractInfo.ts | Removes unused contract-info helper type aliases. |
| src/styles/TokenMovementsPanel.css | Removes dead selectors. |
| src/styles/StackedOverview.css | Removes dead summary grid/card selectors. |
| src/styles/SimulatorWorkbench.css | Deletes header-only stub stylesheet. |
| src/styles/SimulationResultsPage.css | Removes dead selectors and large unused blocks. |
| src/styles/SimpleGridUI.css | Deletes large set of unused legacy selectors, keeps minimal/active ones. |
| src/styles/SharedComponents.css | Removes large blocks of unused legacy shared styles. |
| src/styles/ExecutionStackTrace.css | Removes unused selectors for execution trace UI. |
| src/styles/design-tokens.css | Removes unused token variables/utilities. |
| src/styles/ContractComponents.css | Deletes header-only stub stylesheet. |
| src/styles/CompactArrayStyles.css | Removes unused compact-array button/grid styles. |
| src/services/DebugBridgeService.ts | Removes unused RPC/storage helper methods/types. |
| src/contexts/SimulationContext.tsx | Removes legacy localStorage cleanup effect and unused key. |
| src/contexts/debug/structStorageDecoding.ts | Const-ification of slot value fetch result. |
| src/config/networkConfig.ts | Removes legacy localStorage migration + unused helper API. |
| src/components/TransactionBuilderWagmi.tsx | Switches SimpleGrid import to submodule barrel; removes replay results + legacy CSS import. |
| src/components/TransactionBuilderHub.tsx | Updates lazy import path for SimpleGrid submodule. |
| src/components/transaction-builder/types.ts | Removes unused call tree type + constant. |
| src/components/transaction-builder/SimulationReplayResults.tsx | Removes unused replay UI component. |
| src/components/SmartDecoder.tsx | Removes legacy re-export stub. |
| src/components/smart-decoder/utils.ts | Removes unused formatting/inference helpers. |
| src/components/smart-decoder/useDecodeHandlers.ts | Const-ification of resolved ABI local. |
| src/components/smart-decoder/SmartDecoder.tsx | Removes animejs-based animation path and related state/refs. |
| src/components/simulation-results/formatters.ts | Removes unused formatting helpers, retains opcode/gas parsing utilities. |
| src/components/SimpleGridUI.tsx | Removes legacy re-export stub. |
| src/components/simple-grid/tokenDetection/universal.ts | Const-ification of tokenInfo object initialization. |
| src/components/simple-grid/tokenDetection.ts | Const-ification of enhanced detection snapshot. |
| src/components/simple-grid/SimpleGridMain.tsx | Drops legacy SimulatorWorkbench.css import. |
| src/components/simple-grid/hooks/useFunctionState.ts | Const-ification of aggregated function arrays. |
| src/components/simple-grid/GridLayout.tsx | Replaces legacy icon map usage with direct phosphor icon. |
| src/components/signature-database/types.ts | Removes unused tab options constant. |
| src/components/signature-database/ToolsTab.tsx | Updates SmartDecoder lazy import to new submodule path. |
| src/components/shared/Input.tsx | Removes unused shared Input primitive. |
| src/components/shared/index.ts | Removes unused exports/re-exports; keeps only active shared exports. |
| src/components/shared/Card.tsx | Removes unused shared Card primitive. |
| src/components/shared/AddressDisplay.tsx | Removes unused shortenHash helper. |
| src/components/integrations/lifi-earn/SparkleShowcase.tsx | Deletes experimental/dev-only sparkle showcase. |
| src/components/integrations/lifi-earn/simulator/projection.ts | Removes unused curve sampling helper. |
| src/components/integrations/lifi-earn/concierge/VaultRecommendations.tsx | Extracts hook-using UI into body component to keep hooks unconditional. |
| src/components/integrations/lifi-earn/concierge/intent/hooks/useVaultsByIntent.ts | Minor cleanup around pagination safety warning section. |
| src/components/integrations/lifi-earn/concierge/intent/hooks/useIntentRecommendation.ts | Removes inline eslint suppression comment noise. |
| src/components/integrations/lifi-earn/concierge/intent/hooks/useIntentParser.ts | Removes inline eslint suppression comment noise. |
| src/components/integrations/lifi-earn/concierge/hooks/useVaultRecommendations.ts | Removes verbose debug logging and redundant warning branches. |
| src/components/integrations/lifi-earn/concierge/hooks/useIdleBalances.ts | Removes verbose logging; simplifies per-chain failure handling. |
| src/components/integrations/lifi-earn/concierge/ExecutionQueue.tsx | Splits into wrapper/body to avoid early-return-before-hooks pattern. |
| src/components/integrations/IntegrationsHub.tsx | Removes sparkle-test route and always serves lifi-earn under /integrations. |
| src/components/InlineFacetLoader.tsx | Replaces legacy icon map usage with direct phosphor icon. |
| src/components/icons/IconMap.tsx | Removes unused icon map component. |
| src/components/icons/IconLibrary.tsx | Removes unused exports and makes IconProps internal. |
| src/components/explorer/useStorageViewerState.ts | Const-ification of implementation address list initialization. |
| src/components/explorer/storageViewerHelpers.ts | Const-ification in label cleaning helper. |
| src/components/explorer/StorageCells.tsx | Removes unused decode-kind icon rendering helper and unused imports. |
| src/components/explorer/storage-viewer/fetchStorageLayout.ts | Removes unused Sourcify layout fetch helper export. |
| src/components/debug/DebugWindow.tsx | Removes local DebugProvider wrapper; relies on app-level provider. |
| src/components/contract/ContractAddressInput.tsx | Removes legacy ContractComponents.css import. |
| package.json | Removes unused deps/scripts, adds description + engines constraint. |
| package-lock.json | Reflects dependency removals and engines addition. |
| index.html | Adds color-scheme meta for dark/light UI integration. |
| eslint.config.js | Removes react-refresh plugin; expands ignore globs. |
| api/vertexAuth.ts | Removes unused Vertex auth helper. |
| .gitignore | Adds spec-file ignore patterns and other minor ignores. |
| .env.example | Updates Gemini model defaults and documents simulator-bridge tuning env vars. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cbae059f04
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (!raw) { | ||
| // Try migrating from old settings | ||
| const migrated = migrateFromOldSettings(); | ||
| if (migrated) return migrated; | ||
| // Even with no config blob, persisted secrets may exist | ||
| const secrets = readSecrets(); | ||
| return { |
There was a problem hiding this comment.
Preserve legacy RPC/API-key migration
When users only have the pre-v3 localStorage keys (web3-toolkit:user-rpc-settings or web3-toolkit-universal-api-keys) and have not yet generated the new config blob, this branch now falls straight back to defaults plus any new-format secrets, so their saved RPC provider and explorer API keys are silently ignored. Keeping the one-shot migration here (or otherwise reading those legacy keys before returning defaults) avoids losing existing user settings on first load after upgrade.
Useful? React with 👍 / 👎.
Only "off" is special-cased at runtime — "fixture" mode was declared in the type union but never branched on, and no fixture files exist beyond a .gitkeep. Update the example to reflect what works.
Summary
Net effect: 76 files changed, +140 / −7,286 (heavy net deletion). A fresh take on the cleanup intent of the now-closed #18, rebuilt directly against current master instead of stacking on the abandoned phase4-wallet-gate branch.
Origin
This replaces #18 (closed). #18's base was
feat/phase4-wallet-gate(now PR #17, draft/WIP) and it was 21 days stale. Cherry-picking the cleanup commits onto current master (-X theirs) produced this much smaller, surgical diff — most of #18's deletion intent had already shipped on master via different paths (e.g.SimpleGridUI.tsxandSmartDecoder.tsxhad been reduced to thin re-export stubs; legacy CSS files had been gutted to header comments). What remains is the final removal pass plus a handful of incidental fixes.What's removed (10 files)
What's modified (66 files)
Verification
One thing to be aware of before merging
`src/config/networkConfig.ts` removes a one-shot legacy localStorage migration that read the keys `web3-toolkit:user-rpc-settings` and `web3-toolkit-universal-api-keys`. Any user who hasn't opened the app since that migration shipped (3+ weeks ago) will silently lose their saved RPC and API key data on next load. The original cleanup author likely intended this given the age of the migration, but flagging explicitly.
Branch heritage