Skip to content

chore(frontend): remove the two dead useVncControls shims - #17180

Merged
mrveiss merged 1 commit into
mainfrom
useVncControls-shim-cleanup
Sep 20, 2026
Merged

mrveiss merged 1 commit into
mainfrom
useVncControls-shim-cleanup

Conversation

@mrveiss

@mrveiss mrveiss commented Sep 20, 2026

Copy link
Copy Markdown
Owner

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) was
wrong. 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 by
reading autobot-plugins/vnc/src/composables/useVncControls.ts directly, which carries an
injected-transport implementation richer than either app-local copy ever was (session-id
threading, 7 desktop-control operations, injected request function per #12931, since the
three hosts legitimately differ: main SPA's ApiClient, SLM's axios instance, and a standalone
embed with neither).

What Changed

  • Removed autobot-frontend/src/composables/useVncControls.ts and the autobot-slm-frontend
    copy — 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.vue onto the shared
    copy directly. Confirmed via a full unscoped grep across both apps' src/ trees (not just a
    path-substring search, which missed the one real remaining reference below) — no static
    import, no dynamic import(), nothing.
  • Removed autobot-frontend/src/composables/__tests__/useVncControls.test.ts — the one
    reference the first grep pass missed (a relative import, from '../useVncControls'). Its
    entire 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 by
    path:line would have gone stale the moment those lines stopped existing. Updated to describe
    the 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.ts itself, DesktopInterface.vue (the real
consumer, already importing from @autobot/vnc directly), and the two useToast.ts files'
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-ui was never actually the right target for this composable and nothing here
changes 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

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.
@mrveiss mrveiss linked an issue Sep 20, 2026 that may be closed by this pull request
6 tasks
@coderabbitai

coderabbitai Bot commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Next included review available in 28 minutes.

Check out review usage here.

View limit details

Limit 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.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Repository: mrveiss/AutoBot-AI/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: d78c4b32-7bf9-47bd-9c22-4f3866663974

📥 Commits

Reviewing files that changed from the base of the PR and between b08c9ad and a469f69.

📒 Files selected for processing (5)
  • autobot-frontend/src/composables/__tests__/useVncControls.test.ts
  • autobot-frontend/src/composables/useVncControls.ts
  • autobot-slm-frontend/src/composables/useVncControls.ts
  • changelog/unreleased/14907-vnc-controls-shim-cleanup.md
  • docs/adr/008-frontend-shared-code-boundary.md

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

Comment @coderabbitai help to get the list of available commands.

@mrveiss

mrveiss commented Sep 20, 2026

Copy link
Copy Markdown
Owner Author

Review — approve, with one stale reference to sweep

Verified independently against the PR head rather than from the description, because this is a
deletion and the standing rule is that cleanup means finishing landed work, not removing it.

The landed-work claim holds. Every surviving useVncControls reference on the head resolves to
the real implementation or lives inside it:

No dangling import of either deleted file remains. Removing the regression test with the shim is
right: its subject is that the local paths resolve to the same function object as the package, and
with one implementation left the fork it guards against is not constructible.

Updating docs/adr/008-frontend-shared-code-boundary.md was the right call and not an optional
extra — it cited both deleted files by path, so it would have become a false map the moment they
went.

One finding (non-blocking)

Two doc comments still describe the deleted files as a live exemplar:

  • autobot-frontend/src/composables/useToast.ts:16
  • autobot-slm-frontend/src/composables/useToast.ts:16

Both read "Mirrors the useVncControls shim pattern (#12931)." After this PR there is no
useVncControls shim to mirror, so a reader following the pointer finds nothing and cannot tell
whether the toast shim is also obsolete. It is not — it has real callers — which is exactly why the
dead pointer is worth removing rather than leaving.

This is the same staleness the ADR update fixed, in two places the path-based search would not have
surfaced: these cite the pattern by name, not by path.

Suggested: reword to name @autobot/vnc as the precedent instead of the removed shim, e.g.
"Same shim-over-package shape that #12931 established for @autobot/vnc."

Verdict: approve. The finding is a comment-only follow-up and should not hold the deletion —
fold it into this PR if CI has not started, otherwise take it separately.

@github-actions

Copy link
Copy Markdown
Contributor

✅ SSOT Configuration Compliance: Passing

🎉 No new hardcoded values of either class — ssot and other both block.

Known backlog in pipeline-scripts/hardcoded_values_baseline.txt is suppressed and tracked in #14371.

@mrveiss
mrveiss merged commit b6dbac2 into main Sep 20, 2026
59 checks passed
@mrveiss
mrveiss deleted the useVncControls-shim-cleanup branch September 20, 2026 16:59
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.

Consolidate duplicated composables across both GUIs into the shared kit

1 participant