Repository navigation
ui: remove code with no callers - #1250
Conversation
|
Thanks for opening this pull request! A SPACE maintainer will take a look. CONTRIBUTING.md explains how we review outside contributions. |
Withdrawing this approval for now. Any feedback above still stands.
johnlouie-pplx
left a comment
There was a problem hiding this comment.
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.
- 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.
8ddfc2e to
4e61cce
Compare
Summary
This change removes UI code that nothing calls. Behaviour does not change.
api.postPreferDirectand 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, sorequest()drops its mode parameter.getPublicSandbox,deletePublicOperationandrunPublicSandboxOperationinui/src/lib/public-api.ts, plus the two helpers only they used (publicSandboxToConsoleSandbox,failedConditionMessage).ui/src/lib/sandbox-actions.ts, which nothing imports.refreshAll.reconcileTemplateInventory,snapshotPolicyFanoutMessage,pluralize,positiveOrDefault, and theSnapshotPolicyFanoutResponseandTemplateNetworkPolicyUpdateResponsetypes.networkPoliciesEqualandFormimports (both insandbox-detail.tsx;networkPoliciesEqualalso insandboxes/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_triggerfield, andbuildNodeViewsets it tonull. 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 togetConsoleSandboxes: keep that branch's newgetConsoleSandboxesand dropgetPublicSandbox. The import removals insandboxes/page.tsxandsandbox-detail.tsxmerge cleanly.Validation
npm ci,npm test(50 pass) andnpm run buildinui/. The type check confirms nothing referenced the removed symbols.space-uiimage. No new console errors, page errors or failed requests compared withmain.Severity and risk
Severity: does not apply (cleanup).
Risk: low. A deployment that patched in a caller of any removed export (
api.postPreferDirect, the threepublic-api.tsfunctions,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.