Skip to content

Delete 4 orphaned/superseded frontend components (version-conflict-modal, agent onboarding pair, tool-call-display) #2580

Closed

Description

@mstomar125

Overview

A dead-code sweep of nodespace-core (Rust: cargo clippy --workspace --all-targets -W dead_code -W unused plus a repo-wide grep for #[allow(dead_code)]/#[deprecated]) came back completely clean — zero findings. The Rust side of this repo is genuinely well-maintained against the project's no-dead-code policy.

A follow-up lighter pass over packages/desktop-app/src/lib/ (grep every non-test .ts/.svelte file's basename against every import/reference in the whole repo, including .claude/worktrees/) turned up 4 real orphaned Svelte components — each verified individually, not just by the automated grep, to rule out dynamic imports, string-keyed registries, and stale-worktree false positives.

Problem Statement

None of these 4 files are imported, re-exported, or referenced anywhere outside themselves:

  1. packages/desktop-app/src/lib/components/version-conflict-modal.svelte (383 lines) — the old OCC-era conflict-resolution modal from issue [DRAFT] Add Optimistic Concurrency Control to NodeOperations #333 (commit 422c9a4b). Its sibling version-conflict-resolver was already deleted in "Delete 15 obsolete services replaced by LIVE SELECT" (Delete 15 obsolete services replaced by LIVE SELECT #594), but this modal was missed. The conflict-handling architecture has since moved on entirely: commit f68f31d6 ("Replace _possible_duplicate with a generic conflict journal", ADR-068, Replace _possible_duplicate with a generic conflict journal (ADR-068) #2534) introduced the current, actually-wired conflict UI — lib/stores/conflicts.svelte.ts, lib/components/conflict-indicator-badge.svelte, lib/components/conflict-toast.svelte, lib/components/conflicts/conflicts-pane.svelte. This file is a leftover from the pre-ADR-068 design.

  2. packages/desktop-app/src/lib/components/agents/ai-onboarding-dialog.svelte (513 lines) and packages/desktop-app/src/lib/components/agents/agent-selector.svelte (196 lines) — an ACP-agent-selection/onboarding UI pair from the original AI chat integration (feat: Chat UI, agent panel, model settings, and AI onboarding #1024, feat: Complete AI chat integration — ACP agents + local LLM with tool calling #1042). The AI chat viewer (lib/components/viewers/ai-chat-node-viewer.svelte) does not import either; it uses a different, apparently-later pair instead (lib/components/viewers/ai-chat-model-selector.svelte and lib/components/viewers/ai-chat-pty-session.svelte). ai-onboarding-dialog.svelte was touched as recently as commit 38fc4b84 (2026-09-08, "Replace Gemini CLI with Antigravity CLI"), but that edit was a pure Gemini CLI → Antigravity CLI string find-replace across the codebase (confirmed via git show), not evidence of active wiring — the file has had zero real importers throughout.

  3. packages/desktop-app/src/lib/components/chat/tool-call-display.svelte (144 lines) — a component for rendering ToolExecutionRecord tool-call details in chat. ToolExecutionRecord/toolExecutions data is tracked in the AI chat data model and covered by tests (tests/components/ai-chat-viewer.test.ts, archival logic in ai-chat-node-viewer.svelte), but no rendering path actually uses ToolCallDisplay — chat-message.svelte (the component that renders each chat message) has zero references to tool calls at all. This looks like a feature that was built but never wired into the message-rendering path.

Verification method for all 4: grep -rn (case-insensitive, both kebab-case filename and PascalCase component name) across every .ts/.svelte/.js/.json file in the repo, explicitly excluding the stale .claude/worktrees/ copies (which are unrelated duplicate checkouts, not real usages) — zero hits outside each file's own definition.

Not filed as dead code (investigated, ruled out)

  • packages/desktop-app/src/lib/components/viewers/base-viewer.ts — also has zero importers, but its own doc comment states it is "for documentation and implementation guidance only" (the real contract lives in NodeViewerProps/node-viewers.ts). Intentional, not dead.
  • packages/desktop-app/src/lib/services/developer-inspector.ts — also has zero importers, but is explicitly named as an intentionally-kept dev-only debugging tool: CLAUDE.md's logging-standards section calls out "Test files and DeveloperInspector are exempt," and vitest.config.ts excludes it from coverage with the comment "Dev-only debugging tool." Documented intent, not dead.

Proposed Solution

Delete the 4 files (and anything that becomes newly-unused as a result, e.g. any type/import that only they consumed):

  • packages/desktop-app/src/lib/components/version-conflict-modal.svelte
  • packages/desktop-app/src/lib/components/agents/ai-onboarding-dialog.svelte
  • packages/desktop-app/src/lib/components/agents/agent-selector.svelte
  • packages/desktop-app/src/lib/components/chat/tool-call-display.svelte

If any of these represent a feature someone intends to finish wiring up (e.g. tool-call rendering in chat, or an ACP onboarding flow), the alternative is to actually wire it in — but that's a product decision for whoever picks this up, not implied by this filing.

Acceptance Criteria

  • All 4 files deleted, or explicitly wired into a real caller with a comment/PR explaining the decision to keep instead
  • bun run quality:fix and bun run test:all clean after removal (no orphaned imports/types left behind)
  • If lib/components/agents/ ends up empty after removing both files in it, remove the directory too

Reference Files

  • packages/desktop-app/src/lib/components/version-conflict-modal.svelte
  • packages/desktop-app/src/lib/components/agents/ai-onboarding-dialog.svelte
  • packages/desktop-app/src/lib/components/agents/agent-selector.svelte
  • packages/desktop-app/src/lib/components/chat/tool-call-display.svelte
  • packages/desktop-app/src/lib/components/conflicts/conflicts-pane.svelte (current conflict UI, for contrast)
  • packages/desktop-app/src/lib/components/viewers/ai-chat-model-selector.svelte, ai-chat-pty-session.svelte (current agent-selection UI, for contrast)

Priority

Low — pure cleanup, no functional impact; these components are unreachable from the app today.

Activity

  1. self-assigned this
    on Sep 12, 2026
  2. mstomar125 commented on Sep 14, 2026

    @mstomar125
    ContributorAuthor

    Starting work on this issue in worktree issue-2580-orphaned-components. Baseline bun run test clean (240 files, 4951 tests passed). Re-verifying each of the 4 files is still genuinely orphaned before deleting.

  3. mstomar125 commented on Sep 14, 2026

    @mstomar125
    ContributorAuthor

    Resolved in #2602.

    Re-verified all 4 files immediately before deletion (repo-wide grep, both kebab-case filenames and PascalCase component names, excluding .claude/worktrees/ and node_modules/) — all still had zero importers outside their own definitions, so nothing changed since filing. No discrepancies found; all 4 were deleted as proposed:

    • packages/desktop-app/src/lib/components/version-conflict-modal.svelte
    • packages/desktop-app/src/lib/components/agents/ai-onboarding-dialog.svelte
    • packages/desktop-app/src/lib/components/agents/agent-selector.svelte
    • packages/desktop-app/src/lib/components/chat/tool-call-display.svelte

    lib/components/agents/ was empty afterward and was removed with its contents, per the acceptance criteria. No co-located test files existed for any of the 4, so nothing else needed removing.

    1236 lines removed, 0 added. bun run quality:fix and bun run test:all both clean, and the pre-push gate (test:all + cargo build --bin nodespaced + full e2e suite) passed with zero failures.

    PR: #2602 (Closes #2580)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions