-
Notifications
You must be signed in to change notification settings - Fork 0
Implement comprehensive settings UI to configure all application settings #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -114,9 +114,12 @@ type UpdateSettingsRequest struct { | |||||||||
| EnableSummarization *bool `json:"enable_summarization,omitempty"` | ||||||||||
| Editor string `json:"editor,omitempty"` | ||||||||||
| EnableAutoTagging *bool `json:"enable_auto_tagging,omitempty"` | ||||||||||
| AutoTagModel string `json:"auto_tag_model,omitempty"` | ||||||||||
| MaxAutoTags *int `json:"max_auto_tags,omitempty"` | ||||||||||
| GitHubOwner string `json:"github_owner,omitempty"` | ||||||||||
| GitHubRepo string `json:"github_repo,omitempty"` | ||||||||||
| LilRagURL string `json:"lilrag_url,omitempty"` | ||||||||||
| WebUITheme string `json:"webui_theme,omitempty"` | ||||||||||
| } | ||||||||||
|
|
||||||||||
| func NewAPIServer(cfg *config.Config, db *sql.DB, repo *models.NoteRepository, vectorSearch search.SearchProvider, assetProvider AssetProvider) *APIServer { | ||||||||||
|
|
@@ -1411,9 +1414,11 @@ func (s *APIServer) handleGetSettings(w http.ResponseWriter, r *http.Request) { | |||||||||
| "enable_summarization": s.cfg.EnableSummarization, | ||||||||||
| "editor": s.cfg.Editor, | ||||||||||
| "enable_auto_tagging": s.cfg.EnableAutoTagging, | ||||||||||
| "auto_tag_model": s.cfg.AutoTagModel, | ||||||||||
| "max_auto_tags": s.cfg.MaxAutoTags, | ||||||||||
| "github_owner": s.cfg.GitHubOwner, | ||||||||||
| "github_repo": s.cfg.GitHubRepo, | ||||||||||
| "lilrag_url": s.cfg.LilRagURL, | ||||||||||
| "webui_theme": s.cfg.WebUITheme, | ||||||||||
| } | ||||||||||
|
|
||||||||||
|
|
@@ -1448,6 +1453,9 @@ func (s *APIServer) handleUpdateSettings(w http.ResponseWriter, r *http.Request) | |||||||||
| if req.EnableAutoTagging != nil { | ||||||||||
| newCfg.EnableAutoTagging = *req.EnableAutoTagging | ||||||||||
| } | ||||||||||
| if req.AutoTagModel != "" { | ||||||||||
| newCfg.AutoTagModel = req.AutoTagModel | ||||||||||
| } | ||||||||||
| if req.MaxAutoTags != nil { | ||||||||||
| if *req.MaxAutoTags < 1 || *req.MaxAutoTags > 20 { | ||||||||||
| s.writeError(w, http.StatusBadRequest, fmt.Errorf("max auto tags must be between 1 and 20")) | ||||||||||
|
|
@@ -1461,6 +1469,12 @@ func (s *APIServer) handleUpdateSettings(w http.ResponseWriter, r *http.Request) | |||||||||
| if req.GitHubRepo != "" { | ||||||||||
| newCfg.GitHubRepo = req.GitHubRepo | ||||||||||
| } | ||||||||||
| if req.LilRagURL != "" { | ||||||||||
| newCfg.LilRagURL = req.LilRagURL | ||||||||||
| } | ||||||||||
|
Comment on lines
+1472
to
+1474
|
||||||||||
| if req.LilRagURL != "" { | |
| newCfg.LilRagURL = req.LilRagURL | |
| } | |
| newCfg.LilRagURL = req.LilRagURL |
Copilot
AI
Sep 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This condition prevents clearing the WebUI theme setting. Consider allowing empty strings to reset to default theme behavior.
| if req.WebUITheme != "" { | |
| newCfg.WebUITheme = req.WebUITheme | |
| } | |
| newCfg.WebUITheme = req.WebUITheme |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The auto tag model field should allow empty strings to be set (to clear the value), but this condition prevents empty strings from being processed. Consider checking if the field exists in the request rather than if it's non-empty.