feat(tasks): linked tasks sync title and subtasks with their note in both directions
MindSift CI & Docker Release / Build, Test in Container & Push (push) Failing after 2m32s
MindSift CI & Docker Release / Build, Test in Container & Push (push) Failing after 2m32s
Subtasks of a task linked to a note checkbox are tied 1:1 to checkboxes of that note (subtasks[].blockId), wherever they are moved. ReconcileDocTaskLinks now carries tick, title and subtasks from the note to the task and adopts new checkboxes directly under the task; SyncTaskToDoc carries tick, title and subtasks to the note and adds checkboxes for new subtasks. Deleting is not mirrored. Deepening a task ties its subtasks right away; saves without links keep the server's links. The sync response reports taskLinks/subtaskLinks; the editor shows an "Unteraufgabe" badge. v0.36.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f91926c208
commit
5a8922011d
20 files changed
+511
-53
No files matched your search
@@ -338,14 +338,19 @@ func (s *Store) UpdateThoughtTriage(userID, thoughtID, action, convertTo, target
|
||||
})
|
||||
}
|
||||
if len(thought.Subtasks) > 0 {
|
||||
for _, st := range thought.Subtasks {
|
||||
for i, st := range thought.Subtasks {
|
||||
id := domain.NewID("blk")
|
||||
blocks = append(blocks, domain.DocumentBlock{
|
||||
ID: domain.NewID("blk"),
|
||||
ID: id,
|
||||
Type: "todo",
|
||||
Content: st.Title,
|
||||
Checked: st.IsCompleted,
|
||||
Level: 1,
|
||||
})
|
||||
// A task stays linked: its subtasks are tied to these checkboxes (task_doc_sync.go)
|
||||
if isTask {
|
||||
thought.Subtasks[i].BlockID = id
|
||||
}
|
||||
}
|
||||
}
|
||||
var metaItems []string
|
||||
@@ -380,6 +385,8 @@ func (s *Store) UpdateThoughtTriage(userID, thoughtID, action, convertTo, target
|
||||
newStatus = domain.StatusKept
|
||||
convertedType = "document_block"
|
||||
convertedRefID = doc.ID + ":" + blocks[0].ID
|
||||
subsJSON, _ := json.Marshal(thought.Subtasks)
|
||||
_, _ = s.db.Exec(`UPDATE thoughts SET subtasks = ? WHERE id = ?`, string(subsJSON), thought.ID)
|
||||
}
|
||||
}
|
||||
} else if convertTo == "list_item" && targetListID != "" {
|
||||
@@ -475,7 +482,7 @@ func (s *Store) UpdateThoughtDetails(userID, thoughtID string, content *string,
|
||||
thought.Notes = *notes
|
||||
}
|
||||
if subtasks != nil {
|
||||
thought.Subtasks = *subtasks
|
||||
thought.Subtasks = keepSubtaskLinks(thought.Subtasks, *subtasks)
|
||||
}
|
||||
|
||||
tagsJSON, _ := json.Marshal(thought.Tags)
|
||||
|
||||
Reference in new issue
Block a user