Enable adding todos and milestones in global dashboard

Previously blocked with "Cannot add X in global view" messages.
Now uses appropriate paths:
- Global todos: docs/todos.md
- Global milestones: docs/goals/milestones.md

This allows:
- Adding new todos from the global dashboard
- Adding todos linked to milestones via @M1 tags
- Adding new milestones
- Full sync between milestones and linked todos

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
rob 2026-01-09 02:33:25 -04:00
parent 93a2c7673e
commit 45f059647a
1 changed files with 15 additions and 17 deletions

View File

@ -1477,14 +1477,13 @@ class ProjectDashboard(QWidget):
if not text:
return
# Cannot add todos in global mode (no project context)
# Use appropriate todos path
if self.is_global:
self.toast.show_message("Cannot add todos in global view")
self._position_toast()
return
todos_path = self._docs_root / "todos.md"
else:
todos_path = self._docs_root / "projects" / self.project.key / "todos.md"
# Create parser if needed
todos_path = self._docs_root / "projects" / self.project.key / "todos.md"
if not self._todos_parser:
if not todos_path.exists():
# Create empty todos file
@ -2993,13 +2992,13 @@ generated: {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}
if not text:
return
# Cannot add milestones in global mode (no project context)
# Use appropriate milestones path
if self.is_global:
self.toast.show_message("Cannot add milestones in global view")
self._position_toast()
return
milestones_path = self._docs_root / "goals" / "milestones.md"
project_key = "global"
else:
milestones_path = self._docs_root / "projects" / self.project.key / "milestones.md"
project_key = self.project.key
# Create file if needed
if not milestones_path.exists():
@ -3007,7 +3006,7 @@ generated: {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}
milestones_path.write_text(
"---\n"
f"type: milestones\n"
f"project: {self.project.key}\n"
f"project: {project_key}\n"
f"updated: 2026-01-06\n"
"---\n\n"
"# Milestones\n\n"
@ -3146,14 +3145,13 @@ generated: {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}
priority: Priority level (high, medium, low)
milestone_id: Milestone ID to tag (e.g., "M1")
"""
# Cannot add todos in global mode (no project context)
# Use appropriate todos path
if self.is_global:
self.toast.show_message("Cannot add todos in global view")
self._position_toast()
return
todos_path = self._docs_root / "todos.md"
else:
todos_path = self._docs_root / "projects" / self.project.key / "todos.md"
# Ensure parser exists
todos_path = self._docs_root / "projects" / self.project.key / "todos.md"
if not self._todos_parser:
if not todos_path.exists():
todos_path.write_text("# TODOs\n\n## Active Tasks\n\n### High Priority\n\n### Medium Priority\n\n### Low Priority\n\n## Completed\n")