Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
df86338
docs: design spec for closable right slot and file preview pane
SPhillips1337 Nov 30, 2026
a1ebb71
docs: implementation plan for closable right slot and preview
SPhillips1337 Nov 30, 2026
677d716
feat(layout): add right-slot modes and collapsed grid
SPhillips1337 Nov 30, 2026
f70671a
feat(preview): file-type classifier and preview payload types
SPhillips1337 Nov 30, 2026
1c5268f
feat(preview): bounded main-process preview reader
SPhillips1337 Nov 30, 2026
fe58078
fix(preview): accumulate short reads in text preview
SPhillips1337 Nov 30, 2026
22c24d2
feat(preview): expose preview and web-link IPC
SPhillips1337 Nov 30, 2026
a27c573
feat(preview): react preview pane for images, text, markdown and code
SPhillips1337 Nov 30, 2026
a092176
fix(preview): key pane fetch to path and reset stale state
SPhillips1337 Nov 30, 2026
0e97dbe
feat(preview): right slot modes, follow-selection and cross-pane guards
SPhillips1337 Nov 30, 2026
83614c5
fix(preview): explicit preview target wins; disable F5/F6 without a l…
SPhillips1337 Nov 30, 2026
af695a1
fix(preview): follow first selection after an empty preview open
SPhillips1337 Nov 30, 2026
5b2f039
docs: ADR-0006 and preview-slice progress
SPhillips1337 Nov 30, 2026
9a44c9c
fix(preview): clear stale targets, bound image decode, close guard gaps
SPhillips1337 Nov 30, 2026
fad858e
fix(thumbnails): probe a 1 MiB JPEG header window
SPhillips1337 Nov 30, 2026
fc80b8c
chore: release v0.3.1
SPhillips1337 Nov 30, 2026
a9af259
chore: record spine memories for preview-pane slice
SPhillips1337 Nov 30, 2026
f819f00
fix: hide Open action for symlink preview refusals
SPhillips1337 Nov 30, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
kind: checkpoint
created: 2026-11-30T12:19:30Z
agent: cursor
sha: 22c24d2
branch: feat/preview-pane
task_id: 4
verification: {V0: pass, V1: pass}
id: 2026-11-30T1219Z-task-4-of-preview-pane-plan-safeexternalurl-help
---
# Checkpoint: Task 4 of preview-pane plan: safeExternalUrl helper, fs:preview and shell:openU…

## Summary

Task 4 of preview-pane plan: safeExternalUrl helper, fs:preview and shell:openUrl IPC channels, preload + FileManApi types. Committed 22c24d2.

## Done

- src/shared/open-url.ts with safeExternalUrl (http/https only, no credentials, <=2048 chars)
- tests/open-url.test.ts (3 tests, RED then GREEN)
- main.ts handlers fs:preview (readPreview) and shell:openUrl (validated shell.openExternal)
- preload.cjs previewFile/openExternalUrl; types.ts previewFile/openExternalUrl + preview type re-exports
- Full suite 240 passed / 1 skipped, typecheck clean

## Next

- Task 5: PreviewPane component and styles
- Task 6: App wiring, guards, context menu, toolbar
- Task 7: ADR, docs, full verification and smoke

## Blockers

- (none)

## Decisions

- (none)
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
kind: checkpoint
created: 2026-11-30T12:56:11Z
agent: qoder
sha: fad858e
branch: feat/preview-pane
task_id: preview-pane
paths: [.superpowers/sdd/2026-11-30-preview-pane/progress.md, docs/adr/0006-right-slot-modes-and-preview.md, docs/superpowers/specs/2026-11-30-preview-pane-design.md]
verification: {V0: pass, V1: pass, V2: pass, V3: skip, V4: skip}
id: 2026-11-30T1256Z-preview-pane-slice-complete-on-branch-feat-previ
---
# Checkpoint: Preview pane slice complete on branch feat/preview-pane (13 commits, a1ebb71..f…

## Summary

Preview pane slice complete on branch feat/preview-pane (13 commits, a1ebb71..fad858e). Right slot is browse|preview|closed; bounded fs:preview IPC with 32 MiB/4096 px/1 MiB caps, binary sniff, symlinks refused, pre-decode 40 MP header probe on the sync fallback; markdown without raw HTML, http(s)-only external links; F5/F6 + cross-pane guards when the peer isn't a listing. All 7 tasks passed per-task review; final whole-branch review fixed 2 Important + 6 minors; residual JPEG probe window fixed after re-review.

## Done

- T1 right-slot layout state + preview-path persistence
- T2 preview classifier + shared types
- T3 bounded main-process reader
- T4 URL helper + IPC (fs:preview, shell:openUrl)
- T5 PreviewPane + styles (react-markdown, remark-gfm)
- T6 slot lifecycle, follow-selection, context menu, toolbar guards
- T7 ADR-0006, SPEC M11-M13, ROADMAP D18/P3.7, PROGRESS
- Final review fixes: stale target clearing, 40 MP pre-decode bound, guard sweep, docs wording, 1 MiB JPEG probe window
- npm run ci at fad858e: typecheck clean, 36 files / 260 passed / 1 skipped, build OK

## Next

- Owner manual smoke (10-point checklist) on a real display
- Finish branch: merge to main / open PR / keep (user decision)
- Deferred minors in .superpowers/sdd/2026-11-30-preview-pane/progress.md

## Blockers

- Manual UI smoke not runnable in this environment (no display) — owner pass pending

