Skip to content

chore: codebase cleanup — remove legacy CSS, stubs, and unused components - #22

Merged
Timidan merged 2 commits into
masterfrom
feat/cleanup-v2
May 28, 2026
Merged

chore: codebase cleanup — remove legacy CSS, stubs, and unused components#22
Timidan merged 2 commits into
masterfrom
feat/cleanup-v2

Conversation

@Timidan

Copy link
Copy Markdown
Owner

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.tsx and SmartDecoder.tsx had 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)

  • `api/vertexAuth.ts` — server Vertex auth helper, no callers
  • `src/components/SimpleGridUI.tsx` — legacy thin re-export stub (real impl lives in `src/components/simple-grid/`)
  • `src/components/SmartDecoder.tsx` — legacy thin re-export stub (real impl in `src/components/smart-decoder/`)
  • `src/components/shared/{Card,Input}.tsx` — unused shared primitives
  • `src/components/icons/IconMap.tsx` — unused icon mapping; remaining callers switched to phosphor icons directly
  • `src/components/integrations/lifi-earn/SparkleShowcase.tsx` — dev/experiment file (503 lines)
  • `src/components/transaction-builder/SimulationReplayResults.tsx` — unused replay UI
  • `src/styles/{ContractComponents,SimulatorWorkbench}.css` — header-only stubs

What's modified (66 files)

  • App.css: 1,868 lines removed (dead selectors)
  • CSS files: dead selectors removed across SharedComponents/SimpleGridUI/SimulationResultsPage/CompactArrayStyles/ExecutionStackTrace/StackedOverview/TokenMovementsPanel/design-tokens
  • IconLibrary.tsx: 40 unused icon exports removed
  • lifi-earn concierge: `ExecutionQueue` + `VaultRecommendations` refactored to extract hook bodies into helpers (fixes a React-hooks-rules issue with early-return-before-hooks)
  • utils + traceDecoder + services: dead exports removed (`DebugBridgeService.getStorageFromRpc`, `getStorageProofFromRpc`, etc.), `let → const` where reassignment never happened
  • types: unused type aliases removed (`ContractExternalFunction`, `ContractTokenInfo`, `RpcCapabilities`, `AssetChange`, etc.)
  • Configs:
    • `vite.config.ts` — drops unused `buffer` alias and walletconnect manualChunks entry
    • `vercel.json` — adds `/api/` segment to blockscout proxy destinations (actually fixes a broken Blockscout rewrite — bonus)
    • `eslint.config.js` — drops `eslint-plugin-react-refresh` and adds ignore globs for worktrees/edb/starknet-sim
    • `package.json` — removes `eslint-plugin-react-refresh` and `jsdom` deps; pins engines
  • edb submodule: bumped forward from `1ba2fca` to descendant `c5b32ca` (heimdall 0.9.2 fix)

Verification

CheckResult
`tsc --noEmit`0 errors
`vite build`✓ built in 18.49s
Deletion-safety audit (full grep for dynamic/string refs)All 10 deletions safe — no remaining references
Modification-correctness audit (config files + sampled high-risk diffs)0 SUSPECT
Runtime smoke (Playwriter screenshots)/, /integrations/lifi-earn, /builder, /database all render cleanly, no console errors beyond pre-existing external network noise

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

…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.
CopilotAI review requested due to automatic review settings May 28, 2026 11:07
@vercel

vercelBot commented May 28, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

ProjectDeploymentActionsUpdated (UTC)
web3-toolkitReadyReadyPreview, CommentMay 28, 2026 12:19pm

CopilotAI left a comment

