Focused Explorer Accordion
unlistedby Tushar Sharma
Keep one folder expanded at a chosen depth in each native File Explorer pane.
Focused Explorer Accordion
Keep one folder open at your chosen depth while preserving the rest of your Obsidian File Explorer layout.
Why
Large vaults often leave many unrelated folders expanded. Focused Explorer Accordion applies an exclusive accordion policy at one folder depth without replacing Obsidian's native File Explorer or forcing every level into a single active branch.
Focus depth: H2
H1 Projects stays as it was
├─ H2 Active project expanded
│ ├─ H3 Notes independent
│ └─ H3 Resources independent
└─ H2 Other project collapsed
H1 Archive stays as it was
└─ H2 Previous project collapsed
Features
- Root, section, deep, and custom focus depths.
- One active focus-level folder per File Explorer pane.
- Independent behaviour across multiple explorer panes.
- Optional preservation or reset of nested expansion state.
- Exact folder exclusions that cover the selected subtree.
- Mouse, keyboard, auto-reveal, workspace restoration, and plugin-driven expansion detection.
- Commands to suspend automatic behaviour or enforce it immediately.
- No changes to notes, folders, sorting, icons, colours, or other vault content.
Settings
Focus depth
- Root focus controls root-level folders (H1).
- Section focus controls second-level folders (H2).
- Deep focus controls third-level folders (H3).
- Custom depth accepts any positive folder depth.
Only the configured depth is exclusive. Shallower levels retain their current state, and deeper levels inside the active folder remain independently usable.
Nested folder state
- Remember collapses only the competing focus-level folder. Its nested layout returns when reopened.
- Reset collapses expanded descendants before closing the competing folder.
Excluded folders
An excluded folder and its descendants are ignored by automatic accordion behaviour. An excluded folder neither triggers nor receives an automatic collapse.
Commands
- Focused Explorer Accordion: Toggle automatic accordion suspends or resumes automation for the current Obsidian session.
- Focused Explorer Accordion: Enforce accordion now focuses the active note branch, falling back to the most recently expanded eligible folder.
No command has a default hotkey.
Installation
Once accepted into the Community directory, install the plugin from Settings → Community plugins → Browse.
For local testing, copy main.js and manifest.json into:
<vault>/.obsidian/plugins/explorer-accordion/
Development
Focused Explorer Accordion is implemented in modern JavaScript with JSDoc static checking.
npm install
npm run check
npm run build
Use a dedicated development vault. The ignored .test-vault/ directory can be used for local testing.
Compatibility and maintenance
Obsidian does not currently expose a public API for native File Explorer expansion state. The plugin therefore isolates its minimal DOM integration behind one adapter. If an Obsidian update changes the explorer markup, the plugin fails closed for the affected pane instead of guessing or modifying vault content.
The first release supports desktop Obsidian. Mobile support requires separate validation and is not claimed.
Privacy
The plugin works locally. It has no telemetry, network requests, external service, or access to note contents.
License
For plugin developers
Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.