diff --git a/.changeset/file-viewer-show-hidden.md b/.changeset/file-viewer-show-hidden.md new file mode 100644 index 00000000..cab3ddf1 --- /dev/null +++ b/.changeset/file-viewer-show-hidden.md @@ -0,0 +1,23 @@ +--- +'aicodeman': patch +--- + +The File Viewer can show hidden files and folders. + +`GET /api/sessions/:id/files` has always accepted `showHidden=true`, but the panel +hardcoded `showHidden=false`, so dot-prefixed entries were unreachable from the +tree: no `.gitignore`, no `.github/`, no `.env.example`, and nothing under them. +Opening one meant guessing its path. + +The panel header gains a `.*` toggle. It re-fetches rather than re-rendering the +cached tree, because the filtering happens server-side, and it keeps the expanded +directories so toggling does not collapse the tree you just navigated. The state +is per-device (its own `codeman:fileBrowserShowHidden` key rather than the +app-settings object, which is rebuilt from the settings-modal DOM on save and +would drop a key toggled from outside it), defaults to OFF, and survives a reload. + +Generated and version-control directories (`.git`, `node_modules`, `.next`, +`.venv`, ...) stay excluded either way: that list is about tree size, not about +hiding dotfiles. + +Closes #221. diff --git a/src/web/public/app.js b/src/web/public/app.js index f4f95e23..e04b7088 100644 --- a/src/web/public/app.js +++ b/src/web/public/app.js @@ -622,6 +622,11 @@ class CodemanApp { this.fileBrowserFilter = ''; this.fileBrowserAllExpanded = false; this.fileBrowserDragListeners = null; + // Show hidden (dot-prefixed) files and folders in the File Viewer tree. + // Per-device, persisted to its own localStorage key by panels-ui.js. Safe to + // call a mixin method here: instantiation is deferred to DOMContentLoaded, + // so every module's Object.assign has already run. + this.fileBrowserShowHidden = this._loadFileBrowserShowHidden?.() ?? false; this.filePreviewContent = ''; // Toast container cache (methods in panels-ui.js) diff --git a/src/web/public/index.html b/src/web/public/index.html index bba6dbd6..18c19fc3 100644 --- a/src/web/public/index.html +++ b/src/web/public/index.html @@ -411,6 +411,7 @@