You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The only way to browse and read arbitrary files on disk is to leave the terminal and open VS Code (or similar) just for the sidebar file tree. Notebook should support this workflow natively — a directory mode that shows a file listing on the left and file contents on the right.
Context
The browser (internal/browser/browser.go) currently uses a single-column layout with level-based navigation (level: 0 = notebooks, level: 1 = notes). There's no split-pane layout anywhere in the codebase. The editor has a read-only view mode (viewMode flag) with markdown rendering that could be reused for file preview.
Key existing patterns to build on:
Mode flags: showHelp, themeMode, inputMode — cascading boolean flags that control rendering and input precedence
Filtered indirect access: cursor → filtered[] → data source — used for all list navigation
Async loading: message types like notebooksLoadedMsg + tea.Cmd functions
Preview pane: showPreview already appends inline previews to note lines — but this needs a true side-by-side layout
Selection return: Selection.FilePath already exists for external file paths
Related: #178 (open external files via i key) — directory mode would complement or subsume that.
Approach
Create a new internal/filebrowser/ package with its own Bubble Tea Model. Wire it into the app as a separate program (same pattern as browser ↔ editor), entered via a keybind from the browser (e.g., d for directory).
Problem
The only way to browse and read arbitrary files on disk is to leave the terminal and open VS Code (or similar) just for the sidebar file tree. Notebook should support this workflow natively — a directory mode that shows a file listing on the left and file contents on the right.
Context
The browser (
internal/browser/browser.go) currently uses a single-column layout with level-based navigation (level: 0= notebooks,level: 1= notes). There's no split-pane layout anywhere in the codebase. The editor has a read-only view mode (viewModeflag) with markdown rendering that could be reused for file preview.Key existing patterns to build on:
showHelp,themeMode,inputMode— cascading boolean flags that control rendering and input precedencefiltered[]→ data source — used for all list navigationnotebooksLoadedMsg+tea.CmdfunctionsshowPreviewalready appends inline previews to note lines — but this needs a true side-by-side layoutSelection.FilePathalready exists for external file pathsRelated: #178 (open external files via
ikey) — directory mode would complement or subsume that.Approach
Create a new
internal/filebrowser/package with its own Bubble TeaModel. Wire it into the app as a separate program (same pattern as browser ↔ editor), entered via a keybind from the browser (e.g.,dfor directory).Architecture
Split-pane layout (lipgloss):
Key behaviors
..entry at top.mdfiles$EDITORor return to browser with file path/: filter files in current directory (reuse existing filter pattern)p: toggle preview pane (like browser'sshowPreview)y: copy file path to clipboard (reuseinternal/clipboard)File preview handling
j/kor arrow keys in right paneTasks
internal/filebrowser/package withModelstruct — dir path, entries, cursor, filtered indices, preview content, scroll offsetos.ReadDir()loading via asynctea.Cmdmessage patternView()with lipgloss — sidebar file list + content pane, responsive to terminal width..parent traversalfiltering/filtered[]pattern from browser)yto copy path)cmd/— launch from browser via keybind, handle returntheme.Current()Acceptance criteria
..at top