Commit Graph

5 Commits (383a9546df6b1413af3129e0a7c991d0e861024e)

Author SHA1 Message Date
mirivlad 383a9546df fix: inline file editor mode in FilesTab, remove separate TextFileEditor
- Replace separate TextFileEditor modal with inline editor mode in FilesTab
- Editor mode replaces browser mode (file list) within the same .files-tab container
- Markdown files: view/edit/split modes using existing MarkdownEditor + MarkdownPreview
- Plain text files: readonly monospace viewer
- Linked .md notes → note editor (via CheckFileAction)
- Unlinked .md / text files → inline editor (not FilePreviewModal)
- FilePreviewModal only for images, PDF, binary
- Back button returns to file browser without losing folder state
- Reset editor state on selectedNode change
- Remove TextFileEditor.svelte (no longer needed)

Co-Authored-By: OWL (Hermes Agent) <hermes@nousresearch.com>
)
2026-06-16 09:51:25 +08:00
mirivlad d7d806530b feat: TextFileEditor for text/markdown files, fix menu positioning
- Create TextFileEditor.svelte: full editor/viewer for text files
  - Markdown: edit/preview/split modes with MarkdownEditor + MarkdownPreview
  - Plain text: readonly monospace viewer
  - Footer: external open button + save (markdown) + close
- Rewrite _openFile in FilesTab: text/markdown → TextFileEditor, images/PDF → FilePreviewModal
- Linked .md notes → note editor (via CheckFileAction)
- Unlinked .md / text files → TextFileEditor (not FilePreviewModal)
- Fix toggleMenu in FileTreeRow: position using getBoundingClientRect
- Expand codeNames/textMimes for all text file types
- Add debug logs for file open flow and menu positioning

Co-Authored-By: OWL (Hermes Agent) <hermes@nousresearch.com>
2026-06-16 09:26:44 +08:00
mirivlad 82f59ab8da fix: FilesTab empty state, button styles, text preview, menu positioning
- Add reactive $: block in FilesTab to auto-load files on selectedNode change
- Copy .btn/.btn-primary/.btn-sm styles into NotesTab.svelte and FilesTab.svelte (scoped CSS)
- Fix FilePreviewModal: render .md with MarkdownPreview, text files in <pre><code>, external open in footer
- Expand codeNames/textMimes in fileUtils.js to cover all text file types
- Add fallback text read for unknown file types in _openPreview
- Fix toggleMenu in FileTreeRow: position menu near button using getBoundingClientRect
- Add debug logs for file open flow and menu positioning
- Add tabindex+keydown to MarkdownPreview div (a11y partial fix)

Co-Authored-By: OWL (Hermes Agent) <hermes@nousresearch.com>
2026-06-16 09:08:13 +08:00
mirivlad 58cdd61d27 refactor(frontend): extract NotesTab safely
- New component: frontend/src/lib/components/notes/NotesTab.svelte
  - Owns notes list UI, create-note form, note cards with rename/delete
  - Props: notes array, formatDate
  - Events: submitCreateNote, openNote, startRename, deleteNote

- App.svelte changes:
  - Removed inline notes tab markup (replaced with <NotesTab>)
  - Removed showCreateNote, newNoteTitle state variables
  - Removed openCreateNote, cancelCreateNote, submitCreateNote functions
  - Added _handleSubmitCreateNote() event handler from NotesTab
  - Removed notes-related CSS (notes-tab, note-card, note-action-*)
  - Fixed import paths in FilesTab (../../ instead of ../ for lib/ files)

- Build: npm run build , go test ./... , build.sh gui 
2026-06-16 03:21:49 +08:00
mirivlad acdbbdfa55 refactor(frontend): extract FilesTab safely
- New component: frontend/src/lib/components/files/FilesTab.svelte
  - Owns all file tab state: loadingFiles, currentFolderId, folderStack,
    fileItems, preview*, clipboard, selectedIds, dragIds, importing, importSummary, etc.
  - Public API via bind:this: resetToNode(), addFile(), loadFolder(),
    openFileById(), focusItem(), handleFilesKeydown(), resetState()
  - Events: openNote, refreshParent, error
  - Inline modals: rename, confirm, import dialog, file preview

- App.svelte changes:
  - Removed all file-specific state variables and functions
  - Preview state renamed to trashPreview* (for trash preview only)
  - Files tab inline markup replaced with <FilesTab> component
  - Overview 'Add file' button delegates to filesTabRef.addFile()
  - openInboxArtifact, navigateToFile, openActivityTarget, openSearchResult
    delegate to filesTabRef for file operations
  - Node rename (tree context menu) uses separate openNodeRename/submitNodeRename
    functions (file rename is now in FilesTab)
  - closeTrashPreview for trash file preview modal

- Build: npm run build , go test ./... , build.sh gui 
2026-06-16 03:00:24 +08:00