AnswerDotAI / AnswerDotAI/ai-jup

Add sidecar chat panel with Cursor-style notebook diff review

Open
#3 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
22
Forks
7
PR merge metrics
No merged PRs in 30d

Description

## Proposal

Add a sidecar chat panel that enables AI-assisted notebook editing with a Cursor-style diff review UX.

### Design Document

See [diff-brainstorming.md](https://github.com/hamelsmu/ai-jup/blob/main/diff-brainstorming.md) for full details.

### Summary

**Core Features:**
1. **Sidecar chat panel** - Right sidebar alongside notebook
2. **Full notebook context** - Entire notebook serialized for LLM
3. **Per-cell diffs** - Accept/reject individual cell changes
4. **Cursor-style UX** - Color-coded line diffs, bulk actions

**Architecture:**
- `ChatSidecarWidget` - Main React widget in right sidebar
- `ChatModel` - State management for messages, edits, streaming
- `CellDiffView` - Per-cell diff with accept/reject controls
- `DiffSummaryBar` - Bulk accept/reject all changes

**Edit Plan Format:**
LLM outputs structured JSON with cell edits:
- `modify` - Change cell source
- `insert_before` / `insert_after` - Add new cells
- `delete` - Remove cells

**Undo/Revert:**
- Uses JupyterLab's native undo stack (Cmd+Z works)
- Lightweight AI metadata tracking layer
- Per-change and session-level undo buttons

### Decisions

1. **Multi-notebook context**: Not needed for v1 (single notebook only)
2. **Collaborative editing**: Not supported for v1 (single user)
3. **Cell metadata**: Yes, expose to AI (enables editing tags, slide types, etc.)

### Open Questions

1. Conflict resolution when user edits cell while patch is pending
2. Should AI be able to propose clearing/modifying outputs?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.