Skip to content

TUI: SplitDiff passes nonexistent props to <diff> — compare-view diffs broken #463

Description

@windoliver

Pre-existing bug surfaced during #192 / PR #462 review (out of scope for that PR).

src/tui/components/split-diff.tsx renders:
```tsx

```
But the real @opentui/core <diff> API (verified against node_modules/@opentui/core/renderables/Diff.d.ts) is:

  • diff?: string — a unified-diff-format string (parsed via the diff package's parsePatch)
  • view?: "unified" | "split"
  • filetype?: string

There is no oldContent/newContent/mode. TypeScript doesn't catch this because OpenTUI's intrinsic JSX elements use a string index signature that suppresses excess-property checks.

Impact: SplitDiff is used by compare-view.tsx (CompareView, Frontier compare mode). At runtime the DiffRenderable receives no diff string → renders nothing or an error view. So compare-mode diffs are broken.

Fix: mirror the now-correct pattern in artifact-preview.tsx — build a unified-diff string (it already uses computeUnifiedDiff, which now emits a valid @@ hunk header) and pass <diff diff={unified} view="split" filetype={lang} />. Consider having artifact-preview and SplitDiff share one <diff> wrapper.

Also minor: intervalMs is a dead prop on both detail.tsx and artifact-preview.tsx (documented "kept for caller-stability") — drop or formalize.

Refs: #192, #462.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions