Skip to content

ui: remove code with no callers - #1250

Merged
ac-pplx merged 1 commit into
mainfrom
ac/admin-ui-dead-code
Nov 2, 2026
Merged

ac-pplx merged 1 commit into
mainfrom
ac/admin-ui-dead-code

Conversation

@ac-pplx

@ac-pplx ac-pplx commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This change removes UI code that nothing calls. Behaviour does not change.

  • api.postPreferDirect and the "prefer-direct" request mode behind it. For a console served over plain HTTP on port 3000 from a non-loopback host, without external sign-in, it sent the request straight to port 8080 on that host and fell back to the same-origin proxy on a network error. Nothing used it, so request() drops its mode parameter.
  • getPublicSandbox, deletePublicOperation and runPublicSandboxOperation in ui/src/lib/public-api.ts, plus the two helpers only they used (publicSandboxToConsoleSandbox, failedConditionMessage).
  • ui/src/lib/sandbox-actions.ts, which nothing imports.
  • On the nodes page: refreshAll.
  • On the templates page: reconcileTemplateInventory, snapshotPolicyFanoutMessage, pluralize, positiveOrDefault, and the SnapshotPolicyFanoutResponse and TemplateNetworkPolicyUpdateResponse types.
  • Unused networkPoliciesEqual and Form imports (both in sandbox-detail.tsx; networkPoliciesEqual also in sandboxes/page.tsx).

The nodes page's rendering of a node's queued reconcile trigger is kept. It is unreachable today: the admin node response has no reconcile_trigger field, and buildNodeView sets it to null. Showing it would need both the response field and an adapter change.

Stack

Independent of the other open console PRs. Whichever of this PR and #1244 / #1248 merges later gets a conflict in ui/src/lib/public-api.ts, next to getConsoleSandboxes: keep that branch's new getConsoleSandboxes and drop getPublicSandbox. The import removals in sandboxes/page.tsx and sandbox-detail.tsx merge cleanly.

Validation

  • npm ci, npm test (50 pass) and npm run build in ui/. The type check confirms nothing referenced the removed symbols.
  • A full Playwright loop over every console route and flow against a local Kind stack, on this branch's Kind space-ui image. No new console errors, page errors or failed requests compared with main.

Severity and risk

Severity: does not apply (cleanup).

Risk: low. A deployment that patched in a caller of any removed export (api.postPreferDirect, the three public-api.ts functions, publicSandboxToConsoleSandbox, or @/lib/sandbox-actions) fails at build time. Roll back by reverting the commit.

AI assistance: Claude Code wrote the change and this description, and ran the validation; a maintainer reviews it.

@github-actions github-actions Bot added the triage:pending Waiting for a maintainer to triage label Oct 31, 2026
@github-actions

Copy link
Copy Markdown

Thanks for opening this pull request! A SPACE maintainer will take a look.

CONTRIBUTING.md explains how we review outside contributions.

zibi-pplx
zibi-pplx previously approved these changes Nov 1, 2026
@zibi-pplx
zibi-pplx dismissed their stale review November 1, 2026 22:30

Withdrawing this approval for now. Any feedback above still stands.

@johnlouie-pplx johnlouie-pplx left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approving. I checked every removed symbol against the rest of the repo at this head and nothing still references them, including the UI tests, the Python smoke code and the other open console PRs. There are no dynamic imports or file-based routes involved, and sandbox-actions.ts had no side effects, so deleting it is safe. The request() change keeps the same behavior: every remaining call already used the same-origin path, and the three authApi calls now pass the base in the right position.

Locally on 8ddfc2e: npm ci, npm test (50/50), tsc --noEmit and npm run build all pass. Worth knowing that no PR CI job builds ui/ (the Kind smoke was skipped for this path set), so the local build is what covers this change. I didn't run the Playwright pass myself.

@ac-pplx
ac-pplx added this pull request to the merge queue Nov 2, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Nov 2, 2026
- api.postPreferDirect and the direct-to-port request mode behind it:
  nothing called it, so request() loses its mode parameter.
- getPublicSandbox, deletePublicOperation, runPublicSandboxOperation and
  the helpers only they used, in lib/public-api.ts.
- lib/sandbox-actions.ts, which nothing imported.
- The nodes page's refreshAll, and the templates page's
  reconcileTemplateInventory, snapshotPolicyFanoutMessage, pluralize,
  positiveOrDefault and two response types nothing referenced.
- Unused networkPoliciesEqual and Form imports.

No behaviour changes.
@ac-pplx
ac-pplx force-pushed the ac/admin-ui-dead-code branch from 8ddfc2e to 4e61cce Compare November 2, 2026 06:55
@ac-pplx
ac-pplx added this pull request to the merge queue Nov 2, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 2, 2026
@ac-pplx
ac-pplx added this pull request to the merge queue Nov 2, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 2, 2026
@ac-pplx
ac-pplx added this pull request to the merge queue Nov 2, 2026
Merged via the queue into main with commit 313ec30 Nov 2, 2026
23 checks passed
@ac-pplx
ac-pplx deleted the ac/admin-ui-dead-code branch November 2, 2026 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

triage:pending Waiting for a maintainer to triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants