Commit a4509b3
authored
* feat(settings): collapsible sections (closes #430 foundation)
Adds a `createCollapsibleSection` helper backed by native `<details>`/`<summary>`
elements and converts all existing `.setHeading()` calls across the eight
`settings-*.ts` files. A new "General" wrapper covers the previously un-headed
top of `settings-general.ts` (provider, API key, models, etc.).
Expand/collapse state is persisted in `expandedSettingsSections: string[]` on
the plugin settings, so the user's chosen layout survives plugin reloads. All
sections are collapsed by default per the issue plan; advanced sections only
render after the existing "Show Advanced Settings" toggle.
Provider change in the General section now re-renders only that section's
content, fixing a latent bug where it would tear down later-rendered sections
(UI Settings, Context Management, Advanced) by emptying the outer container.
Modal extractions for Tool Permissions, MCP Servers, and Vault Search Index
are intentionally deferred to follow-up PRs per the issue plan.
* feat(settings): section descriptions, always-open General, advanced badges
Iterates on the collapsibles foundation in response to PR review:
- Each section header now includes a short description visible whether the
section is open or closed, so users can scan what each section does
without expanding it.
- "General" is no longer collapsible — it's always open at the top of the
tab and contains only the setup essentials (provider, API key, models).
Debug Mode and the Show Advanced Settings toggle moved into General; the
separate Advanced Settings heading + button block is gone.
- Advanced sections (Custom Prompts, API Configuration, Tool Execution,
Tool Permissions, Tool Loop Detection, MCP Servers) now render with an
ADVANCED pill next to the title when revealed via Show Advanced Settings.
- Vault Search Index is promoted out of advanced — it always renders, and
the (Experimental) label is dropped from the title, README, and FAQ.
- Plugin State Folder relocates from General to Session History; Your Name
and Summary Frontmatter Key relocate to the User Experience section
(renamed from "UI Settings" to better reflect its broader scope).
- New `createAlwaysOpenSection` helper for the General header so the
always-open variant reuses the same heading + description styling without
a `<details>` wrapper or chevron.
Tests updated for the new render order: Vault Search renders unconditionally;
advanced-only sections (API/Tools/MCP) remain hidden until the toggle is on.
* feat(settings): combine Tasks+Hooks into Automation, add Debug section, restructure General
Iterates again on the layout in response to PR review:
- Drop the "Model Versions" info row from General — it was a static
documentation link that didn't belong as a setting.
- Plugin State Folder moves back into General (was briefly relocated to
Session History).
- Session History collapses into the User Experience section as a single
Enable Session History toggle; the standalone Session History section is
removed. Plugin State Folder is no longer duplicated there.
- Reorder collapsible sections so User Experience is first under General,
matching where users will look most often.
- New "Automation" collapsible (`src/ui/settings-automation.ts`) merges the
Scheduled Tasks and Lifecycle Hooks sections into one; both are features
that run AI agent work automatically.
- New "Debug" advanced collapsible (`src/ui/settings-debug.ts`) collects
Debug Mode (moved out of General), Show Token Usage (moved out of Context
Management), and Stop on Tool Error (moved out of Tool Execution). The
Tool Execution section is removed entirely — its sole setting now lives
in Debug.
Final order: General → User Experience → Automation → Context Management →
Vault Search Index → (advanced) Custom Prompts → API Configuration →
Tool Permissions → Tool Loop Detection → MCP Servers → Debug.
Tests, docs, and the display-race regression test updated for the new
section list.
* fix(settings): reorder UX + enforce session-history dependency, move catch-up to Automation
- In User Experience, "Enable Session History" now appears before "Log tool
execution to session history". The log toggle is automatically disabled
when session history is off, since there's nowhere to log to. Description
on the log toggle calls out the dependency.
- "Auto-run missed scheduled tasks on startup" moves from User Experience
to Automation — it's a scheduled-task behavior toggle, not a UX choice.
* feat(settings): merge Custom Prompts/API/Context/Tool Loop into Agent Config
Iterates the layout again — Custom Prompts, API Configuration, Context
Management, and Tool Loop Detection were four narrow advanced sections that
all tune how the agent talks to the model. Combine them into a single
"Agent Config" advanced collapsible with labeled sub-groups inside, so the
top-level advanced list shrinks from 6 to 4 (Agent Config, Tool Permissions,
MCP Servers, Debug).
Files:
- New `src/ui/settings-agent-config.ts` containing the merged renderer plus
the temperature/topP slider helpers (moved from settings-api.ts).
- Delete `src/ui/settings-api.ts` and `src/ui/settings-context.ts`.
- Trim `src/ui/settings-tools.ts` to just Tool Permissions (Tool Loop
Detection moved into Agent Config).
- Rename `test/ui/settings-api.test.ts` → `settings-agent-config.test.ts`
and update imports/describe to match.
- Update `test/ui/settings-display-race.test.ts` for the new mock list.
- Settings docs updated for the new section ordering and id list.
Layout outside advanced is unchanged: General → User Experience → Automation
→ Vault Search Index. Context Management is no longer a top-level section —
it's now a sub-group inside Agent Config, since most users don't need to
touch the compaction threshold.
* chore(settings): reorder advanced sections — Tool Permissions, MCP, Agent Config, Debug
Tool Permissions and MCP Servers are the most likely advanced sections a
user opens (permissions for routine review, MCP for adding new servers),
so float them to the top. Agent Config (the densest section) sits under
them, with Debug last.
* fix(test): add setShowDeveloperSettings to settings-agent-config test mock
The SettingsSectionContext gained a setShowDeveloperSettings setter when
the Show Advanced toggle moved into the General section. The agent-config
test fixture wasn't updated, breaking typecheck:test.
* perf(settings): persist section toggle state via saveData, not saveSettings
The collapsible-section toggle handler is UI-only state that shouldn't
trigger plugin.saveSettings()'s lifecycle reconciliation (api-key /
provider / Ollama-URL / RAG-enabled checks + lifecycle.setup re-run).
Switch to plugin.saveData(plugin.settings) directly so expand/collapse
clicks just touch data.json. Addresses CodeRabbit review feedback.
* fix(settings): use spans inside <summary> instead of <div> for HTML spec compliance
The HTML spec only permits phrasing/heading content inside <summary>; <div>
is flow content and not valid as a child. Browsers parse it but it can
cause inconsistent rendering and accessibility issues.
Switch the section header / title-row / description elements from <div> to
<span>. Existing CSS already declared display: flex on the header and
title-row, so they keep their layout once the elements are spans; add
display: block to the description rule so its inline-by-default span
behaves the same as the previous div.
Done in both createCollapsibleSection and createAlwaysOpenSection for
parity (the latter doesn't sit in a <summary> but matches for consistency).
* docs(settings): annotate TOC entries with their UI section mapping
The intro paragraph describes the new UI layout (General → User Experience
→ Automation → Vault Search Index → advanced sections), but the per-setting
reference below still groups by topic, so anchors like #user-experience
don't exist. CodeRabbit's complaint was that the new layout summary is
hard to navigate.
Rather than restructure the entire reference (large rewrite, breaks
existing #basic-settings, #ui-settings, etc. inbound links), annotate each
TOC entry with its UI section in parentheses, plus a note pointing readers
to the guides for the two UI sections (Automation, Vault Search Index)
that don't have dedicated reference entries.
Anchors all resolve; readers can navigate from a UI section name to the
relevant reference topic.
* fix(settings): use adjacent-sibling selector for section separators
The `:first-of-type` rule was buggy: it matched both the General `<div>`
and the first `<details>` of its type, so the first collapsible (User
Experience) lost its top border separator from General above. CodeRabbit
caught this.
Switch to the adjacent-sibling selector (`section + section`) so the
separator is element-agnostic and only the very first section in the tab
goes without a border.
1 parent 1c546dd commit a4509b3
18 files changed
Lines changed: 686 additions & 363 deletions
File tree
- docs
- guide
- reference
- src
- ui
- test/ui
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
174 | | - | |
| 174 | + | |
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
178 | | - | |
| 178 | + | |
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
5 | 16 | | |
6 | 17 | | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
13 | 26 | | |
14 | 27 | | |
| 28 | + | |
| 29 | + | |
15 | 30 | | |
16 | 31 | | |
17 | 32 | | |
| |||
173 | 188 | | |
174 | 189 | | |
175 | 190 | | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
176 | 199 | | |
177 | 200 | | |
178 | 201 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
| 102 | + | |
| 103 | + | |
102 | 104 | | |
103 | 105 | | |
104 | 106 | | |
| |||
156 | 158 | | |
157 | 159 | | |
158 | 160 | | |
| 161 | + | |
| 162 | + | |
159 | 163 | | |
160 | 164 | | |
161 | 165 | | |
| |||
Lines changed: 101 additions & 43 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
11 | | - | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
12 | 18 | | |
13 | 19 | | |
14 | | - | |
| 20 | + | |
15 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
16 | 28 | | |
17 | 29 | | |
18 | | - | |
19 | | - | |
20 | 30 | | |
21 | 31 | | |
22 | 32 | | |
| |||
30 | 40 | | |
31 | 41 | | |
32 | 42 | | |
33 | | - | |
34 | | - | |
35 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
36 | 48 | | |
37 | | - | |
38 | | - | |
39 | | - | |
| 49 | + | |
40 | 50 | | |
41 | 51 | | |
42 | | - | |
43 | | - | |
| 52 | + | |
| 53 | + | |
44 | 54 | | |
45 | 55 | | |
46 | 56 | | |
47 | 57 | | |
48 | | - | |
49 | | - | |
| 58 | + | |
| 59 | + | |
50 | 60 | | |
51 | | - | |
52 | | - | |
| 61 | + | |
| 62 | + | |
53 | 63 | | |
54 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
55 | 67 | | |
56 | 68 | | |
57 | | - | |
58 | | - | |
| 69 | + | |
| 70 | + | |
59 | 71 | | |
60 | 72 | | |
61 | 73 | | |
62 | 74 | | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
| 75 | + | |
67 | 76 | | |
68 | 77 | | |
69 | 78 | | |
| |||
79 | 88 | | |
80 | 89 | | |
81 | 90 | | |
82 | | - | |
| 91 | + | |
83 | 92 | | |
84 | 93 | | |
85 | 94 | | |
| |||
95 | 104 | | |
96 | 105 | | |
97 | 106 | | |
98 | | - | |
99 | | - | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
100 | 161 | | |
101 | | - | |
102 | | - | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
103 | 176 | | |
104 | 177 | | |
105 | 178 | | |
| |||
120 | 193 | | |
121 | 194 | | |
122 | 195 | | |
123 | | - | |
124 | 196 | | |
125 | 197 | | |
126 | 198 | | |
127 | 199 | | |
128 | | - | |
129 | 200 | | |
130 | 201 | | |
131 | | - | |
132 | 202 | | |
133 | 203 | | |
134 | | - | |
135 | 204 | | |
136 | 205 | | |
137 | 206 | | |
| |||
189 | 258 | | |
190 | 259 | | |
191 | 260 | | |
192 | | - | |
193 | 261 | | |
194 | 262 | | |
195 | 263 | | |
196 | 264 | | |
197 | | - | |
198 | 265 | | |
199 | 266 | | |
200 | | - | |
201 | 267 | | |
202 | 268 | | |
203 | | - | |
204 | 269 | | |
205 | 270 | | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | 271 | | |
210 | 272 | | |
211 | 273 | | |
212 | 274 | | |
213 | 275 | | |
214 | | - | |
215 | | - | |
216 | 276 | | |
217 | 277 | | |
218 | 278 | | |
| |||
227 | 287 | | |
228 | 288 | | |
229 | 289 | | |
230 | | - | |
231 | | - | |
232 | 290 | | |
233 | 291 | | |
234 | 292 | | |
| |||
0 commit comments