refactor(web): remove unused runtime wrappers and exports#10225

merged1
main
cleanup-web/runtime-internals
openedSep 5, 2026byJJulius Marminge
View on GitHubTwo-way sync enabledPR last imported 4d ago

Knip identified unused hooks, auth wrappers, atoms, and re-export aliases in the web runtime. Remove dead wrappers and keep implementation details private where they still have local callers.

Preserve the bootstrap functions used through the primary-environment barrel, their existing tests, and all exported types and Effect schemas. This rebased revision also makes the newly landed web favicon downscaler private while retaining its local cache caller.

Core UI component modules are unchanged. Their named subcomponents are preserved as complete component sets.

Layer 1 of 4 in the web runtime-export cleanup stack.

Verification at the integrated stack tip: vp run --filter @t3tools/web test passes all 4,052 tests across 333 files. Web typecheck and changed-file lint/format pass. vp run knip:check passes. A negative probe confirmed that a wholly unused components/ui/*.tsx file still fails the file audit.

Model: gpt-6 astra. Harness: Codex in T3 Code.

Note

Add persistent project favicon cache, PR terminal timestamps, and remaining-quota usage display

  • Adds a persistent project favicon cache backed by IndexedDB (web) and the mobile database with native image downscaling. A new createProjectFaviconUrlAtom family replaces the old useAssetUrl hook, retaining the last resolved icon across failures and serving hydrated cache images before remote refresh.
  • Adds optional closedAt and mergedAt fields to pull-request and change-request schemas across all providers (GitHub, GitLab, Bitbucket, Azure DevOps). pullRequestSettles in ThreadSettlementPolicy.ts now uses the state-specific terminal timestamp instead of updatedAt, so metadata updates after a merge or close no longer re-settle a thread.
  • Switches usage-limit displays from "used" to "remaining" quota and time. Both web and mobile refresh paths gain a shared refreshUsage workflow with explicit concurrency guards and abort-on-disconnect behavior.
  • makeEnvironmentThreadState in threads.ts now retains synchronization errors and cached data after terminated loads, does not restart fatal loads on connection notifications, and clears errors only on actual retry.
  • Replaces direct Lucide refresh/loader icons with shared RefreshIcon and Spinner components across many web and mobile settings, chat, and file-preview components. Migrates mobile adaptive color classes to semantic theme tokens (danger, warning, primary, secondary, subtle).
  • Risk: BitbucketPullRequestProvider now always returns null for mergedAt/closedAt instead of deriving from updatedAt; settlement behavior changes for threads whose PR metadata updated after terminal state. The useAssetUrl hook and useProjectFaviconAsset hook are removed—any out-of-tree consumers will break.

Macroscope summarized fba39bb.

Synced from GitHub

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

ProviderMetricMain baselineThis PRImpactPR ceiling
CodexTotal thread wire13.6 KiB13.6 KiB−14 B (−0.1%)15.1 KiB✅
CodexThread snapshot wire7.0 KiB7.0 KiB0 B (0.0%)7.3 KiB✅
CodexLive turn WebSocket wire6.6 KiB6.6 KiB−14 B (−0.2%)7.8 KiB✅
CodexLive turn WebSocket decoded57.1 KiB57.1 KiB0 B (0.0%)66.4 KiB✅
CodexLive turn messages10100 (0.0%)21✅
ClaudeTotal thread wire13.5 KiB13.6 KiB+35 B (+0.3%)15.1 KiB✅
ClaudeThread snapshot wire7.0 KiB7.0 KiB−4 B (−0.1%)7.3 KiB✅
ClaudeLive turn WebSocket wire6.5 KiB6.5 KiB+39 B (+0.6%)7.8 KiB✅
ClaudeLive turn WebSocket decoded57.8 KiB57.8 KiB+44 B (+0.1%)66.4 KiB✅
ClaudeLive turn messages89+1 (+12.5%)21✅

Baseline: bfba778 · PR result: fba39bb · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 113.8 KiB
  • Claude decoded thread snapshot: 114.5 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

Synced from GitHub

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — The diff is primarily an internal export and dead-code cleanup with no evident new runtime path or product-default change. It directly modifies primary authentication code and removes authentication-related APIs, so human review is required for the sensitive area.

You can add or adjust custom eligibility rules. Learn more.

Added 1 commit

  • refactor(web): remove unused environment runtime wrappersfba39bb