Skip to content

chore(web): remove dead front-end code left by the Foldkit migration - #2449

Merged
Makisuo merged 17 commits into
chore/audit-docs-leftoversfrom
chore/audit-frontend-dead-code
Nov 10, 2026
Merged

Makisuo merged 17 commits into
chore/audit-docs-leftoversfrom
chore/audit-frontend-dead-code

Conversation

@Makisuo

@Makisuo Makisuo commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

Stacked on #2448. Part of the audit stack that starts at #2434.

Deletions only. Nothing here changes what a user sees.

What is removed

  • 70 style constants in packages/ui across 18 *.styles.ts files, plus a dozen other exports there, all with no reference anywhere.
  • packages/web-data: the . and ./collections package exports and their two barrels had no importer. Five functions and five types with no user are gone.
  • apps/web: one file and 17 exports that only their own tests imported. Where a removed helper was the only route to live code, the test now calls the live function.
  • The VITE_MAPLE_CAPTURE build flag and its branch. Nothing sets it since the perf harness was deleted.
  • Two recharts selectors in theme.css (no package depends on recharts), four pixel glyphs nothing references, and a **/*.tsx include in a package with no .tsx file.

What is fixed

  • The Vite define list was missing three keys the app reads: VITE_CLERK_SIGN_IN_URL, VITE_CLERK_SIGN_UP_URL and VITE_MCP_URL.
  • Lab page descriptions advertised query options (?mode=recharts|cursor, ?renderer=...) that no bench code reads.

Kept on purpose

  • VITE_MAPLE_REPLAY. .env.example documents it as a developer switch that turns self-recording off. Removing it would turn recording back on for anyone who set it.
  • The bench lab pages themselves. They can still be opened by hand.
  • getCustomChartServiceDetail: a test uses it as the only coverage of a live function.

Verification

  • Typecheck is clean for packages/ui, packages/web-data, packages/widgets, packages/views, apps/web and apps/local-ui, on the branch and again with every layer of the stack combined.
  • Tests pass for the touched files: packages/ui 133, packages/web-data 75, packages/views 45, apps/web 283.
  • ui:index:check, ui:patterns:check and ui:css:check pass. Lint and format are clean.
  • Nothing was checked in a browser. The evidence is typecheck, tests and a repo-wide reference search for each name.

Left for a decision

  • Page pieces that only the lab renders (the MCP service tab, an occurrences table, a query builder legend) and the kit calendar that only the lab uses.
  • About 180 comments that still cite deleted .tsx files.
  • Toast animation variables and one colour token in tokens.css that are now orphaned.

Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Deletions only; nothing a user sees changes. Every symbol was confirmed
unreferenced by a whole-word grep of apps, packages, lib, scripts and
examples before removal.

packages/ui
- 70 style constants in components/ui/*.styles.ts with no reference
  anywhere (toast 13, sidebar 11, autocomplete 8, combobox 8,
  context-menu 6, item 3, sheet 3, and smaller sets in 11 more files).
- Dead exports: linearYScale (and its scaleLinear import), BucketAxis,
  three sample-data sets, EMPTY_SERVICE_MAP_LAYOUT,
  DEFAULT_SERVICE_MAP_VIEW_PREFS, TimelineAction and three timeline
  constants, CACHE_OPERATION_COLORS, LATENCY_COLOR, ERROR_RATE_COLOR,
  getDepthColorClass (with CHART_BG_CLASSES, which only it read),
  sanitizeCssIdentifier. DECLUTTER_OFF moves into the one test that
  used it. LatencyLevel is no longer exported.

packages/web-data
- Drop the `.` and `./collections` exports and their two barrels: no
  importer.
- Dead functions: getGcpCloudSqlInstancesOfDatabase, identityFromKey,
  orgScopedKeyPayload (and the timestamp-dropping branch only they
  reached), isAutomaticRetryError, toolSeriesMode.
- Dead types: AlertsOverviewData, AiSessionSpansPage,
  CustomChartTimeSeriesResponse, TracesResponse, TracesFacetsResponse.
  UserDetailInput and WebAnalyticsFacetRow are no longer exported.

apps/web
- lib/anomalies/anomaly-filters.ts: only its own test imported it.
- 17 exports only their tests used, with those test cases. Tests of
  live code that went through them now call the live function
  (formatAttributeClause, customLayoutOf, decorateRoutes).
- VITE_MAPLE_CAPTURE: nothing sets it since the perf harness went.
- Lab descriptions no longer advertise ?mode= and ?renderer= options
  that no bench reads.
- The Vite override list gains the three VITE_* keys the app reads and
  the list missed.
- theme.css: two selectors for a chart library that is gone.
- index.html: the theme comment names the files that hold the store.

Also: packages/widgets tsconfig no longer includes *.tsx (it has
none), four unreferenced onboarding pixel glyphs, and the regenerated
kit index.
@coderabbitai

coderabbitai Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 33 seconds.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 33975ebb-73f2-4268-86e1-b2354f6420f0
Commits

Reviewing files that changed from the base of the PR and between 2b4c920 and 8d3f920.

Files ignored due to path filters: 1

  • packages/views/src/ui/icons.generated.ts is excluded by !**/*.generated.*
