feat(file-ops): add create, rename, and delete for files and folders #3

Merged
addison merged 18 commits from dev-bot/notebook:feat/file-operations into main 2026-05-30 12:38:59 -04:00
Collaborator

Adds full file management operations to the sidebar:

  • New file — inline input in any folder or root, auto-appends .md
  • New folder — inline input in any folder or root
  • Rename file / folder — inline rename input replacing the tree row name
  • Delete file / folder — with window.confirm() confirmation

UX

  • Hover a tree row to reveal + (folder rows) and (context menu) buttons
  • A + button also appears next to the folder name in the sidebar header for root-level creation
  • Inline inputs sit directly in the tree (VS Code style) — Enter to confirm, Escape to cancel
  • After any operation the workspace refreshes; active file follows renames

Implementation

  • New helper functions in repo-browser.ts: createFile, createDirectory, renameFile, renameDirectory, deleteFile, deleteDirectory
  • Rename = copy content + delete old (File System Access API has no native rename)
  • Directory rename recursively copies all entries then removes the old directory
Adds full file management operations to the sidebar: - **New file** — inline input in any folder or root, auto-appends `.md` - **New folder** — inline input in any folder or root - **Rename file / folder** — inline rename input replacing the tree row name - **Delete file / folder** — with `window.confirm()` confirmation ### UX - Hover a tree row to reveal `+` (folder rows) and `…` (context menu) buttons - A `+` button also appears next to the folder name in the sidebar header for root-level creation - Inline inputs sit directly in the tree (VS Code style) — Enter to confirm, Escape to cancel - After any operation the workspace refreshes; active file follows renames ### Implementation - New helper functions in `repo-browser.ts`: `createFile`, `createDirectory`, `renameFile`, `renameDirectory`, `deleteFile`, `deleteDirectory` - Rename = copy content + delete old (File System Access API has no native rename) - Directory rename recursively copies all entries then removes the old directory
- Replace oversized 64px header with slim 48px app bar
- Implement full-viewport app shell (header + sidebar + editor, no page scroll)
- Sidebar: 240px fixed width, collapses to 44px rail with smooth CSS transition
- Sidebar shows repo name or 'Local draft' icon, file tree with search, footer count
- Rail mode: › toggle button + vertical 'DRAFT' hint text
- Remove always-visible notice bar; errors shown inline in header only
- Editor area: no card chrome, max-width 760px centered canvas (iA Writer style)
- Status bar: slim 28px bottom bar with save status + file path
- Local draft state: centered doc icon + label + hint, '+ Open folder' CTA
- Keep all TypeScript logic 100% intact (repo browser, autosave, etc.)
- Update app.css: html/body fill viewport with overflow:hidden for proper shell

Co-authored-by: Shelley <[email protected]>
Co-authored-by: Shelley <[email protected]>
Co-authored-by: Shelley <[email protected]>
Co-authored-by: Shelley <[email protected]>
Co-authored-by: Shelley <[email protected]>
Co-authored-by: Shelley <[email protected]>
Co-authored-by: Shelley <[email protected]>
Co-authored-by: Shelley <[email protected]>
Co-authored-by: Shelley <[email protected]>
Commenting is not possible because the repository is archived.
No reviewers
No labels
No milestone
No assignees
2 participants
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kwila/notebook!3
No description provided.