Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

💄 style(tasks): tighten task group spacing in Compact density (#23721)

YuTengjing519c797c42e5
diff --git a/src/features/AgentTasks/AgentTaskList/TaskList.tsx b/src/features/AgentTasks/AgentTaskList/TaskList.tsx
index 48f0ee788f3..01dd6d3bf27 100644
--- a/src/features/AgentTasks/AgentTaskList/TaskList.tsx
+++ b/src/features/AgentTasks/AgentTaskList/TaskList.tsx
@@ -27,6 +27,7 @@ import { useTaskStore } from '@/store/task';
import { taskListSelectors } from '@/store/task/selectors';
import { COMPLETE_TASK_LIST_MAX_ITEMS } from '@/store/task/slices/list/action';
import type { TaskListItem } from '@/store/task/slices/list/initialState';
+import { useInterfaceDensity } from '@/styles/density';
import { createTaskModal } from '../CreateTaskModal';
import type { TaskItemRouteScope } from '../features/AgentTaskItem';
@@ -55,6 +56,9 @@ import { flattenTaskListEntries } from './taskListVirtualModel';
import TaskRowIndent from './TaskRowIndent';
import { useClosestScrollParent } from './useClosestScrollParent';
+/** Space above a non-first top-level group header; Compact stacks them like Linear. */
+const GROUP_GAP = { compact: 4, loose: 16 } as const;
+
/** Scope inherited by tasks created from a group header. */
export interface TaskListCreateScope {
agentId?: string;
@@ -158,6 +162,7 @@ const TaskGroupHeader = memo<{
onToggle: (key: string) => void;
}>(({ createScope, item, onToggle }) => {
const { t } = useTranslation('chat');
+ const density = useInterfaceDensity();
const sub = item.kind === 'subGroup';
const createDefaults = !createScope
? undefined
@@ -170,7 +175,7 @@ const TaskGroupHeader = memo<{
}, [createDefaults, createScope]);
return (
- <div style={{ paddingTop: item.first ? 0 : sub ? 6 : 16 }}>
+ <div style={{ paddingTop: item.first ? 0 : sub ? 6 : GROUP_GAP[density] }}>
<div {...stylex.props(styles.header)}>
<AccordionRoot
indicatorPlacement={'start'}