## Decisions

- Explicit 'Preview in Pane' target beats the 180 ms follow-selection on slot entry
- Pre-decode pixel bound (40 MP) only on the synchronous createFromPath fallback; OS thumbnailer path unchanged
- Follow-selection clears previewTarget to null when no left selection (spec empty state)
1 change: 1 addition & 0 deletions PROGRESS.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ Open check: builtin Whisper model download under the narrowed CSP `connect-src`
- In-app name dialog replaces `window.prompt` (Electron never implements it): New Folder, New File type/name, Rename (F2) and favorite naming now work in both panes; inline validation, Esc/Cancel aborts, new folders land selected
- Explorer-style drag-drop inside and between panes: drag = move, Ctrl = copy, Shift = force move, cross-drive defaults to copy; targets are folder rows/tiles, pane background, ".." and breadcrumbs; whole-selection drag; both panes refresh and the transcript logs each op; same-folder moves and drops into a folder's own subtree are no-ops
- Name dialog + drag-drop rules covered by 24 new tests (188 total); `npm run ci` passes; verified in a real hidden Electron window against a temp filesystem: 14/14 UI checks (dialog in the right pane, invalid-name error, Esc cancel, F2 rename, cross-pane move, Ctrl copy, folder-row drop, same-folder no-op)
- Closable right slot with a read-only preview: images, text, Markdown (no raw HTML) and source code follow the left selection through one bounded `fs:preview` channel (32 MiB image / 1 MiB text caps, binary sniff, symlinks refused); HTML shows as source; F5/F6 and cross-pane drops disable when the peer isn't a listing

## Next

Expand Down
2 changes: 2 additions & 0 deletions ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Repo: [HappyMonkeyAI/ZeroGFileMan](https://github.com/HappyMonkeyAI/ZeroGFileMan
| D15 | Split layouts | Side-by-side / stacked + maximize; draggable gutter |
| D16 | Terminal launcher pref | System / ZeroG Term / custom command from Settings |
| D17 | App updates | Consent-based GitHub release checks; NSIS installs, portable notifies |
| D18 | Closable right slot + file preview | P3.7 preview pane; F5/F6 guard |

## Near-term (ordered)

Expand Down Expand Up @@ -70,6 +71,7 @@ Repo: [HappyMonkeyAI/ZeroGFileMan](https://github.com/HappyMonkeyAI/ZeroGFileMan
| P3.4 | Column sort | Name / size / modified click-to-sort; persist per pane | done |
| P3.5 | Listing view modes | Explorer-style **Details** / **Icons** / **Thumbnails**; per-pane toolbar; **Ctrl+wheel** zooms icon/thumbnail size | done |
| P3.6 | Drive picker | Dropdown next to drive letter in pane path; lists mounted Windows roots | done |
| P3.7 | Right-slot preview | Close/reopen; images, text, Markdown, code; bounded IPC caps | done |

### P4 — Packaging & polish

Expand Down
3 changes: 3 additions & 0 deletions SPEC.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ Local dual-pane file browser for developers with push-to-talk **Navigate** and *
| M8 | Action jewel: copy path / copy / cut / paste / delete / rename / new folder / open / notepad / cursor / terminal / reveal / refresh |
| M9 | Favorites jump (Home / Documents / development when present); add/remove; persist in userData |
| M10 | `typecheck`, unit tests, and `build` pass |
| M11 | Right pane closes (left fills the window) and reopens as a listing or a preview |
| M12 | Right pane previews images, text, Markdown (sanitized) and source code; HTML shows as source |
| M13 | Copy/move-to-other and cross-pane drops are disabled with a hint when the other pane is not a listing |

## Voice modes

Expand Down
39 changes: 39 additions & 0 deletions docs/adr/0006-right-slot-modes-and-preview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# 0006 — Right slot modes and main-process file preview

- **Status:** Accepted
- **Date:** 2026-11-30

## Context

The workspace had two fixed directory listings. Users asked to close the right
pane and to preview files (images, text, Markdown, code) in it instead of
launching an external app for a glance.

## Decision

1. The right slot is `browse | preview | closed`, persisted with the workspace
layout. Left stays a listing; closing the right slot collapses the grid to
one cell and never leaves a maximized ghost.
2. `FilePane` remains listing-only. A separate `PreviewPane` renders previews;
preview follows the left listing's selection (180 ms debounce, primary of a
multi-selection).
3. One IPC channel, `fs:preview`, classifies, validates and reads in main and
returns a discriminated payload. Caps live only in main: 32 MiB images at a
4096 px display edge, plus a pre-decode pixel bound (40 MP) on the
synchronous decode fallback, 1 MiB text with a truncation flag, NUL-byte
binary sniff, regular files only, symlinks refused.
4. Markdown renders with `react-markdown` + `remark-gfm` and no raw HTML.
HTML/XML files are shown as source. Remote images stay blocked by CSP.
Markdown links open through `shell:openUrl`, which accepts only http(s).
5. When the opposing pane is not a listing, F5/F6, Copy→/Move→, cross-pane
drops and the context-menu transfer items are disabled. No retargeting into
an invisible folder.

## Consequences

- Preview is read-only; editing stays in external editors (ZeroG Edit, Notepad,
Cursor) through the existing file-app associations.
- PDF, audio, video, SVG and syntax highlighting are deferred; they need a
custom protocol or a heavier renderer.
- The slot union leaves room for a future Terminal tab without another model
change.
Loading