Skip to content

Enhancement : Keep the view in sync without a window reload - #85

Open
Sillot wants to merge 2 commits into
dionmunk:masterfrom
Sillot:feat/live-refresh
Open

Enhancement : Keep the view in sync without a window reload #85
Sillot wants to merge 2 commits into
dionmunk:masterfrom
Sillot:feat/live-refresh

Conversation

@Sillot

@Sillot Sillot commented Aug 11, 2026

Copy link
Copy Markdown

Selecting a different storage location used to prompt for a window reload, and
the Notes view showed nothing from the new folder until it was accepted. The tree
now applies the change in place, and keeps itself in sync with what is on disk.

Changes

  • The storage location and notes.notesExtensions apply immediately, no reload
  • Notes and folders added or removed outside of the window are picked up on their own
  • New Reveal in File Explorer on the context menu of a note or a folder
  • Picking a storage location now saves it in the workspace settings by default,
    or in your own editor settings, so a personal path need not land in a
    .vscode/settings.json that gets committed
  • newNote, newFolder and deleteNote called refresh() outside their fs
    callbacks, so new items only showed up after a manual refresh

New settings

Setting Default
notes.storeLocationInWorkspace true
notes.watchExternalChanges true
notes.watchIntervalSeconds 5 (one of 2, 3, 5, 10, 30)

Notes for review

  • A file system watcher alone is not enough: a storage location on a synced
    folder, or on a Windows drive seen from WSL, never delivers events. The open
    folders are polled too — one readdir each, ~10 ms per folder in that slow
    case, and nothing at all while the view is hidden.
  • Tree items now carry a stable id. Without it an automatic refresh collapses
    whatever folders the user had opened.
  • notes.storeLocationInWorkspace is scope: application on purpose: it is a
    preference about where your own settings live, so a repository must not be
    able to set it.
  • On WSL, revealFileInOS receives a Linux path and fails silently, so the path
    goes through wslpath -w and explorer.exe instead.
  • The .eslintrc.json, tsconfig.json and vscode-test changes are unrelated
    to the feature: npm test could not run at all before them.

Testing

npm test covers the change detection, and the whole thing was exercised by hand
in an Extension Development Host.

The features were made with an AI Agent.

Sillot added 2 commits August 11, 2026 13:29
Changing the storage location used to ask for a window reload before the
Notes view would show anything from the new folder. The tree now applies
the change in place, and keeps itself in sync with what is on disk.

- the storage location and the allowed extensions apply immediately
- notes and folders added or removed outside of the window are picked up:
  file system events where they arrive, and a poll of the open folders,
  which is what covers synced and Windows folders where none ever do
- the view refreshes once a create or delete has actually completed on
  disk, rather than before the write
- reveal a note or folder in the file explorer of the operating system,
  going through explorer.exe on WSL where the built-in command hands a
  Linux path to Windows
- tree items carry a stable id, so an automatic refresh no longer
  collapses the folders the user had opened

Also unblocks the test setup, which could not run: an eslint rule dropped
upstream, dependency typings failing the build, the renamed vscode-test
package, and the ELECTRON_RUN_AS_NODE that VS Code exports into the
terminals it spawns.
Picking a storage location always wrote it to the user settings. It can now
go to the workspace settings instead, which is the default, so a folder of
notes can travel with the project.

notes.storeLocationInWorkspace turns that off for anyone who would rather
keep a personal path out of a .vscode/settings.json that ends up committed.
It is scoped to the application, so a repository cannot set it back.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant