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:
parent
93a2c7673e
commit
45f059647a
|
|
@ -1477,14 +1477,13 @@ class ProjectDashboard(QWidget):
|
||||||
if not text:
|
if not text:
|
||||||
return
|
return
|
||||||
|
|
||||||
# Cannot add todos in global mode (no project context)
|
# Use appropriate todos path
|
||||||
if self.is_global:
|
if self.is_global:
|
||||||
self.toast.show_message("Cannot add todos in global view")
|
todos_path = self._docs_root / "todos.md"
|
||||||
self._position_toast()
|
else:
|
||||||
return
|
todos_path = self._docs_root / "projects" / self.project.key / "todos.md"
|
||||||
|
|
||||||
# Create parser if needed
|
# Create parser if needed
|
||||||
todos_path = self._docs_root / "projects" / self.project.key / "todos.md"
|
|
||||||
if not self._todos_parser:
|
if not self._todos_parser:
|
||||||
if not todos_path.exists():
|
if not todos_path.exists():
|
||||||
# Create empty todos file
|
# Create empty todos file
|
||||||
|
|
@ -2993,13 +2992,13 @@ generated: {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}
|
||||||
if not text:
|
if not text:
|
||||||
return
|
return
|
||||||
|
|
||||||
# Cannot add milestones in global mode (no project context)
|
# Use appropriate milestones path
|
||||||
if self.is_global:
|
if self.is_global:
|
||||||
self.toast.show_message("Cannot add milestones in global view")
|
milestones_path = self._docs_root / "goals" / "milestones.md"
|
||||||
self._position_toast()
|
project_key = "global"
|
||||||
return
|
else:
|
||||||
|
milestones_path = self._docs_root / "projects" / self.project.key / "milestones.md"
|
||||||
milestones_path = self._docs_root / "projects" / self.project.key / "milestones.md"
|
project_key = self.project.key
|
||||||
|
|
||||||
# Create file if needed
|
# Create file if needed
|
||||||
if not milestones_path.exists():
|
if not milestones_path.exists():
|
||||||
|
|
@ -3007,7 +3006,7 @@ generated: {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}
|
||||||
milestones_path.write_text(
|
milestones_path.write_text(
|
||||||
"---\n"
|
"---\n"
|
||||||
f"type: milestones\n"
|
f"type: milestones\n"
|
||||||
f"project: {self.project.key}\n"
|
f"project: {project_key}\n"
|
||||||
f"updated: 2026-01-06\n"
|
f"updated: 2026-01-06\n"
|
||||||
"---\n\n"
|
"---\n\n"
|
||||||
"# Milestones\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)
|
priority: Priority level (high, medium, low)
|
||||||
milestone_id: Milestone ID to tag (e.g., "M1")
|
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:
|
if self.is_global:
|
||||||
self.toast.show_message("Cannot add todos in global view")
|
todos_path = self._docs_root / "todos.md"
|
||||||
self._position_toast()
|
else:
|
||||||
return
|
todos_path = self._docs_root / "projects" / self.project.key / "todos.md"
|
||||||
|
|
||||||
# Ensure parser exists
|
# Ensure parser exists
|
||||||
todos_path = self._docs_root / "projects" / self.project.key / "todos.md"
|
|
||||||
if not self._todos_parser:
|
if not self._todos_parser:
|
||||||
if not todos_path.exists():
|
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")
|
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")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue