diff --git a/src/development_hub/views/dashboard.py b/src/development_hub/views/dashboard.py index bbcdf47..d3a29b0 100644 --- a/src/development_hub/views/dashboard.py +++ b/src/development_hub/views/dashboard.py @@ -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 / "projects" / self.project.key / "milestones.md" + 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")