Repository navigation
chore(frontend): remove the two dead useVncControls shims - #17180
Conversation
useVncControls was already consolidated into one implementation -- autobot-plugins/vnc/src/composables/useVncControls.ts, with an injected transport (#12931) -- not into @autobot/ui, which is the target #14907's AC1 named and the only reason this read as unmet. autobot-frontend/src/composables/useVncControls.ts and the autobot-slm-frontend copy were thin re-export shims (#12653/#12978) left with zero callers once DesktopInterface.vue was migrated onto the shared copy directly. Confirmed via a full unscoped grep across both apps, including tests and dynamic-import forms, not just static path imports: the only remaining reference besides the canonical package and its real consumer is a docstring comment in useToast.ts citing the pattern by name, and this ADR. Removed both shims, plus autobot-frontend/src/composables/__tests__/useVncControls.test.ts -- its entire subject was asserting the shim re-exported the same function object as the canonical package (the fork this migration existed to prevent); with one implementation instead of two, that fork is structurally impossible and the test has nothing left to guard. docs/adr/008-frontend-shared-code-boundary.md's citation of the two shim files by path:line updated so it doesn't go stale now that those lines don't exist.
|
Warning Review limit reachedNext included review available in 28 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Repository: mrveiss/AutoBot-AI/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (5)
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. Comment |
Review — approve, with one stale reference to sweepVerified independently against the PR head rather than from the description, because this is a The landed-work claim holds. Every surviving
No dangling import of either deleted file remains. Removing the regression test with the shim is Updating One finding (non-blocking)Two doc comments still describe the deleted files as a live exemplar:
Both read "Mirrors the This is the same staleness the ADR update fixed, in two places the path-based search would not have Suggested: reword to name Verdict: approve. The finding is a comment-only follow-up and should not hold the deletion — |
✅ SSOT Configuration Compliance: Passing🎉 No new hardcoded values of either class — Known backlog in |
Thinking Path
#14907's AC1 says "useVncControls promoted to the kit; both GUIs import it; no local copies
remain" — read as unmet for months because the target package it names (
@autobot/ui) waswrong. The consolidation actually happened via a different, more architecturally correct target:
autobot-plugins/vnc(a VNC-specific plugin package, not the general UI kit) — confirmed byreading
autobot-plugins/vnc/src/composables/useVncControls.tsdirectly, which carries aninjected-transport implementation richer than either app-local copy ever was (session-id
threading, 7 desktop-control operations, injected
requestfunction per #12931, since thethree hosts legitimately differ: main SPA's
ApiClient, SLM's axios instance, and a standaloneembed with neither).
What Changed
autobot-frontend/src/composables/useVncControls.tsand theautobot-slm-frontendcopy — both were thin re-export shims (
export { useVncControls, ... } from '@autobot/vnc',tech-debt(frontend): de-duplicate cross-app FE plumbing + Advanced Control/useVncControls built twice #12653) left with zero callers once refactor(vnc): make useVncControls exist once (#12653) #12978 migrated
DesktopInterface.vueonto the sharedcopy directly. Confirmed via a full unscoped grep across both apps'
src/trees (not just apath-substring search, which missed the one real remaining reference below) — no static
import, no dynamic
import(), nothing.autobot-frontend/src/composables/__tests__/useVncControls.test.ts— the onereference the first grep pass missed (a relative import,
from '../useVncControls'). Itsentire subject was asserting the shim re-exported the same function object as the canonical
package, guarding against the fork re-appearing as two equivalent-but-distinct
implementations. With one implementation instead of two, that fork is structurally
impossible — the test has nothing left to guard and goes with the file it tested.
docs/adr/008-frontend-shared-code-boundary.md: its citation of the two shim files bypath:linewould have gone stale the moment those lines stopped existing. Updated to describethe completed state (one file, not a shim pointing at one) rather than delete the paragraph —
the ADR's own point (that this was a real production duplicate that converged cleanly) still
holds.
Not touched, deliberately
autobot-plugins/vnc/src/composables/useVncControls.tsitself,DesktopInterface.vue(the realconsumer, already importing from
@autobot/vncdirectly), and the twouseToast.tsfiles'comments mentioning "the useVncControls shim pattern" as a historical precedent for their own
consolidation — those are accurate as prose, not dangling file references.
libs/autobot-uiwas never actually the right target for this composable and nothing herechanges that package.
Verification
Per this project's standing rule, no local vitest/tsc run from this checkout is cited as
evidence — this worktree has no
node_modules. Every claim above is a direct grep/read result,documented in the commit message alongside the exact search performed.
Model Used
Claude Sonnet 5
Refs #14907