You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a new settings page, `Environments / 目录环境`, to show project directories that have actually been used by sessions. Users can review basic metadata, open a directory, and set or clear a default directory for new chats.
6
+
7
+
## User Stories
8
+
9
+
- As a user, I want to see which project directories my sessions have used so I can reopen them quickly.
10
+
- As a user, I want to set one default directory for new chats without overriding a directory I select manually later.
11
+
- As a user, I want temporary workspace directories separated from regular directories so the primary list stays clean.
12
+
13
+
## Acceptance Criteria
14
+
15
+
- Settings navigation includes `settings-environments` after `Display` and before provider settings.
16
+
- The page shows:
17
+
- a single merged environments list
18
+
- a temp environments section collapsed by default and controlled by a switch
19
+
- Environment entries come from directories used by non-draft sessions, using `new_sessions.project_dir` first and falling back to ACP `workdir` history when `project_dir` is missing.
20
+
- Each entry shows:
21
+
- directory name
22
+
- full path
23
+
- session count
24
+
- last used time based on `new_sessions.updated_at`
25
+
- badges for default, temp, missing, and synthetic default states when applicable
26
+
- Users can:
27
+
- open a directory with one click
28
+
- set a directory as default directly on the item
29
+
- clear the current default directory directly on the default item
30
+
- Temp directories are determined by whether the path is under `app.getPath('temp')` or an app-managed workspace root under app data / legacy user data.
31
+
- Default directory only preselects the project on the new thread page. Manual user selection remains higher priority.
32
+
- If the default directory is not present in recent projects, the new thread page still surfaces it through a synthetic project entry.
33
+
34
+
## Non-Goals
35
+
36
+
- Git status, rename, delete, or add-environment actions
37
+
- Tracking directories that were only opened in a picker without being used by a session
38
+
- Trigger-based SQLite maintenance
39
+
40
+
## Constraints
41
+
42
+
- Follow existing settings visual language instead of reproducing the reference screenshot.
43
+
- Use i18n for all user-facing strings.
44
+
- Use a derived SQLite table for environment history to avoid scanning `new_sessions` on every page load.
45
+
46
+
## Migration Notes
47
+
48
+
- Introduce `new_environments` as a derived table.
49
+
- Backfill it once from existing session history in schema migration `v18`, including ACP `workdir` fallback when `project_dir` is absent.
50
+
- Keep it synchronized in application code when sessions change.
0 commit comments