Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

fix(projects): hide the project column inside a project's tasks (#8832)

gbirman905d7daf5930
diff --git a/apps/web/src/features/projects/views/project-tasks-list.tsx b/apps/web/src/features/projects/views/project-tasks-list.tsx
index 19711067e6..ae3aaccd57 100644
--- a/apps/web/src/features/projects/views/project-tasks-list.tsx
+++ b/apps/web/src/features/projects/views/project-tasks-list.tsx
@@ -40,6 +40,7 @@ export function ProjectTasksProvider(props: ProjectTasksProviderProps) {
onOpenTask={props.onOpenTask}
onCreateTask={props.onCreateTask}
onCloseTask={() => {}}
+ hideTaskProject
sourceFactory={(state, options) =>
createProjectTasksDataSource(
projectId,
diff --git a/apps/web/src/features/tasks-view/components/task-list/TaskList.tsx b/apps/web/src/features/tasks-view/components/task-list/TaskList.tsx
index dff11abab3..a25394a1db 100644
--- a/apps/web/src/features/tasks-view/components/task-list/TaskList.tsx
+++ b/apps/web/src/features/tasks-view/components/task-list/TaskList.tsx
@@ -105,6 +105,7 @@ export function TaskList(props: TaskListProps) {
const {
state,
projectsEnabled,
+ showTaskProject,
setState,
source,
list,
@@ -235,7 +236,7 @@ export function TaskList(props: TaskListProps) {
);
const visibleRows = source.items;
- const columnCount = () => taskGridColumnCount(projectsEnabled());
+ const columnCount = () => taskGridColumnCount(showTaskProject());
const [assigningProjectTasks, setAssigningProjectTasks] =
createSignal<string[]>();
const tasksById = createMemo(() => {
@@ -554,7 +555,7 @@ export function TaskList(props: TaskListProps) {
>
<TaskListEntity
referencePropertyIds={props.referencePropertyIds}
- showProject={projectsEnabled()}
+ showProject={showTaskProject()}
rowId={entityRow().id}
entity={entityRow().entity}
highlighted={list.focus.key() === entityRow().id}
diff --git a/apps/web/src/features/tasks-view/components/task-list/TaskListHeader.tsx b/apps/web/src/features/tasks-view/components/task-list/TaskListHeader.tsx
index 6eea5ed1e5..0b2d3afe9d 100644
--- a/apps/web/src/features/tasks-view/components/task-list/TaskListHeader.tsx
+++ b/apps/web/src/features/tasks-view/components/task-list/TaskListHeader.tsx
@@ -55,12 +55,12 @@ function SortableHeader(props: {
}
export function TaskListHeader() {
- const { projectsEnabled } = useTasksView();
+ const { showTaskProject } = useTasksView();
return (
<div
role="row"
class="task-grid-row grid h-10 w-full shrink-0 items-center gap-2 px-3 text-xs font-medium text-ink-extra-muted"
- style={taskGridTemplate({ indicator: true, project: projectsEnabled() })}
+ style={taskGridTemplate({ indicator: true, project: showTaskProject() })}
>
<span role="columnheader" style={{ 'grid-area': 'indicator' }} />
<span
@@ -73,7 +73,7 @@ export function TaskListHeader() {
<SortableHeader label="Status" area="status" />
<SortableHeader label="Priority" area="priority" />
<SortableHeader label="Assignees" area="assignees" />
- <Show when={projectsEnabled()}>
+ <Show when={showTaskProject()}>
<SortableHeader label="Project" area="initiative" />
</Show>
<SortableHeader
diff --git a/apps/web/src/features/tasks-view/tasks-board.test.tsx b/apps/web/src/features/tasks-view/tasks-board.test.tsx
index abc33f5641..f88495cda7 100644
--- a/apps/web/src/features/tasks-view/tasks-board.test.tsx
+++ b/apps/web/src/features/tasks-view/tasks-board.test.tsx
@@ -58,6 +58,7 @@ vi.mock('./tasks-view-context', () => ({
},
openTask: mocks.openTask,
projectsEnabled: () => false,
+ showTaskProject: () => false,
setFacets: vi.fn(),
}),
}));
diff --git a/apps/web/src/features/tasks-view/tasks-view-context.tsx b/apps/web/src/features/tasks-view/tasks-view-context.tsx
index 8c459d56e6..8f75dbf384 100644
--- a/apps/web/src/features/tasks-view/tasks-view-context.tsx
+++ b/apps/web/src/features/tasks-view/tasks-view-context.tsx
@@ -99,6 +99,8 @@ export type TasksViewProviderProps = ContextProviderProps & {
onCloseTask?: () => void;
/** Host-owned task creation, including scope and permissions for embedded views. */
onCreateTask?: (options?: TaskCreateOptions) => void;
+ /** Hides each task's project when every task shares the host's project. */
+ hideTaskProject?: boolean;
savedViewTeam?: Accessor<{ id: string; name: string } | undefined>;
/** Main Tasks supplies independent queries; embedded lists leave them out. */
savedViewsSource?: () => SavedViewsSource;
@@ -134,6 +136,7 @@ export type TasksViewContext = {
facetContext: Accessor<TaskFacetContext>;
createTask?: TasksViewProviderProps['onCreateTask'];
projectsEnabled: Accessor<boolean>;
+ showTaskProject: Accessor<boolean>;
ganttEnabled: Accessor<boolean>;
setState: SetStoreFunction<TasksViewState>;
selectedTask: Accessor<TaskDetailTarget | undefined>;
@@ -190,6 +193,7 @@ export const [TasksViewProvider, useTasksView] = createAssertedContextProvider<
const [savedViewNavigation, setSavedViewNavigation] = createSignal({});
const projectsFlag = useFeatureFlag(enableProjects);
const projectsEnabled = () => projectsFlag().enabled;
+ const showTaskProject = () => projectsEnabled() && !props.hideTaskProject;
const ganttFlag = useFeatureFlag(enableGantt);
const ganttEnabled = () => ganttFlag().enabled;
@@ -641,6 +645,7 @@ export const [TasksViewProvider, useTasksView] = createAssertedContextProvider<
},
state,
projectsEnabled,
+ showTaskProject,
ganttEnabled,
setState: setStateWithSearch,
selectedTask,
diff --git a/apps/web/src/features/tasks-view/views/task-board-view.tsx b/apps/web/src/features/tasks-view/views/task-board-view.tsx
index 9cfdcdc756..6b479deb25 100644
--- a/apps/web/src/features/tasks-view/views/task-board-view.tsx
+++ b/apps/web/src/features/tasks-view/views/task-board-view.tsx
@@ -46,7 +46,7 @@ export function TaskBoardView(props: {
) => JSX.Element;
ref?: (element: HTMLDivElement) => void;
}) {
- const { state, source, projectsEnabled, setFacets } = useTasksView();
+ const { state, source, showTaskProject, setFacets } = useTasksView();
const grouping = () => toTaskBoardGrouping(state.groupBy);
const scope = () =>
JSON.stringify([
@@ -76,7 +76,7 @@ export function TaskBoardView(props: {
return false;
}
- return id !== SYSTEM_PROPERTY_IDS.PROJECT || projectsEnabled();
+ return id !== SYSTEM_PROPERTY_IDS.PROJECT || showTaskProject();
});
const revealHiddenColumns = () => {
diff --git a/docs/agent-guide/tasks.md b/docs/agent-guide/tasks.md
index 4ba20ad6b7..2f0882cfb6 100644
--- a/docs/agent-guide/tasks.md
+++ b/docs/agent-guide/tasks.md
@@ -821,7 +821,8 @@ failed tasks selected for retry, and a request failure preserves the selection.
The regular Tasks list includes a Project column. Its cell is a regular property
cell: clicking it opens the same entity dropdown as the other property columns,
listing projects. Narrow lists show Project as a compact pill after the row's
-Status, Priority and Assignees pills. Right-click a task and choose `Add to project…` to choose or clear
+Status, Priority and Assignees pills. A project's Tasks tab hides the Project
+column, pill and board-card property, since every task there shares that project. Right-click a task and choose `Add to project…` to choose or clear
its project. On mobile the same action is in the long-press menu. For a selection,
choose `Actions → Add to project…`; there is no separate assignment button in the
selection toolbar. A context action on a selected row applies to the selection.