Changeset 0.31.0 (#203)

Co-authored-by: Jeffrey Smith <jasafpro@gmail.com>
Co-committed-by: Jeffrey Smith <jasafpro@gmail.com>
This commit is contained in:
2026-03-19 00:06:16 +00:00
committed by xcaliber
parent 5883cb50e2
commit 071dea8904
33 changed files with 1693 additions and 1562 deletions

View File

@@ -102,13 +102,6 @@ type ChatPageData struct {
ChatID string `json:"chat_id,omitempty"`
}
// EditorPageData provides workspace context for the editor surface shell.
// editor-mode.js builds CodeMirror, file tree, etc. inside the template containers.
type EditorPageData struct {
WorkspaceID string `json:"WorkspaceID"`
WorkspaceName string `json:"WorkspaceName"`
}
// NotesPageData provides context for the notes surface shell.
type NotesPageData struct {
NoteID string `json:"NoteID,omitempty"`
@@ -129,8 +122,7 @@ type SettingsPageData struct {
func (e *Engine) registerLoaders() {
e.RegisterLoader("admin", e.adminLoader)
e.RegisterLoader("chat", e.chatLoader)
e.RegisterLoader("editor", e.editorLoader)
e.RegisterLoader("notes", e.notesLoader)
e.RegisterLoader("notes", e.notesLoader)
e.RegisterLoader("settings", e.settingsLoader)
}
@@ -393,24 +385,6 @@ func (e *Engine) loadUsers(ctx context.Context, s store.Stores) []UserRow {
return out
}
// ── Editor loader ────────────────────────────
// Resolves workspace from URL param. The heavy lifting (file tree, CodeMirror)
// is done client-side by editor-mode.js.
func (e *Engine) editorLoader(c *gin.Context, s store.Stores) (any, error) {
wsID := c.Param("wsId")
data := &EditorPageData{WorkspaceID: wsID}
if wsID != "" && s.Workspaces != nil {
ws, err := s.Workspaces.GetByID(context.Background(), wsID)
if err == nil && ws != nil {
data.WorkspaceName = ws.Name
}
}
return data, nil
}
// ── Notes loader ─────────────────────────────
func (e *Engine) notesLoader(c *gin.Context, s store.Stores) (any, error) {