Files selected for processing: 81

  • apps/web/index.html
  • apps/web/src/components/infra/gcp/inventory.test.ts
  • apps/web/src/components/infra/gcp/inventory.ts
  • apps/web/src/components/infra/gcp/tabs.test.ts
  • apps/web/src/components/infra/gcp/tabs.ts
  • apps/web/src/components/integrations/gcp-connector-state.test.ts
  • apps/web/src/components/integrations/gcp-connector-state.ts
  • apps/web/src/components/service-map/three/factory-routing.test.ts
  • apps/web/src/components/service-map/three/factory-routing.ts
  • apps/web/src/components/settings/audit-log-filters.test.ts
  • apps/web/src/components/settings/audit-log-filters.ts
  • apps/web/src/lab/registry.ts
  • apps/web/src/lib/anomalies/anomaly-filters.test.ts
  • apps/web/src/lib/anomalies/anomaly-filters.ts
  • apps/web/src/lib/billing/billing-profile.test.ts
  • apps/web/src/lib/billing/billing-profile.ts
  • apps/web/src/lib/billing/plan-gating.test.ts
  • apps/web/src/lib/billing/plan-gating.ts
  • apps/web/src/lib/services/error-issues.test.ts
  • apps/web/src/lib/services/error-issues.ts
  • apps/web/src/lib/traces/advanced-filter-sync.test.ts
  • apps/web/src/lib/traces/advanced-filter-sync.ts
  • apps/web/src/page/kit/relative-time.ts
  • apps/web/src/page/service-map/scene-layout.test.ts
  • apps/web/src/page/service-map/scene-layout.ts
  • apps/web/src/page/settings/data-platform/data-platform.scene.test.ts
  • apps/web/src/page/settings/data-platform/update.ts
  • apps/web/src/platform/telemetry.ts
  • apps/web/src/theme.css
  • apps/web/src/vite-env.d.ts
  • apps/web/vite.config.ts
  • packages/ui/src/components/charts/_shared/sample-data.ts
  • packages/ui/src/components/plot/bucket-axis.ts
  • packages/ui/src/components/plot/plot-scales.ts
  • packages/ui/src/components/service-map/service-map-declutter.test.ts
  • packages/ui/src/components/service-map/service-map-declutter.ts
  • packages/ui/src/components/service-map/service-map-layout-state.ts
  • packages/ui/src/components/traces/trace-timeline-types.ts
  • packages/ui/src/components/ui/alert-dialog.styles.ts
  • packages/ui/src/components/ui/autocomplete.styles.ts
  • packages/ui/src/components/ui/bubble.styles.ts
  • packages/ui/src/components/ui/combobox.styles.ts
  • packages/ui/src/components/ui/command.styles.ts
  • packages/ui/src/components/ui/context-menu.styles.ts
  • packages/ui/src/components/ui/dialog.styles.ts
  • packages/ui/src/components/ui/field.styles.ts
  • packages/ui/src/components/ui/input.styles.ts
  • packages/ui/src/components/ui/item.styles.ts
  • packages/ui/src/components/ui/navigation-menu.styles.ts
  • packages/ui/src/components/ui/popover.styles.ts
  • packages/ui/src/components/ui/select.styles.ts
  • packages/ui/src/components/ui/sheet.styles.ts
  • packages/ui/src/components/ui/sidebar.styles.ts
  • packages/ui/src/components/ui/table.styles.ts
  • packages/ui/src/components/ui/toast.styles.ts
  • packages/ui/src/components/ui/toggle-group.styles.ts
  • packages/ui/src/lib/__tests__/colors.test.ts
  • packages/ui/src/lib/__tests__/sanitizers.test.ts
  • packages/ui/src/lib/cache.ts
  • packages/ui/src/lib/colors.ts
  • packages/ui/src/lib/error-rate.ts
  • packages/ui/src/lib/latency-tone.ts
  • packages/ui/src/lib/sanitizers.ts
  • packages/views/src/ui/INDEX.md
  • packages/web-data/package.json
  • packages/web-data/src/alerts/overview.ts
  • packages/web-data/src/collections/index.ts
  • packages/web-data/src/index.ts
  • packages/web-data/src/lib/cache-key.test.ts
  • packages/web-data/src/lib/cache-key.ts
  • packages/web-data/src/lib/error-messages.test.ts
  • packages/web-data/src/lib/error-messages.ts
  • packages/web-data/src/lib/tool-analytics.test.ts
  • packages/web-data/src/lib/tool-analytics.ts
  • packages/web-data/src/warehouse/ai-sessions.ts
  • packages/web-data/src/warehouse/custom-charts.ts
  • packages/web-data/src/warehouse/gcp-infra.ts
  • packages/web-data/src/warehouse/traces.ts
  • packages/web-data/src/warehouse/users.ts
  • packages/web-data/src/warehouse/web-analytics.ts
  • packages/widgets/tsconfig.json
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@maple-review-bot

