chore(openspec): drop 9 superseded proposals + 11 stub archive files
Drop 9 batch proposals that are superseded by the boocode-lift-analysis (boocontext-audit, conductor upgrades, self-healing/verify-gate skills): add-3tier-memory, import-llm-evaluator, import-pregel-engine, plugin-platform, conductor-evolution, code-intelligence-upgrade, dev-workflow, ui-overhaul, agent-reliability. Delete 11 stub archive files (49-66B each, 'Status: Shipped. Archived.' only) that provide zero documentation value over the existing CHANGELOG.md + git tags.
This commit is contained in:
64
openspec/changes/enhanced-file-panel/design.md
Normal file
64
openspec/changes/enhanced-file-panel/design.md
Normal file
@@ -0,0 +1,64 @@
|
||||
# Enhanced File Panel — Design Decisions
|
||||
|
||||
## D1: Diff preference system
|
||||
|
||||
A `useDiffPreferences` hook manages three stored preferences:
|
||||
|
||||
```typescript
|
||||
interface DiffPreferences {
|
||||
layout: 'unified' | 'split'; // default: 'unified'
|
||||
wrapLines: boolean; // default: false
|
||||
hideWhitespace: boolean; // default: false
|
||||
}
|
||||
```
|
||||
|
||||
Persisted via localStorage key `boocode.diff.preferences`.
|
||||
**Reference**: `/opt/forks/paseo/hooks/use-changes-preferences/storage.ts`
|
||||
|
||||
## D2: Side-by-side diff layout
|
||||
|
||||
Split layout renders two columns (left = removals, right = additions) with aligned line numbers.
|
||||
|
||||
Algorithm (adapted from Paseo `diff-layout.ts` `buildSplitDiffRows`):
|
||||
1. Parse unified diff into hunks (reuse existing `splitDiffByFile`)
|
||||
2. Group remove lines into pendingRemovals, add lines into pendingAdditions
|
||||
3. Flush paired rows when encountering context lines
|
||||
4. Unpaired lines get an empty cell on one side
|
||||
|
||||
## D3: Hide whitespace (server-side)
|
||||
|
||||
`GET /api/projects/:id/git/diff` gains optional `whitespace=1` query param.
|
||||
When set, `git diff` appends `-w` (`--ignore-all-space`).
|
||||
|
||||
## D4: Wrap lines (CSS-only)
|
||||
|
||||
When `wrapLines` is true: `white-space: pre-wrap; overflow-wrap: anywhere`
|
||||
replaces `white-space: pre; overflow-x: auto`. Gutter stays unwrapped.
|
||||
|
||||
## D5: Expand/Collapse all
|
||||
|
||||
`allExpanded` computed as `files.every(f => expandedPaths.has(f.path))`.
|
||||
Toggle button adds all paths to expandedPaths or clears them.
|
||||
|
||||
## D6: Inline diff comments
|
||||
|
||||
Data model:
|
||||
```typescript
|
||||
interface DiffComment {
|
||||
id: string; filePath: string; side: 'old' | 'new';
|
||||
lineNumber: number; body: string;
|
||||
createdAt: number; updatedAt: number;
|
||||
}
|
||||
```
|
||||
|
||||
Zustand store with localStorage persistence, keyed by `${sessionId}:${mode}`.
|
||||
|
||||
## D7: File editing
|
||||
|
||||
Double-click file in tree → fetch content via `view_file` → textarea →
|
||||
Save calls `POST /api/projects/:id/write_file` → triggers `git_diff_refresh`.
|
||||
Path validated via existing `pathGuard`.
|
||||
|
||||
## D8: No DB / no WS frames / no contract changes
|
||||
|
||||
All new state is client-side (localStorage, React state, Zustand).
|
||||
46
openspec/changes/enhanced-file-panel/proposal.md
Normal file
46
openspec/changes/enhanced-file-panel/proposal.md
Normal file
@@ -0,0 +1,46 @@
|
||||
# Enhanced file panel — diff display modes, inline comments, and in-browser file editing
|
||||
|
||||
## Why
|
||||
|
||||
BooCode's right-rail file panel has a solid foundation: a file tree (read-only), a Git diff tab
|
||||
with unified display and stage/commit/discard. But it lacks features users expect from a modern
|
||||
code review surface:
|
||||
|
||||
1. **Side-by-side diff** — was deferred under YAGNI in v1. The current unified-only view is hard
|
||||
to read on wide files and wastes horizontal space on desktop.
|
||||
2. **Hide whitespace** — meaningless whitespace changes clutter diffs in code-generation workflows.
|
||||
3. **Wrap long lines** — unified diffs of long lines require horizontal scrolling.
|
||||
4. **Expand/collapse all** — only per-file expand exists; bulk toggling is missing.
|
||||
5. **Inline diff comments** — was explicitly out-of-scope in v1. The user cannot annotate diffs.
|
||||
6. **In-browser file editing** — the file tree is read-only. Editing requires agent tool calls or terminal.
|
||||
|
||||
## What Changes
|
||||
|
||||
### Frontend
|
||||
|
||||
- **GitDiffView.tsx** — toolbar row with: Unified/Split toggle, Hide whitespace toggle, Wrap lines
|
||||
toggle, Expand/Collapse all, Refresh (existing)
|
||||
- **Diff rendering** — split-layout renderer (two panels side-by-side, aligned line numbers),
|
||||
CSS `pre-wrap` for wrapped lines
|
||||
- **Inline comments** — `InlineReviewGutterCell` (hover → + button), `InlineReviewThread`,
|
||||
`InlineReviewEditor` (textarea saved via Zustand store)
|
||||
- **Comment storage** — Zustand store persisted to localStorage, keyed by diff context
|
||||
- **File editing** — double-click file in tree → inline textarea → Save/Cancel → server write API
|
||||
- **Preferences hook** — `useDiffPreferences` → `{ layout, wrapLines, hideWhitespace }`
|
||||
|
||||
### Server
|
||||
|
||||
- **`git_diff.ts`** — add `ignoreWhitespace` param, pass `-w` to `git diff`
|
||||
- **New route** — `POST /api/projects/:id/write_file` with pathGuard security
|
||||
|
||||
### Infrastructure
|
||||
|
||||
- No DB changes — comments client-side, file writes to disk
|
||||
- No new WS frames — uses existing `git_diff_refresh` event
|
||||
- No `@boocode/contracts` changes
|
||||
|
||||
## Risk
|
||||
|
||||
- **Side-by-side diff rendering** — biggest rendering risk; Paseo's `diff-layout.ts` is the reference
|
||||
- **Inline comments** — lost on localStorage clear; acceptable for v1
|
||||
- **File editing** — last-writer-wins for single-user is acceptable
|
||||
46
openspec/changes/enhanced-file-panel/tasks.md
Normal file
46
openspec/changes/enhanced-file-panel/tasks.md
Normal file
@@ -0,0 +1,46 @@
|
||||
# Enhanced File Panel — tasks
|
||||
|
||||
## Tasks
|
||||
|
||||
- [ ] 1. **Server: whitespace param** — Add `ignoreWhitespace` param to `getGitDiff()` in
|
||||
`apps/server/src/services/git_diff.ts`. Append `-w` to git diff argv when true.
|
||||
Add `whitespace=1` query param to `GET /api/projects/:id/git/diff` route.
|
||||
|
||||
- [ ] 2. **Server: write_file endpoint** — Add `POST /api/projects/:id/write_file` with
|
||||
pathGuard validation and atomic file write. Wire client in `api/client.ts`.
|
||||
|
||||
- [ ] 3. **Server tests** — Add tests for whitespace param and write_file endpoint.
|
||||
(`apps/server/src/services/__tests__/git_diff.test.ts` + new write tests)
|
||||
|
||||
- [ ] 4. **Frontend: useDiffPreferences hook** — Create `useDiffPreferences.ts` with
|
||||
localStorage persistence for layout, wrapLines, hideWhitespace.
|
||||
|
||||
- [ ] 5. **Frontend: GitDiffView toolbar** — Add toolbar row with Layout toggle,
|
||||
Hide whitespace toggle, Wrap lines toggle, Expand/Collapse all, Refresh.
|
||||
|
||||
- [ ] 6. **Frontend: diff layout utilities** — Create `utils/diff-layout.ts` with
|
||||
`buildNumberedDiffHunks()`, `buildSplitDiffRows()`, `buildUnifiedDiffLines()`.
|
||||
|
||||
- [ ] 7. **Frontend: DiffSplitView component** — Side-by-side renderer with two aligned
|
||||
columns, Shiki highlighting per side, thin divider.
|
||||
|
||||
- [ ] 8. **Frontend: Integrate split layout in GitDiffView** — Branch render path based
|
||||
on `layout` preference. Wire collapse/expand state to all files.
|
||||
|
||||
- [ ] 9. **Frontend: Inline comment store** — Create `stores/useDiffCommentStore.ts`
|
||||
with Zustand + localStorage persistence. CRUD operations.
|
||||
|
||||
- [ ] 10. **Frontend: InlineReviewGutterCell + InlineReviewEditor** — Gutter cells
|
||||
with "+" on hover, editor textarea anchored below the target line.
|
||||
|
||||
- [ ] 11. **Frontend: InlineReviewThread** — Comment thread display below diff lines.
|
||||
Collapsible, shows body + timestamp + edit/delete.
|
||||
|
||||
- [ ] 12. **Frontend: Integrate comments in GitDiffView** — Wire gutter cells,
|
||||
editor, and thread into the diff line rendering.
|
||||
|
||||
- [ ] 13. **Frontend: File editing in RightRail** — Double-click file → inline
|
||||
textarea → Save/Cancel → write_file API → tree refresh.
|
||||
|
||||
- [ ] 14. **Build + smoke test** — Verify `pnpm -C apps/web build` and
|
||||
`pnpm -C apps/server build`. Run all QA scenarios.
|
||||
Reference in New Issue
Block a user