feat: Ensure 06-First Draft folder is expanded in file list when opening projects

- Add explicit code in open_workspace to ensure manuscript folder is not collapsed
- Update README to clarify that project root is opened with manuscript folder expanded
- Keep workspace at project root but ensure file list shows 06-First Draft expanded

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
2026-09-13 09:08:26 -05:00
parent caa0001922
commit 9f575c7c7e
2 changed files with 9 additions and 6 deletions
+5 -6
View File
@@ -503,12 +503,11 @@ to the template as the `project_name`, `author` and `description` variables.
Nothing is written until you press **Create**; generation runs in the background, Nothing is written until you press **Create**; generation runs in the background,
so a template whose hooks talk to the network doesn't freeze the editor. so a template whose hooks talk to the network doesn't freeze the editor.
When it finishes, the app opens the project's **`06-First Draft`** subfolder as When it finishes, the app opens the project root as the workspace,
the workspace — that is where the snowflake template keeps the chapter files, in with the **`06-First Draft`** folder (where the snowflake template keeps the
`Act 1/`, `Act 2/` and `Act 3/` subfolders that the chapter files in `Act 1/`, `Act 2/` and `Act 3/` subfolders) automatically
[folder tree](#organising-with-folders) shows directly. If the template didn't expanded in the file list. If the template didn't produce that folder, the
produce that folder, the project root is opened instead and the status bar says status bar notes that nothing is marked as the manuscript.
so.
A folder only appears in the file panel once it holds a `.md` file — the A folder only appears in the file panel once it holds a `.md` file — the
template's empty acts are held open with `.gitkeep`, which is not markdown, so template's empty acts are held open with `.gitkeep`, which is not markdown, so
+4
View File
@@ -91,6 +91,10 @@ impl App {
self.load_characters(); self.load_characters();
self.autocomplete = None; self.autocomplete = None;
self.collapsed.clear(); self.collapsed.clear();
// Ensure the manuscript folder (e.g., 06-First Draft) is always expanded
if let Some(ref dir) = self.manuscript_dir {
self.collapsed.remove(dir);
}
if let Some(idx) = first_listed(&self.files, self.manuscript_dir.as_deref()) { if let Some(idx) = first_listed(&self.files, self.manuscript_dir.as_deref()) {
self.select(idx); self.select(idx);
} }