Skip to content

feat: show unsupported files in the article navigator - #667

Merged
Azganoth merged 1 commit into
mainfrom
feature/unsupported-navigator-files
Oct 10, 2026
Merged

Azganoth merged 1 commit into
mainfrom
feature/unsupported-navigator-files

Conversation

@Azganoth

Copy link
Copy Markdown
Owner

Summary

The article navigator listed only Markdown files and directories, so a folder holding images, PDFs, or other files looked empty. It now lists every non-ignored regular file and mutes those Leafdown cannot open, without widening which files Leafdown edits.

  • The folder scan reports non-Markdown files as a new unsupportedFile node kind rather than reusing file, so every existing file consumer (opening, the article count and filter, folder search and replace, wiki-link completion, index lookup, isEmpty) stays Markdown-only. The scan also skips Leafdown's *.leafdown-tmp save staging files, which a scan racing a save would otherwise list.
  • Unsupported rows are muted with a generic file icon, and their tooltip and aria-description say "Leafdown can only open Markdown files." Click, Enter, and Space only focus the row. They sort among articles under the chosen order, so a folder holding only such files expands while an empty folder has nothing to expand.
  • Their context menu offers New file, New folder, Open file location, Copy path, and Copy relative path. Open, Rename, and Delete are left out: the backend already refuses to rename or trash non-Markdown files, and this change does not broaden that.
  • The folder watcher treats an unsupported file as relevant when it appears, vanishes, or is renamed, but not when it is written to, so a growing log or export does not rescan the folder on every write. Under modified-date order such a file moves at the next refresh instead. The vanished-path payload field becomes possibleEntryPaths, and the navigator refreshes when one names any entry it shows, not only a directory.

Related Issue

Closes #649

Verification

  • Rust scan tests prove that mixed, unsupported-only, and genuinely empty folders are told apart, that ignore, symlink, and staging-file rules hold for unsupported files, that they sort among articles under every order, and that one is never opened as an index. Watcher tests prove which unsupported-file events refresh and which do not, and a contract test pins the serialized node kinds.
  • Navigator tests prove that unsupported rows are described, focusable, and never opened by pointer or keyboard, that the article count and filter ignore them, that the empty-folder message sits beside them, and that their menu omits Open, Rename, and Delete. Watcher hook and folder search workflow tests prove a vanished unsupported file refreshes the tree and that searches never read one.
  • pnpm check passed.

Not verified: the new folder-watcher desktop test, which creates and deletes real files and checks rows and activation, was not run locally, and neither was the image fixtures' move. The app was not run, so the muted styling was not checked visually. Scan and render cost for folders with many non-Markdown files, such as a photo library, was not measured.

Notes

  • The rendered-images fixtures moved into their own folder because the navigator now lists their SVGs, and any extra row at the shared fixture root pushes document-lifecycle's target out of the virtualized list that findTreeItem searches without scrolling.

The rendered-images fixtures move into their own folder because the
navigator now lists their SVGs, and any extra row at the shared fixture
root pushes document-lifecycle's target out of the virtualized list that
findTreeItem searches without scrolling.
@Azganoth Azganoth added the Feature New feature or request label Oct 10, 2026
@Azganoth Azganoth self-assigned this Oct 10, 2026
@Azganoth
Azganoth enabled auto-merge (squash) October 10, 2026 17:13
@Azganoth
Azganoth merged commit c1d922e into main Oct 10, 2026
3 checks passed
@Azganoth
Azganoth deleted the feature/unsupported-navigator-files branch October 10, 2026 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Show unsupported files in the article navigator as non-openable entries

1 participant