Remove core notes service

This commit is contained in:
2026-06-27 12:44:02 +08:00
parent 24444a8588
commit 28a4e10e79
11 changed files with 63 additions and 1189 deletions
+16 -2
View File
@@ -9,7 +9,6 @@ import (
"time"
"github.com/verstak/verstak-desktop/internal/core/contribution"
"github.com/verstak/verstak-desktop/internal/core/notes"
"github.com/verstak/verstak-desktop/internal/core/plugin"
)
@@ -236,7 +235,7 @@ func resourceContextName(request OpenResourceRequest) string {
if ext == ".md" || ext == ".markdown" {
// Auto-detect Notes context: either explicitly set in request context
// or path-based detection using the canonical Notes/ folder layout.
if request.Context.NotesMode || request.Context.IsInsideNotesFolder || notes.IsInsideNotes(request.Path) {
if request.Context.NotesMode || request.Context.IsInsideNotesFolder || isInsideNotesPath(request.Path) {
return ContextNotesMarkdown
}
return ContextGenericMarkdown
@@ -247,6 +246,21 @@ func resourceContextName(request OpenResourceRequest) string {
return ""
}
func isInsideNotesPath(relativePath string) bool {
if relativePath == "" {
return false
}
cleaned := strings.TrimSpace(relativePath)
cleaned = strings.TrimPrefix(cleaned, "./")
cleaned = strings.TrimPrefix(cleaned, "/")
for _, part := range strings.Split(cleaned, "/") {
if part == "Notes" {
return true
}
}
return false
}
func isTextResource(request OpenResourceRequest) bool {
if strings.HasPrefix(request.Mime, "text/") {
return true