Copy link
Copy Markdown

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 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
FileDescription
vite.config.tsRemoves unused buffer alias/dependency prebundle and walletconnect chunking.
vercel.jsonFixes Blockscout proxy rewrites by inserting /api/ segment.
tsconfig.app.jsonCollapses exclude list formatting (no functional change).
src/utils/universalTokenDetector.tsConst-ification/cleanup in token detection function locals.
src/utils/transaction-simulation/bridgeSimulation.tsConst-ification of normalized libraries map.
src/utils/traceDecoder/pcMapper.tsConst-ification of last source map tuple (mutated by index).
src/utils/traceDecoder/jumpAnalysis.tsConst-ification of promoted source file.
src/utils/traceDecoder/decodeTraceInit.tsConst-ification of raw trace text reference.
src/utils/resultFormatter.tsConst-ification of formatted output array.
src/utils/diamondFacetFetcher.tsAligns Blockscout fetch URLs with updated proxy rewrites.
src/types/transaction.tsRemoves unused AssetChange type.
src/types/debug.tsRemoves unused RpcCapabilities type.
src/types/contractInfo.tsRemoves unused contract-info helper type aliases.
src/styles/TokenMovementsPanel.cssRemoves dead selectors.
src/styles/StackedOverview.cssRemoves dead summary grid/card selectors.
src/styles/SimulatorWorkbench.cssDeletes header-only stub stylesheet.
src/styles/SimulationResultsPage.cssRemoves dead selectors and large unused blocks.
src/styles/SimpleGridUI.cssDeletes large set of unused legacy selectors, keeps minimal/active ones.
src/styles/SharedComponents.cssRemoves large blocks of unused legacy shared styles.
src/styles/ExecutionStackTrace.cssRemoves unused selectors for execution trace UI.
src/styles/design-tokens.cssRemoves unused token variables/utilities.
src/styles/ContractComponents.cssDeletes header-only stub stylesheet.
src/styles/CompactArrayStyles.cssRemoves unused compact-array button/grid styles.
src/services/DebugBridgeService.tsRemoves unused RPC/storage helper methods/types.
src/contexts/SimulationContext.tsxRemoves legacy localStorage cleanup effect and unused key.
src/contexts/debug/structStorageDecoding.tsConst-ification of slot value fetch result.
src/config/networkConfig.tsRemoves legacy localStorage migration + unused helper API.
src/components/TransactionBuilderWagmi.tsxSwitches SimpleGrid import to submodule barrel; removes replay results + legacy CSS import.
src/components/TransactionBuilderHub.tsxUpdates lazy import path for SimpleGrid submodule.
src/components/transaction-builder/types.tsRemoves unused call tree type + constant.
src/components/transaction-builder/SimulationReplayResults.tsxRemoves unused replay UI component.
src/components/SmartDecoder.tsxRemoves legacy re-export stub.
src/components/smart-decoder/utils.tsRemoves unused formatting/inference helpers.
src/components/smart-decoder/useDecodeHandlers.tsConst-ification of resolved ABI local.
src/components/smart-decoder/SmartDecoder.tsxRemoves animejs-based animation path and related state/refs.
src/components/simulation-results/formatters.tsRemoves unused formatting helpers, retains opcode/gas parsing utilities.
src/components/SimpleGridUI.tsxRemoves legacy re-export stub.
src/components/simple-grid/tokenDetection/universal.tsConst-ification of tokenInfo object initialization.
src/components/simple-grid/tokenDetection.tsConst-ification of enhanced detection snapshot.
src/components/simple-grid/SimpleGridMain.tsxDrops legacy SimulatorWorkbench.css import.
src/components/simple-grid/hooks/useFunctionState.tsConst-ification of aggregated function arrays.
src/components/simple-grid/GridLayout.tsxReplaces legacy icon map usage with direct phosphor icon.
src/components/signature-database/types.tsRemoves unused tab options constant.
src/components/signature-database/ToolsTab.tsxUpdates SmartDecoder lazy import to new submodule path.
src/components/shared/Input.tsxRemoves unused shared Input primitive.
src/components/shared/index.tsRemoves unused exports/re-exports; keeps only active shared exports.
src/components/shared/Card.tsxRemoves unused shared Card primitive.
src/components/shared/AddressDisplay.tsxRemoves unused shortenHash helper.
src/components/integrations/lifi-earn/SparkleShowcase.tsxDeletes experimental/dev-only sparkle showcase.
src/components/integrations/lifi-earn/simulator/projection.tsRemoves unused curve sampling helper.
src/components/integrations/lifi-earn/concierge/VaultRecommendations.tsxExtracts hook-using UI into body component to keep hooks unconditional.
src/components/integrations/lifi-earn/concierge/intent/hooks/useVaultsByIntent.tsMinor cleanup around pagination safety warning section.
src/components/integrations/lifi-earn/concierge/intent/hooks/useIntentRecommendation.tsRemoves inline eslint suppression comment noise.
src/components/integrations/lifi-earn/concierge/intent/hooks/useIntentParser.tsRemoves inline eslint suppression comment noise.
src/components/integrations/lifi-earn/concierge/hooks/useVaultRecommendations.tsRemoves verbose debug logging and redundant warning branches.
src/components/integrations/lifi-earn/concierge/hooks/useIdleBalances.tsRemoves verbose logging; simplifies per-chain failure handling.
src/components/integrations/lifi-earn/concierge/ExecutionQueue.tsxSplits into wrapper/body to avoid early-return-before-hooks pattern.
src/components/integrations/IntegrationsHub.tsxRemoves sparkle-test route and always serves lifi-earn under /integrations.
src/components/InlineFacetLoader.tsxReplaces legacy icon map usage with direct phosphor icon.
src/components/icons/IconMap.tsxRemoves unused icon map component.
src/components/icons/IconLibrary.tsxRemoves unused exports and makes IconProps internal.
src/components/explorer/useStorageViewerState.tsConst-ification of implementation address list initialization.
src/components/explorer/storageViewerHelpers.tsConst-ification in label cleaning helper.
src/components/explorer/StorageCells.tsxRemoves unused decode-kind icon rendering helper and unused imports.
src/components/explorer/storage-viewer/fetchStorageLayout.tsRemoves unused Sourcify layout fetch helper export.
src/components/debug/DebugWindow.tsxRemoves local DebugProvider wrapper; relies on app-level provider.
src/components/contract/ContractAddressInput.tsxRemoves legacy ContractComponents.css import.
package.jsonRemoves unused deps/scripts, adds description + engines constraint.
package-lock.jsonReflects dependency removals and engines addition.
index.htmlAdds color-scheme meta for dark/light UI integration.
eslint.config.jsRemoves react-refresh plugin; expands ignore globs.
api/vertexAuth.tsRemoves unused Vertex auth helper.
.gitignoreAdds spec-file ignore patterns and other minor ignores.
.env.exampleUpdates Gemini model defaults and documents simulator-bridge tuning env vars.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@chatgpt-codex-connectorchatgpt-codex-connectorBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment on lines 336 to 339
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 {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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.

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 74 out of 76 changed files in this pull request and generated no new comments.

@Timidan
Timidan merged commit 49cb7e0 into masterMay 28, 2026
3 checks passed
Timidan added a commit that referenced this pull request May 28, 2026
Applied 9 unambiguous fixes from a 10-zone CLAUDE.md audit (~150 total
findings). Only items with zero behavior change, zero parallel-work
conflict (PR #20 lifi-intents, #21 mezo, #22 cleanup), and clear
dead-code or surface-confusion signal were applied; the rest are
deferred to the PR description as a backlog.
Net: 12 files, -65 lines net.
Surface confusion (P1):
- structStorageDecoding.ts:484 — collapse identical-branches ternary
'const elementSize = elementType === 'address' ? 1 : 1' → '= 1'
- storageSlotCalculator.ts:86 — parseSlotInput dropped redundant hex
branch (both branches called BigInt(trimmed))
- edbTraceConverter.ts:55 — same redundant-hex-branch in
parseTraceValue
Speculative API surface (P2):
- SolidityViewer.tsx — removed unused props highlightLine,
scrollToLine, theme (sole caller never passes any)
- PackingVisualizer.tsx — removed unused rawHex prop + caller's pass
- api/{lifi-composer,lifi-earn,edb-proxy}.ts — dropped 'HEAD' from
ALLOWED_METHODS (no caller issues HEAD)
Dead exports (P3):
- scripts/bridge-security.mjs — sanitizeForLogging (zero callers)
- scripts/bridge-config.mjs — TRACE_DETAIL_COMPACT_ARTIFACTS env
constant (zero readers)
- eslint.config.js — ignore globs for nonexistent dirs
(current_bundle, test-results, test-*, **/test-*.js, test-app-*)
@Timidan
Timidan deleted the feat/cleanup-v2 branch June 1, 2026 10:27
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@Timidan