This comment has been minimized.

@Makisuo
Makisuo added this pull request to stack #2450 November 10, 2026 03:23
@Makisuo Makisuo added the preview:web Deploy a Workers-only PR preview (no ingest/Electric); see docs/pr-previews.md label Nov 10, 2026
@maple-review-bot

This comment has been minimized.

@Makisuo
Makisuo deployed to preview-tinybird November 10, 2026 03:31 — with GitHub Actions Active
@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

🍁 Maple PR preview

Note

Preview resources were removed when the preview label came off.

Final commit 39ad900 · View workflow run

@maple-review-bot

This comment has been minimized.

@Makisuo
Makisuo deployed to preview-tinybird November 10, 2026 03:39 — with GitHub Actions Active
@maple-review-bot

This comment has been minimized.

@Makisuo
Makisuo deployed to preview-tinybird November 10, 2026 03:57 — with GitHub Actions Active
@maple-review-bot

This comment has been minimized.

@maple-review-bot

This comment has been minimized.

@maple-review-bot

This comment has been minimized.

@maple-review-bot

This comment has been minimized.

@Makisuo Makisuo removed the preview:web Deploy a Workers-only PR preview (no ingest/Electric); see docs/pr-previews.md label Nov 10, 2026
@Makisuo
Makisuo deployed to preview-tinybird November 10, 2026 09:30 — with GitHub Actions Active
@maple-review-bot

This comment has been minimized.

@maple-review-bot

This comment has been minimized.

…ded runner

Each run compiles a query of up to 2,000 items. Under the 5s default the test
timed out twice in one day on shared CI runners while passing in about a second locally.
@maple-review-bot

This comment has been minimized.

…ead-code

# Conflicts:
#	apps/web/src/components/settings/audit-log-filters.test.ts
@maple-review-bot

maple-review-bot Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Maple review

🟢 Confidence 10/10 · safe to merge. Dead-code deletion only: every removed export name has no reference at the head SHA, and no live caller changed.
no findings · tests not needed · risk medium

Removes unreferenced front-end code across apps/web, packages/ui and packages/web-data, plus a stale Vite flag, and adds three missing define keys. I grepped every removed name at the head commit and found no remaining user, so it is safe to merge.

  • Removes ~70 unreferenced *.styles.ts constants and dead helpers from packages/ui
  • Drops toWhereClause, identityFromKey and factoryLinks; tests now call the live helpers instead
  • vite.config.ts define list gains VITE_CLERK_SIGN_IN_URL, VITE_CLERK_SIGN_UP_URL and VITE_MCP_URL
  • Retires the VITE_MAPLE_CAPTURE flag and its requireConsent branch in platform/telemetry.ts

Before merge

  • Manual · Confirm VITE_CLERK_SIGN_IN_URL, VITE_CLERK_SIGN_UP_URL and VITE_MCP_URL are set in the prd and dev deploy env, since they are now baked into the bundle

8d3f920 · What was checked, coverage and telemetry details are on the Maple / review check. Reply "won't fix" to dismiss a finding, or mention @maple-review-bot to ask about one.

@Makisuo
Makisuo merged commit 13c5d47 into main Nov 10, 2026
41 checks passed
@maple-review-bot

Copy link
Copy Markdown

Merged with 1 step from "Before merge" still open. If it is done, tick it on the review comment; if not, now is the time.

  • Manual · Confirm VITE_CLERK_SIGN_IN_URL, VITE_CLERK_SIGN_UP_URL and VITE_MCP_URL are set in the prd and dev deploy env, since they are now baked into the bundle

@Makisuo
Makisuo deleted the chore/audit-frontend-dead-code branch November 10, 2026 11:30
Sign up for free to 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.

1 participant