Skip to content

DiffReviewModal is dead code; only DiffReviewResult is still used #2

Description

@jvsteiner

What

DiffReviewModal (the class) is dead code. It is never constructed anywhere in src/.

$ grep -rn "new DiffReviewModal" src
(no matches)

The file is 319 lines: src/components/DiffReviewModal.ts.

How it got here

It was superseded by the inline review system in 4b7f608 ("inline diff - acceptance", 2025-12-26). That commit wired up InlineReviewController and stopped invoking the modal, but left the class and its call-site prep behind.

What is still needed from that file

Only the DiffReviewResult interface (line 18). Two files import it and both still use it:

  • src/components/InlineReview/InlineReviewController.ts:17
  • src/components/HydrateView/hydrateView.ts:14

hydrateView.ts:14 imports DiffReviewModal alongside it, and that half is unused — it shows up as an @typescript-eslint/no-unused-vars warning in the Obsidian directory scan.

Related leftover

src/components/HydrateView/hydrateView.ts:963 computes:

const instructions =
    (toolCall.params.instructions as string) ||
    `Apply ${toolName} to ${targetPath}`;

instructions is assigned and never read. It looks like it used to be passed to the modal constructor. Worth confirming that nothing else was meant to consume it before deleting.

Cost right now

Low but not zero:

  • esbuild already tree-shakes the class out of main.js (grep -c DiffReviewModal main.js → 0), so no bundle cost.
  • It is 10 of the 33 diff-match-patch type errors in the Obsidian directory scan, so it costs lint work on code nobody runs.
  • It is 319 lines a reader has to decide about.

Suggested fix

  1. Move DiffReviewResult into src/components/InlineReview/types.ts (or src/types.ts).
  2. Update the two importers.
  3. Delete src/components/DiffReviewModal.ts.
  4. Check hydrateView.ts:963 and delete instructions if genuinely orphaned.

Note

Deliberately not bundled into the directory-compliance branch (chore/review-standards). That branch fixes the diff-match-patch typings in this file rather than deleting it, so the two changes stay separable and the compliance work does not quietly remove a feature.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions