🤯 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.
TypeScript agentagent-collaborationagent-harnessloop-engineeringmcppersonal-assistantproactive-agentskillssuper-agenttask-management
💄 style(task): center multi-select checkbox, full-row selection style (#22137)
Rdmclin267c00bdff504
diff --git a/src/features/AgentTasks/AgentTaskList/TaskList.tsx b/src/features/AgentTasks/AgentTaskList/TaskList.tsxindex 4b90e1f215f..4c2c85e41a8 100644--- a/src/features/AgentTasks/AgentTaskList/TaskList.tsx+++ b/src/features/AgentTasks/AgentTaskList/TaskList.tsx@@ -35,7 +35,7 @@ import {groupTaskItems,isTaskHiddenByCompletedFilter,} from './listViewOptions';-import SelectableTaskRow from './selection/SelectableTaskRow';+import SelectableTaskRow, { selectableTaskItemClassName } from './selection/SelectableTaskRow';import { useTaskSelectionStore } from './selection/store';import TaskBulkActionBar from './selection/TaskBulkActionBar';import { isEditableTarget } from './selection/taskSelectionModel';@@ -335,7 +335,11 @@ const TaskList = memo<TaskListProps>((props) => {.filter(Boolean).join(' ')}>- <AgentTaskItem routeScope={routeScope} task={item.row.task} />+ <AgentTaskItem+ className={selectableTaskItemClassName}+ routeScope={routeScope}+ task={item.row.task}+ /></SelectableTaskRow>)}</TaskRowIndent>diff --git a/src/features/AgentTasks/AgentTaskList/selection/SelectableTaskRow.test.tsx b/src/features/AgentTasks/AgentTaskList/selection/SelectableTaskRow.test.tsxindex 73c5f90822f..eea86e79e88 100644--- a/src/features/AgentTasks/AgentTaskList/selection/SelectableTaskRow.test.tsx+++ b/src/features/AgentTasks/AgentTaskList/selection/SelectableTaskRow.test.tsx@@ -1,4 +1,4 @@-import { render, screen } from '@testing-library/react';+import { fireEvent, render, screen } from '@testing-library/react';import { afterEach, describe, expect, it, vi } from 'vitest';import SelectableTaskRow from './SelectableTaskRow';@@ -29,4 +29,21 @@ describe('SelectableTaskRow', () => {expect(screen.getByRole('checkbox', { name: 'Select T-1 Fix login' })).toBeTruthy();expect(screen.getByRole('checkbox', { name: 'Select T-2 Ship docs' })).toBeTruthy();});++ it('marks the whole row selected when its checkbox is ticked', () => {+ const { container } = render(+ <SelectableTaskRow id="t1" label="T-1 Fix login" order={() => ['t1']}>+ <div>row 1</div>+ </SelectableTaskRow>,+ );+ const row = container.firstElementChild as HTMLElement;+ expect(row.dataset.selected).toBeUndefined();++ fireEvent.click(screen.getByTestId('task-row-checkbox'));++ expect(row.dataset.selected).toBe('true');+ expect(+ screen.getByRole('checkbox', { name: 'Select T-1 Fix login' }).getAttribute('aria-checked'),+ ).toBe('true');+ });});diff --git a/src/features/AgentTasks/AgentTaskList/selection/SelectableTaskRow.tsx b/src/features/AgentTasks/AgentTaskList/selection/SelectableTaskRow.tsxindex afc815ac6c0..e8d1ae4b251 100644--- a/src/features/AgentTasks/AgentTaskList/selection/SelectableTaskRow.tsx+++ b/src/features/AgentTasks/AgentTaskList/selection/SelectableTaskRow.tsx@@ -10,30 +10,53 @@ import { useTranslation } from 'react-i18next';import { useTaskSelectionStore } from './store';const styles = stylex.create({+ // Spans the row's full height and centres the box in it. The checkbox is+ // `inline-flex`; in a plain block it sits on the baseline of a taller line+ // box and ends up above the row's centre.check: {- insetBlockStart: '50%',+ alignItems: 'center',+ display: 'flex',+ insetBlock: 0,insetInlineStart: 6,opacity: 0,position: 'absolute',- transform: 'translateY(-50%)',transition: 'opacity 0.12s',zIndex: 1,},checkVisible: {opacity: 1,},+ // The row paints hover and selection over its full width, gutter included;+ // the task item inside drops its own hover fill (`selectableTaskItemClassName`),+ // or the two layers read as a separate block beside the checkbox gutter.row: {+ backgroundColor: { 'default': null, ':hover': cssVar.colorFillTertiary },borderRadius: cssVar.borderRadius,// Gutter for the checkbox, so it never sits on the priority icon or gets// clipped by the panel edge.paddingInlineStart: 20,position: 'relative',+ transition: 'background-color 0.12s',},+ // Translucent accent fills: `colorInfoBg` is near-white on light themes and+ // reads fainter than the plain hover fill.selected: {- backgroundColor: cssVar.colorPrimaryBg,+ backgroundColor: {+ 'default': cssVar.colorInfoFillTertiary,+ ':hover': cssVar.colorInfoFillSecondary,+ },},});+const itemStyles = stylex.create({+ item: {+ backgroundColor: 'transparent',+ },+});++/** Class for the row's task item: the row owns hover and selection. */+export const selectableTaskItemClassName = stylex.props(itemStyles.item).className;+interface SelectableTaskRowProps {children: ReactNode;id: string;@@ -92,9 +115,13 @@ const SelectableTaskRow = memo<SelectableTaskRowProps>(({ children, id, label, o><Checkboxaria-label={t('taskList.bulk.selectTask', { task: label })}+ backgroundColor={cssVar.colorInfo}checked={selected}disabled={frozen}size={16}+ // White tick on the accent fill in both themes; the default tick+ // colour follows the page background and goes dark on dark mode.+ style={{ color: cssVar.colorTextLightSolid }}/></div>{children}diff --git a/src/features/AgentTasks/features/AgentTaskItem.tsx b/src/features/AgentTasks/features/AgentTaskItem.tsxindex a401c25c447..bf67dc84e7c 100644--- a/src/features/AgentTasks/features/AgentTaskItem.tsx+++ b/src/features/AgentTasks/features/AgentTaskItem.tsx@@ -26,6 +26,8 @@ import { useTaskItemContextMenu } from './useTaskItemContextMenu';export type TaskItemRouteScope = 'agent' | 'global';interface TaskItemProps {+ /** Extra class on the row's surface, e.g. to hand its hover fill to a wrapper. */+ className?: string;routeScope?: TaskItemRouteScope;task: TaskListItem;variant?: 'compact' | 'default';@@ -46,7 +48,8 @@ const TASK_STATUS_SET = new Set<TaskStatus>([const toTaskStatus = (status: string): TaskStatus =>TASK_STATUS_SET.has(status as TaskStatus) ? (status as TaskStatus) : 'backlog';-const AgentTaskItem = memo<TaskItemProps>(({ task, routeScope = 'agent', variant = 'default' }) => {+const AgentTaskItem = memo<TaskItemProps>((props) => {+ const { className, task, routeScope = 'agent', variant = 'default' } = props;const { t, i18n } = useTranslation('common');const { t: tChat } = useTranslation('chat');const fetchTaskDetail = useTaskStore((s) => s.fetchTaskDetail);@@ -211,7 +214,14 @@ const AgentTaskItem = memo<TaskItemProps>(({ task, routeScope = 'agent', variantif (variant === 'compact') {return (<ContextMenuTrigger items={contextMenuItems} onContextMenu={handleContextMenuOpen}>- <Block clickable gap={8} padding={12} variant={'borderless'} onClick={handleClick}>+ <Block+ clickable+ className={className}+ gap={8}+ padding={12}+ variant={'borderless'}+ onClick={handleClick}+ ><Flexbox horizontal align={'center'} gap={8} justify={'space-between'}><Flexbox horizontal align={'center'} flex={'none'} gap={6}><Text fontSize={12} type={'secondary'}>@@ -247,7 +257,14 @@ const AgentTaskItem = memo<TaskItemProps>(({ task, routeScope = 'agent', variantreturn (<ContextMenuTrigger items={contextMenuItems} onContextMenu={handleContextMenuOpen}>- <Block clickable gap={4} padding={12} variant={'borderless'} onClick={handleClick}>+ <Block+ clickable+ className={className}+ gap={4}+ padding={12}+ variant={'borderless'}+ onClick={handleClick}+ ><Flexbox horizontal align={'center'} gap={4} justify={'space-between'}>{titleRow}<Flexbox horizontal align={'center'} flex={'none'} gap={8}>