Changeset 0.19.2 (#84)
This commit is contained in:
116
docs/DESIGN-0.19.2.md
Normal file
116
docs/DESIGN-0.19.2.md
Normal file
@@ -0,0 +1,116 @@
|
||||
# v0.19.2 — Project Persona Default, Archive Toggle, Channel Reorder
|
||||
|
||||
**Status:** Implementation
|
||||
**Depends on:** v0.19.1
|
||||
|
||||
---
|
||||
|
||||
## 1. Project-level Persona Default
|
||||
|
||||
### Concept
|
||||
|
||||
Bind a persona to a project so all chats inherit model, system prompt,
|
||||
and parameters without selecting it each time. The persona acts as a
|
||||
fallback when no explicit preset is chosen per-message.
|
||||
|
||||
### Resolution Chain (completion.go)
|
||||
|
||||
```
|
||||
1. Explicit req.PresetID → highest priority
|
||||
2. Project persona default → fallback when no explicit preset ← NEW
|
||||
3. No persona → bare model, no persona context
|
||||
```
|
||||
|
||||
### Storage
|
||||
|
||||
`projects.settings` JSONB:
|
||||
```json
|
||||
{ "persona_id": "uuid-here", "system_prompt": "..." }
|
||||
```
|
||||
|
||||
### Backend Changes
|
||||
|
||||
In `completion.go`, after the explicit preset block, before
|
||||
`resolveConfig`:
|
||||
|
||||
```go
|
||||
// ── Project persona fallback (v0.19.2) ──
|
||||
if req.PresetID == "" && h.stores.Projects != nil {
|
||||
projID, _ := h.stores.Projects.GetProjectIDForChannel(ctx, channelID)
|
||||
if projID != "" {
|
||||
proj, _ := h.stores.Projects.GetByID(ctx, projID)
|
||||
if proj != nil {
|
||||
if pid, ok := proj.Settings["persona_id"].(string); ok && pid != "" {
|
||||
preset := ResolvePreset(h.stores, pid, userID)
|
||||
if preset != nil {
|
||||
personaID = preset.ID
|
||||
if req.Model == "" { req.Model = preset.BaseModelID }
|
||||
// ... same defaults as explicit preset
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Frontend Changes
|
||||
|
||||
Project detail panel: persona picker dropdown below system prompt.
|
||||
Lists available personas, saves to `settings.persona_id`.
|
||||
|
||||
---
|
||||
|
||||
## 2. Project Archive Toggle
|
||||
|
||||
### Behavior
|
||||
|
||||
- Toggle in project detail panel (checkbox)
|
||||
- Archived projects hidden from sidebar by default
|
||||
- "Show archived" toggle at bottom of sidebar (or in panel)
|
||||
- Uses existing `is_archived` column — no migration needed
|
||||
|
||||
### Files Changed
|
||||
|
||||
- `src/js/projects-ui.js` — archive toggle in panel, sidebar filter
|
||||
- `src/js/ui-core.js` — filter archived in renderChatList
|
||||
- `src/css/styles.css` — dimmed style for archived
|
||||
|
||||
---
|
||||
|
||||
## 3. Channel Reorder Within Project
|
||||
|
||||
### Behavior
|
||||
|
||||
- Dragging a chat within the same project group reorders it
|
||||
- Drop between chats inserts at that position
|
||||
- Calls `PUT /projects/:id/channels/reorder` with new order
|
||||
- Position persisted server-side, respected on next load
|
||||
|
||||
### Implementation
|
||||
|
||||
- `onProjectDrop` detects same-project reorder vs cross-project move
|
||||
- Compute new channel order from DOM after drop
|
||||
- Channels within project sorted by position from
|
||||
`project_channels.position` (loaded alongside projects)
|
||||
|
||||
### Files Changed
|
||||
|
||||
- `src/js/projects-ui.js` — reorder logic
|
||||
- `src/js/ui-core.js` — sort projChats by position
|
||||
- `src/js/app.js` — store project channel positions
|
||||
|
||||
---
|
||||
|
||||
## Files Summary
|
||||
|
||||
| File | Change |
|
||||
|------|--------|
|
||||
| `server/handlers/completion.go` | Project persona fallback |
|
||||
| `src/js/projects-ui.js` | Persona picker, archive toggle, reorder |
|
||||
| `src/js/ui-core.js` | Archive filter, position sort |
|
||||
| `src/js/app.js` | Channel positions state |
|
||||
| `src/css/styles.css` | Archive styles |
|
||||
| `VERSION` | 0.19.1 → 0.19.2 |
|
||||
| `CHANGELOG.md` | New entry |
|
||||
|
||||
No migrations. No new files.
|
||||
Reference in New Issue
Block a user