diff --git a/internal/server/handler_agentignore.go b/internal/server/handler_agentignore.go index ab968dda9..17ead6942 100644 --- a/internal/server/handler_agentignore.go +++ b/internal/server/handler_agentignore.go @@ -23,6 +23,7 @@ type agentignoreResponse struct { Exists bool `json:"exists"` Path string `json:"path"` Raw string `json:"raw"` + Local *ignoreLocalFile `json:"local,omitempty"` Stats *agentignoreStats `json:"stats,omitempty"` } @@ -45,6 +46,7 @@ func (s *Server) handleGetAgentignore(w http.ResponseWriter, _ *http.Request) { Exists: err == nil, Path: ignorePath, Raw: string(raw), + Local: readIgnoreLocal(ignorePath), } // Discover agents to compute ignore stats diff --git a/internal/server/handler_skillignore.go b/internal/server/handler_skillignore.go index 6da5cc08e..85ffbd217 100644 --- a/internal/server/handler_skillignore.go +++ b/internal/server/handler_skillignore.go @@ -21,9 +21,27 @@ type skillignoreResponse struct { Exists bool `json:"exists"` Path string `json:"path"` Raw string `json:"raw"` + Local *ignoreLocalFile `json:"local,omitempty"` Stats *skillignoreStats `json:"stats,omitempty"` } +// ignoreLocalFile is the machine-only .local companion of an ignore file. +// Its rules apply after the shared file and can override it. +type ignoreLocalFile struct { + Path string `json:"path"` + Raw string `json:"raw"` +} + +// readIgnoreLocal returns ignorePath's .local companion, or nil when absent. +func readIgnoreLocal(ignorePath string) *ignoreLocalFile { + localPath := ignorePath + ".local" + raw, err := os.ReadFile(localPath) + if err != nil { + return nil + } + return &ignoreLocalFile{Path: localPath, Raw: string(raw)} +} + func (s *Server) handleGetSkillignore(w http.ResponseWriter, r *http.Request) { // Snapshot source path under RLock, then release before I/O. s.mu.RLock() @@ -38,6 +56,7 @@ func (s *Server) handleGetSkillignore(w http.ResponseWriter, r *http.Request) { Exists: err == nil, Path: ignorePath, Raw: string(raw), // empty if file doesn't exist + Local: readIgnoreLocal(ignorePath), } // Always discover stats — tracked repos may have their own .skillignore diff --git a/internal/server/handler_skillignore_test.go b/internal/server/handler_skillignore_test.go new file mode 100644 index 000000000..d52ed5fe3 --- /dev/null +++ b/internal/server/handler_skillignore_test.go @@ -0,0 +1,43 @@ +package server + +import ( + "encoding/json" + "net/http" + "net/http/httptest" + "os" + "path/filepath" + "testing" +) + +func TestHandleGetSkillignore_IncludesLocalFile(t *testing.T) { + s, src := newTestServer(t) + if err := os.WriteFile(filepath.Join(src, ".skillignore.local"), []byte("!feature-radar\n"), 0644); err != nil { + t.Fatalf("seed .skillignore.local: %v", err) + } + + rr := httptest.NewRecorder() + s.handler.ServeHTTP(rr, httptest.NewRequest(http.MethodGet, "/api/skillignore", nil)) + + var resp skillignoreResponse + if err := json.Unmarshal(rr.Body.Bytes(), &resp); err != nil { + t.Fatalf("decode: %v (body=%s)", err, rr.Body.String()) + } + if resp.Local == nil || resp.Local.Raw != "!feature-radar\n" { + t.Fatalf("expected local file contents, got %+v", resp.Local) + } +} + +func TestHandleGetSkillignore_NoLocalFile(t *testing.T) { + s, _ := newTestServer(t) + + rr := httptest.NewRecorder() + s.handler.ServeHTTP(rr, httptest.NewRequest(http.MethodGet, "/api/skillignore", nil)) + + var resp skillignoreResponse + if err := json.Unmarshal(rr.Body.Bytes(), &resp); err != nil { + t.Fatalf("decode: %v (body=%s)", err, rr.Body.String()) + } + if resp.Local != nil { + t.Fatalf("expected no local file, got %+v", resp.Local) + } +} diff --git a/internal/server/handler_toggle.go b/internal/server/handler_toggle.go index 2fa6dd6f8..bc6161b5a 100644 --- a/internal/server/handler_toggle.go +++ b/internal/server/handler_toggle.go @@ -6,6 +6,7 @@ import ( "path/filepath" "time" + "skillshare/internal/resource" "skillshare/internal/skillignore" ssync "skillshare/internal/sync" ) @@ -87,21 +88,76 @@ func (s *Server) handleToggleSkill(w http.ResponseWriter, r *http.Request, enabl writeError(w, http.StatusInternalServerError, "failed to update .skillignore: "+err.Error()) return } - if !added { + if !added && isDisabled { writeJSON(w, map[string]any{"success": true, "name": name, "disabled": true, "message": "already disabled"}) return } } - s.writeOpsLog(action, "ok", start, map[string]any{ + // The file write alone does not decide the outcome: a later rule, such as a + // "!" line in the .local file, can still override it. + states, err := s.disabledByRelPath(kind, source, agentsSource) + if err != nil { + writeError(w, http.StatusInternalServerError, err.Error()) + return + } + logArgs := map[string]any{ "name": name, "kind": kind, "scope": "ui", - }, "") + } + if msg := toggleOverrideError(kind, enable, states[relPath]); msg != "" { + // The ignore file may already have changed, so the attempt is still logged. + s.writeOpsLog(action, "error", start, logArgs, msg) + writeError(w, http.StatusConflict, msg) + return + } + + s.writeOpsLog(action, "ok", start, logArgs, "") writeJSON(w, map[string]any{"success": true, "name": name, "disabled": disabled}) } +// disabledByRelPath re-discovers skills or agents and reports, by relPath, +// whether each is disabled under the merged ignore and .local rules. +func (s *Server) disabledByRelPath(kind, source, agentsSource string) (map[string]bool, error) { + states := map[string]bool{} + if kind == "agent" { + discovered, err := resource.AgentKind{}.Discover(agentsSource) + if err != nil { + return nil, fmt.Errorf("failed to discover agents: %w", err) + } + for _, d := range discovered { + states[d.RelPath] = d.Disabled + } + return states, nil + } + discovered, err := ssync.DiscoverSourceSkillsAll(source) + if err != nil { + return nil, fmt.Errorf("failed to discover skills: %w", err) + } + for _, d := range discovered { + states[d.RelPath] = d.Disabled + } + return states, nil +} + +// toggleOverrideError explains why a toggle did not take effect, or returns "" +// when the resource ended up in the requested state. +func toggleOverrideError(kind string, enable, disabled bool) string { + file := ".skillignore" + if kind == "agent" { + file = ".agentignore" + } + switch { + case !enable && !disabled: + return fmt.Sprintf("still enabled: a \"!\" rule in %[1]s.local or %[1]s re-includes it — remove that rule to disable it", file) + case enable && disabled: + return fmt.Sprintf("still disabled: another rule in %[1]s or %[1]s.local matches it — remove that rule to enable it", file) + } + return "" +} + // resolveSkillRelPath finds a skill's relPath by flatName or baseName. // Searches all skills including disabled ones. Caller must provide source path. func (s *Server) resolveSkillRelPath(source, name string) (string, error) { diff --git a/internal/server/handler_toggle_batch.go b/internal/server/handler_toggle_batch.go index 021553e2d..508aab4b8 100644 --- a/internal/server/handler_toggle_batch.go +++ b/internal/server/handler_toggle_batch.go @@ -109,8 +109,23 @@ func (s *Server) handleBatchToggleSkills(w http.ResponseWriter, r *http.Request) var resp batchToggleResponse resp.Results = make([]batchToggleItemResult, 0, len(req.Names)) + // Each successful result, so its outcome can be checked after writing. + type pending struct { + relPath string + updated bool + } + written := map[int]pending{} + succeed := func(name, relPath string, updated bool) { + written[len(resp.Results)] = pending{relPath, updated} + resp.Results = append(resp.Results, batchToggleItemResult{Name: name, Success: true, Disabled: !req.Enable}) + if updated { + resp.Summary.Updated++ + } else { + resp.Summary.Unchanged++ + } + } - // Acquire the write lock only for the file-write loop. + // Hold the write lock while writing and re-checking the outcome. s.mu.Lock() for _, name := range req.Names { e, ok := lookup[name] @@ -122,8 +137,7 @@ func (s *Server) handleBatchToggleSkills(w http.ResponseWriter, r *http.Request) if req.Enable { if !e.disabled { - resp.Results = append(resp.Results, batchToggleItemResult{Name: name, Success: true, Disabled: false}) - resp.Summary.Unchanged++ + succeed(name, e.relPath, false) continue } removed, err := skillignore.RemovePattern(ignorePath, e.relPath) @@ -141,8 +155,7 @@ func (s *Server) handleBatchToggleSkills(w http.ResponseWriter, r *http.Request) resp.Summary.Failed++ continue } - resp.Results = append(resp.Results, batchToggleItemResult{Name: name, Success: true, Disabled: false}) - resp.Summary.Updated++ + succeed(name, e.relPath, true) continue } @@ -152,13 +165,31 @@ func (s *Server) handleBatchToggleSkills(w http.ResponseWriter, r *http.Request) resp.Summary.Failed++ continue } - if !added { - resp.Results = append(resp.Results, batchToggleItemResult{Name: name, Success: true, Disabled: true}) - resp.Summary.Unchanged++ - continue + succeed(name, e.relPath, added) + } + + // A written rule can still be overridden by a later one, such as a "!" line + // in the .local file, so re-check the outcome the way discovery sees it. + if len(written) > 0 { + states, err := s.disabledByRelPath(req.Kind, source, agentsSource) + if err != nil { + s.mu.Unlock() + writeError(w, http.StatusInternalServerError, err.Error()) + return + } + for i, p := range written { + msg := toggleOverrideError(req.Kind, req.Enable, states[p.relPath]) + if msg == "" { + continue + } + if p.updated { + resp.Summary.Updated-- + } else { + resp.Summary.Unchanged-- + } + resp.Results[i] = batchToggleItemResult{Name: resp.Results[i].Name, Disabled: req.Enable, Error: msg} + resp.Summary.Failed++ } - resp.Results = append(resp.Results, batchToggleItemResult{Name: name, Success: true, Disabled: true}) - resp.Summary.Updated++ } s.mu.Unlock() diff --git a/internal/server/handler_toggle_batch_test.go b/internal/server/handler_toggle_batch_test.go index 9de99c8b3..4013e7ab9 100644 --- a/internal/server/handler_toggle_batch_test.go +++ b/internal/server/handler_toggle_batch_test.go @@ -159,3 +159,31 @@ func TestHandleBatchToggle_InvalidKind(t *testing.T) { t.Errorf("expected 400 for invalid kind, got %d", rr.Code) } } + +// A "!name" rule in .skillignore.local re-includes every path segment called +// name, so writing the skill's path to .skillignore does not disable it. +func seedLocalNegation(t *testing.T, src string) { + t.Helper() + addSkill(t, src, "feature-radar/feature-radar") + addSkill(t, src, "feature-radar/feature-radar-scan") + if err := os.WriteFile(filepath.Join(src, ".skillignore.local"), []byte("!feature-radar\n"), 0644); err != nil { + t.Fatalf("seed .skillignore.local: %v", err) + } +} + +func TestHandleBatchToggle_DisableOverriddenByLocalNegation_Fails(t *testing.T) { + s, src := newTestServer(t) + seedLocalNegation(t, src) + + rr, resp := postBatchToggle(t, s, `{"names":["feature-radar__feature-radar","feature-radar__feature-radar-scan"],"kind":"skill","enable":false}`) + if rr.Code != http.StatusOK { + t.Fatalf("expected 200, got %d: %s", rr.Code, rr.Body.String()) + } + if resp.Summary.Updated != 1 || resp.Summary.Failed != 1 { + t.Fatalf("expected updated=1 failed=1, got %+v", resp.Summary) + } + r := resp.Results[0] + if r.Success || r.Disabled || !strings.Contains(r.Error, ".skillignore.local") { + t.Errorf("expected overridden skill to fail naming .skillignore.local, got %+v", r) + } +} diff --git a/internal/server/handler_toggle_test.go b/internal/server/handler_toggle_test.go new file mode 100644 index 000000000..fb9769533 --- /dev/null +++ b/internal/server/handler_toggle_test.go @@ -0,0 +1,37 @@ +package server + +import ( + "net/http" + "net/http/httptest" + "strings" + "testing" + + "skillshare/internal/oplog" +) + +func TestHandleDisableSkill_OverriddenByLocalNegation_Conflict(t *testing.T) { + s, src := newTestServer(t) + seedLocalNegation(t, src) + + req := httptest.NewRequest(http.MethodPost, "/api/resources/feature-radar__feature-radar/disable", nil) + rr := httptest.NewRecorder() + s.handler.ServeHTTP(rr, req) + + if rr.Code != http.StatusConflict || !strings.Contains(rr.Body.String(), ".skillignore.local") { + t.Fatalf("expected 409 naming .skillignore.local, got %d: %s", rr.Code, rr.Body.String()) + } +} + +// The conflict still leaves the pattern in .skillignore, so the change must be logged. +func TestHandleDisableSkill_OverriddenByLocalNegation_LogsError(t *testing.T) { + s, src := newTestServer(t) + seedLocalNegation(t, src) + + rr := httptest.NewRecorder() + s.handler.ServeHTTP(rr, httptest.NewRequest(http.MethodPost, "/api/resources/feature-radar__feature-radar/disable", nil)) + + entries, _ := oplog.Read(s.configPath(), oplog.OpsFile, 10) + if len(entries) != 1 || entries[0].Command != "disable" || entries[0].Status != "error" { + t.Fatalf("expected one disable error entry, got %+v", entries) + } +} diff --git a/ui/src/api/types/config.ts b/ui/src/api/types/config.ts index d76679e72..69de4dcd2 100644 --- a/ui/src/api/types/config.ts +++ b/ui/src/api/types/config.ts @@ -21,6 +21,12 @@ export interface AvailableTarget { readBy?: string[]; } +// Machine-only .local companion of an ignore file; its rules override the shared file. +export interface IgnoreLocalFile { + path: string; + raw: string; +} + // Skillignore types export interface SkillignoreStats { pattern_count: number; @@ -33,6 +39,7 @@ export interface SkillignoreResponse { exists: boolean; path: string; raw: string; + local?: IgnoreLocalFile; stats?: SkillignoreStats; } @@ -48,5 +55,6 @@ export interface AgentignoreResponse { exists: boolean; path: string; raw: string; + local?: IgnoreLocalFile; stats?: AgentignoreStats; } diff --git a/ui/src/components.css b/ui/src/components.css index 2e5b359a5..a5d0cf197 100644 --- a/ui/src/components.css +++ b/ui/src/components.css @@ -158,12 +158,15 @@ svg.lucide { flex: none; stroke-width: var(--isw); } .ss-sw i { width: 16px; height: 16px; border-radius: 99px; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); } .ss-sw.on { background: var(--ink); justify-content: flex-end; } .ss-sw.on i { background: var(--surface); } -/* Some of the items it covers are on: knob in the middle, track as for off. */ -.ss-sw.mix { justify-content: center; } +/* Some of the items it covers are on: half-tone track, centered knob with a dash. */ +.ss-sw.mix { justify-content: center; background: var(--ink-3); } +.ss-sw.mix i { display: grid; place-items: center; } +.ss-sw.mix i::after { content: ''; width: 8px; height: 2px; border-radius: 1px; background: var(--ink-3); } :root[data-theme="playful"] .ss-sw { width: 38px; height: 22px; background: var(--surface); border: 2px solid var(--line); padding: 2px; } :root[data-theme="playful"] .ss-sw i { width: 14px; height: 14px; background: var(--ink-3); box-shadow: none; } :root[data-theme="playful"] .ss-sw.on { background: var(--ok-bg); } :root[data-theme="playful"] .ss-sw.on i { background: var(--ok); } +:root[data-theme="playful"] .ss-sw.mix i::after { width: 6px; background: var(--surface); } .ss-st { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 500; white-space: nowrap; } .ss-st::before { content: ''; width: 7px; height: 7px; border-radius: 99px; background: var(--ink-3); } .ss-st.ok::before { background: var(--ok); } diff --git a/ui/src/i18n/locales/de.json b/ui/src/i18n/locales/de.json index 19acfc37b..5b402b656 100644 --- a/ui/src/i18n/locales/de.json +++ b/ui/src/i18n/locales/de.json @@ -226,6 +226,7 @@ "config.ignore.noneSkills": "Noch keine Skills ignoriert.", "config.ignore.noneAgents": "Noch keine Agents ignoriert.", "config.ignore.syntaxNote": "Gleiche Syntax wie .gitignore.", + "config.ignore.localNote": "Auf diesem Rechner gilt zusätzlich {path}. Seine Regeln werden nach dieser Datei angewendet und können sie überschreiben.", "config.revert.confirmText": "Zurücksetzen", "config.revert.message": "Editor auf die zuletzt gespeicherte Version zurücksetzen? Dies kann nicht rückgängig gemacht werden.", "config.revert.title": "Änderungen zurücksetzen", diff --git a/ui/src/i18n/locales/en.json b/ui/src/i18n/locales/en.json index 854f4d3b5..473a0d3ff 100644 --- a/ui/src/i18n/locales/en.json +++ b/ui/src/i18n/locales/en.json @@ -207,6 +207,7 @@ "config.ignore.noneSkills": "No skills ignored yet.", "config.ignore.noneAgents": "No agents ignored yet.", "config.ignore.syntaxNote": "Same syntax as .gitignore.", + "config.ignore.localNote": "{path} also applies on this machine. Its rules run after this file and can override it.", "config.revert.confirmText": "Revert", "config.revert.message": "Reset editor to the last saved version? This cannot be undone.", "config.revert.title": "Revert Changes", diff --git a/ui/src/i18n/locales/es.json b/ui/src/i18n/locales/es.json index dc81f478b..eb4e40a9e 100644 --- a/ui/src/i18n/locales/es.json +++ b/ui/src/i18n/locales/es.json @@ -226,6 +226,7 @@ "config.ignore.noneSkills": "Aún no hay skills ignorados.", "config.ignore.noneAgents": "Aún no hay agents ignorados.", "config.ignore.syntaxNote": "Misma sintaxis que .gitignore.", + "config.ignore.localNote": "En este equipo también se aplica {path}. Sus reglas se evalúan después de este archivo y pueden anularlo.", "config.revert.confirmText": "Revertir", "config.revert.message": "¿Restablecer el editor a la última versión guardada? Esta acción no se puede deshacer.", "config.revert.title": "Revertir cambios", diff --git a/ui/src/i18n/locales/fa.json b/ui/src/i18n/locales/fa.json index 000ed8056..82a7fd3d0 100644 --- a/ui/src/i18n/locales/fa.json +++ b/ui/src/i18n/locales/fa.json @@ -226,6 +226,7 @@ "config.ignore.noneSkills": "هنوز اسکیلی نادیده گرفته نشده است.", "config.ignore.noneAgents": "هنوز ایجنتی نادیده گرفته نشده است.", "config.ignore.syntaxNote": "همان نحو .gitignore.", + "config.ignore.localNote": "در این دستگاه {path} هم اعمال میشود. قوانین آن بعد از این فایل اجرا میشوند و ممکن است آن را نادیده بگیرند.", "config.revert.confirmText": "بازگشت", "config.revert.message": "ویرایشگر را به آخرین نسخه ذخیرهشده بازنشانی کنید؟ این عمل قابل بازگشت نیست.", "config.revert.title": "بازگشت تغییرات", diff --git a/ui/src/i18n/locales/fr.json b/ui/src/i18n/locales/fr.json index 27696973f..3075dc5c9 100644 --- a/ui/src/i18n/locales/fr.json +++ b/ui/src/i18n/locales/fr.json @@ -226,6 +226,7 @@ "config.ignore.noneSkills": "Aucun skill ignoré pour l’instant.", "config.ignore.noneAgents": "Aucun agent ignoré pour l’instant.", "config.ignore.syntaxNote": "Même syntaxe que .gitignore.", + "config.ignore.localNote": "Sur cette machine, {path} s’applique aussi. Ses règles passent après ce fichier et peuvent le remplacer.", "config.revert.confirmText": "Rétablir", "config.revert.message": "Réinitialiser l'éditeur à la dernière version enregistrée ? Cette action est irréversible.", "config.revert.title": "Annuler les modifications", diff --git a/ui/src/i18n/locales/id.json b/ui/src/i18n/locales/id.json index 84fc1b374..bb644e4a2 100644 --- a/ui/src/i18n/locales/id.json +++ b/ui/src/i18n/locales/id.json @@ -226,6 +226,7 @@ "config.ignore.noneSkills": "Belum ada skill yang diabaikan.", "config.ignore.noneAgents": "Belum ada agent yang diabaikan.", "config.ignore.syntaxNote": "Sintaksnya sama dengan .gitignore.", + "config.ignore.localNote": "Di mesin ini, {path} juga berlaku. Aturannya dijalankan setelah file ini dan bisa menimpanya.", "config.revert.confirmText": "Kembalikan", "config.revert.message": "Reset editor ke versi yang terakhir disimpan? Tindakan ini tidak dapat dibatalkan.", "config.revert.title": "Kembalikan Perubahan", diff --git a/ui/src/i18n/locales/ja.json b/ui/src/i18n/locales/ja.json index eb46f1d61..c1c95dc68 100644 --- a/ui/src/i18n/locales/ja.json +++ b/ui/src/i18n/locales/ja.json @@ -226,6 +226,7 @@ "config.ignore.noneSkills": "除外中のスキルはまだありません。", "config.ignore.noneAgents": "除外中のエージェントはまだありません。", "config.ignore.syntaxNote": ".gitignore と同じ書式です。", + "config.ignore.localNote": "このマシンでは {path} も適用されます。そのルールはこのファイルの後に評価され、ここでの設定を上書きすることがあります。", "config.revert.confirmText": "元に戻す", "config.revert.message": "エディターを最後に保存したバージョンにリセットしますか?この操作は元に戻せません。", "config.revert.title": "変更を元に戻す", diff --git a/ui/src/i18n/locales/ko.json b/ui/src/i18n/locales/ko.json index 187a7d8a3..1e4f79f1e 100644 --- a/ui/src/i18n/locales/ko.json +++ b/ui/src/i18n/locales/ko.json @@ -226,6 +226,7 @@ "config.ignore.noneSkills": "아직 무시된 스킬이 없습니다.", "config.ignore.noneAgents": "아직 무시된 에이전트가 없습니다.", "config.ignore.syntaxNote": ".gitignore와 문법이 같습니다.", + "config.ignore.localNote": "이 기기에서는 {path}도 적용됩니다. 이 파일 다음에 적용되므로 여기 설정을 덮어쓸 수 있습니다.", "config.revert.confirmText": "되돌리기", "config.revert.message": "편집기를 마지막 저장 버전으로 되돌리시겠습니까? 이 작업은 취소할 수 없습니다.", "config.revert.title": "변경사항 되돌리기", diff --git a/ui/src/i18n/locales/pt-BR.json b/ui/src/i18n/locales/pt-BR.json index bcf675031..075bb1c6e 100644 --- a/ui/src/i18n/locales/pt-BR.json +++ b/ui/src/i18n/locales/pt-BR.json @@ -226,6 +226,7 @@ "config.ignore.noneSkills": "Nenhum skill ignorado ainda.", "config.ignore.noneAgents": "Nenhum agent ignorado ainda.", "config.ignore.syntaxNote": "Mesma sintaxe do .gitignore.", + "config.ignore.localNote": "Nesta máquina, {path} também é aplicado. As regras dele vêm depois deste arquivo e podem substituí-lo.", "config.revert.confirmText": "Reverter", "config.revert.message": "Redefinir o editor para a última versão salva? Esta ação não pode ser desfeita.", "config.revert.title": "Reverter Alterações", diff --git a/ui/src/i18n/locales/zh-CN.json b/ui/src/i18n/locales/zh-CN.json index 6427577fb..c3acb5935 100644 --- a/ui/src/i18n/locales/zh-CN.json +++ b/ui/src/i18n/locales/zh-CN.json @@ -226,6 +226,7 @@ "config.ignore.noneSkills": "目前没有忽略任何 skill。", "config.ignore.noneAgents": "目前没有忽略任何 agent。", "config.ignore.syntaxNote": "语法与 .gitignore 相同。", + "config.ignore.localNote": "这台机器上还会应用 {path}。它的规则在此文件之后执行,可能会覆盖这里的设置。", "config.revert.confirmText": "恢复", "config.revert.message": "将编辑器重置为上次保存的版本?此操作无法撤销。", "config.revert.title": "恢复更改", diff --git a/ui/src/i18n/locales/zh-TW.json b/ui/src/i18n/locales/zh-TW.json index 407fae128..c9499c385 100644 --- a/ui/src/i18n/locales/zh-TW.json +++ b/ui/src/i18n/locales/zh-TW.json @@ -226,6 +226,7 @@ "config.ignore.noneSkills": "目前沒有忽略任何 skill。", "config.ignore.noneAgents": "目前沒有忽略任何 agent。", "config.ignore.syntaxNote": "語法與 .gitignore 相同。", + "config.ignore.localNote": "這台機器上也會套用 {path}。它的規則在這個檔案之後執行,可能會覆蓋這裡的設定。", "config.revert.confirmText": "還原", "config.revert.message": "重設編輯器至最後儲存的版本?此動作無法復原。", "config.revert.title": "還原變更", diff --git a/ui/src/pages/ConfigPage.tsx b/ui/src/pages/ConfigPage.tsx index c8d8e5a58..d18132c00 100644 --- a/ui/src/pages/ConfigPage.tsx +++ b/ui/src/pages/ConfigPage.tsx @@ -299,9 +299,21 @@ export default function ConfigPage() { ); } + // The .local file is not editable here, but its rules can override this one. + const localIgnore = tab === 'skillignore' ? ignoreData?.local : tab === 'agentignore' ? agentIgnoreData?.local : undefined; + // Rendered inline or inside the expanded dialog, never both: CodeMirror owns editorRef. const editorBlock = (
{localIgnore.raw.trimEnd()}
+