Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/renderer/components/titlebar/Titlebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,11 @@ const Titlebar: React.FC<TitlebarProps> = ({
showKanban: isKanbanOpen,
showEditorMode: isEditorOpen,
} = useProjectManagementContext();
const { activeTask, handleSelectTask: onSelectTask } = useTaskManagementContext();
const {
activeTask,
handleSelectTask: onSelectTask,
tasksByProjectId,
} = useTaskManagementContext();
const { user: githubUser } = useGithubContext();

const isTaskMultiAgent = Boolean(activeTask?.metadata?.multiAgent?.enabled);
Expand Down Expand Up @@ -207,6 +211,7 @@ const Titlebar: React.FC<TitlebarProps> = ({
<TitlebarContext
projects={projects}
selectedProject={selectedProject}
tasks={selectedProject ? (tasksByProjectId[selectedProject.id] ?? []) : []}
activeTask={activeTask}
onSelectProject={onSelectProject}
onSelectTask={onSelectTask}
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/components/titlebar/TitlebarContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import type { Project, Task } from '../../types/app';
interface TitlebarContextProps {
projects: Project[];
selectedProject: Project | null;
tasks: Task[];
activeTask: Task | null;
onSelectProject: (project: Project) => void;
onSelectTask: (task: Task) => void;
Expand All @@ -13,15 +14,14 @@ interface TitlebarContextProps {
const TitlebarContext: React.FC<TitlebarContextProps> = ({
projects,
selectedProject,
tasks,
activeTask,
onSelectProject,
onSelectTask,
}) => {
if (!selectedProject) {
return <div />;
}

const tasks = selectedProject?.tasks ?? [];
const projectValue = selectedProject.id;
const noTaskValue = '__no_task_selected__';
const taskValue = activeTask?.id ?? noTaskValue;
Expand Down
Loading