Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
8 changes: 4 additions & 4 deletions wework/DESIGN.md
Original file line number Diff line number Diff line change
Expand Up @@ -414,10 +414,10 @@ may reveal on hover/focus but must remain keyboard accessible.
- Keep the sidebar base surface stable when the application window gains or
loses focus. Window focus must not darken the task or work-items sidebar.
- Sortable sidebar rows must keep the sortable container separate from the
pointer activator. Only the primary icon-and-label or label region may start
pointer sorting, after at least `6px` of movement; trailing actions, metadata,
and unused row space must remain click-only. Preserve keyboard sorting on the
sortable container.
pointer activator. The primary non-action area, including unused space beside
a short label, may start pointer sorting after at least `6px` of movement.
Trailing actions and metadata must remain outside the activator. Preserve
keyboard sorting on the sortable container.
- Section spacing may be larger than row spacing; avoid divider-heavy grouping.
- On macOS light theme, use the captured warm translucent/off-white sidebar
material and keep the main canvas pure white. Preserve the traffic-light safe
Expand Down
38 changes: 10 additions & 28 deletions wework/src/components/layout/DesktopSidebar.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -373,8 +373,8 @@ describe('DesktopSidebar', () => {

expect(remoteSortable).toHaveAttribute('tabindex', '0')
expect(remoteSortable).toHaveAttribute('role', 'button')
expect(remoteActivator).toHaveAttribute('data-sidebar-drag-activator')
expect(remoteButton).not.toHaveAttribute('data-sidebar-drag-activator')
expect(remoteActivator).not.toHaveAttribute('data-sidebar-drag-activator')
expect(remoteButton).toHaveAttribute('data-sidebar-drag-activator')

fireEvent.pointerDown(remoteButton, {
button: 0,
Expand All @@ -391,39 +391,21 @@ describe('DesktopSidebar', () => {
isPrimary: true,
pointerId: 1,
})
expect(remoteSortable).not.toHaveAttribute('data-dragging')
fireEvent.pointerUp(document, { button: 0, clientX: 220, clientY: 10, pointerId: 1 })

fireEvent.pointerDown(remoteActivator, {
button: 0,
buttons: 1,
clientX: 20,
clientY: 45,
isPrimary: true,
pointerId: 2,
})
fireEvent.pointerMove(document, {
buttons: 1,
clientX: 20,
clientY: 10,
isPrimary: true,
pointerId: 2,
})
expect(remoteSortable).toHaveAttribute('data-dragging', 'true')
fireEvent.pointerMove(document, {
buttons: 1,
clientX: 20,
clientX: 220,
clientY: 5,
isPrimary: true,
pointerId: 2,
pointerId: 1,
})
fireEvent.pointerUp(document, {
button: 0,
buttons: 0,
clientX: 20,
clientX: 220,
clientY: 5,
isPrimary: true,
pointerId: 2,
pointerId: 1,
})

await waitFor(() => expect(onReorderRuntimeProjects).toHaveBeenCalledTimes(1))
Expand Down Expand Up @@ -2224,7 +2206,7 @@ describe('DesktopSidebar', () => {
})
})

test('starts task pointer sorting only from its content-sized activator', async () => {
test('starts task pointer sorting from the full title area', async () => {
const onReorderRuntimeProjectTasks = vi.fn().mockResolvedValue(undefined)
const onOpenRuntimeTask = vi.fn()
const chatPath = '/Users/alice/Documents/Codex/2026-07-12/manual'
Expand Down Expand Up @@ -2283,8 +2265,8 @@ describe('DesktopSidebar', () => {

expect(firstSortable).toContainElement(firstActivator)
expect(firstActivator).not.toContainElement(firstActions)
expect(firstActivator).toHaveAttribute('data-sidebar-drag-activator')
expect(firstTitleSpace).not.toHaveAttribute('data-sidebar-drag-activator')
expect(firstActivator).not.toHaveAttribute('data-sidebar-drag-activator')
expect(firstTitleSpace).toHaveAttribute('data-sidebar-drag-activator')
expect(firstTrailing).not.toHaveAttribute('data-sidebar-drag-activator')
expect(firstActions).not.toHaveAttribute('data-sidebar-drag-activator')
expect(screen.getByTestId('runtime-local-task-row-chat-1')).not.toHaveAttribute(
Expand All @@ -2303,7 +2285,7 @@ describe('DesktopSidebar', () => {
fireEvent.keyDown(document, { key: 'Escape', code: 'Escape' })
await waitFor(() => expect(firstSortable).not.toHaveAttribute('data-dragging'))

for (const [pointerId, target] of [firstTitleSpace, firstTrailing, firstActions].entries()) {
for (const [pointerId, target] of [firstTrailing, firstActions].entries()) {
fireEvent.pointerDown(target, {
button: 0,
buttons: 1,
Expand Down
14 changes: 5 additions & 9 deletions wework/src/components/layout/DesktopSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1790,6 +1790,7 @@ function RuntimeTaskRow({
{priorityLayout ? (
<span className="flex min-w-0 flex-1 flex-col justify-center gap-0.5">
<span
data-sidebar-drag-activator
data-testid={`runtime-local-task-title-${task.taskId}`}
className={cn(
'runtime-task-title relative flex min-w-0 items-center gap-1 truncate',
Expand All @@ -1810,10 +1811,7 @@ function RuntimeTaskRow({
aria-label={boardOriginLabel}
/>
) : null}
<span
data-sidebar-drag-activator
data-testid={`runtime-local-task-drag-activator-${task.taskId}`}
>
<span data-testid={`runtime-local-task-drag-activator-${task.taskId}`}>
{task.title}
</span>
</span>
Expand All @@ -1833,6 +1831,7 @@ function RuntimeTaskRow({
</span>
) : (
<span
data-sidebar-drag-activator
data-testid={`runtime-local-task-title-${task.taskId}`}
className={cn(
'runtime-task-title relative min-w-0 flex-1 truncate',
Expand All @@ -1853,10 +1852,7 @@ function RuntimeTaskRow({
aria-label={boardOriginLabel}
/>
) : null}
<span
data-sidebar-drag-activator
data-testid={`runtime-local-task-drag-activator-${task.taskId}`}
>
<span data-testid={`runtime-local-task-drag-activator-${task.taskId}`}>
{task.title}
</span>
</span>
Expand Down Expand Up @@ -2648,6 +2644,7 @@ function ProjectItem({
<button
type="button"
data-testid="project-item-button"
data-sidebar-drag-activator
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
onClick={() => {
onToggleProject(project.id)
}}
Expand All @@ -2658,7 +2655,6 @@ function ProjectItem({
)}
>
<span
data-sidebar-drag-activator
data-testid={`project-drag-activator-${project.id}`}
className="flex min-w-0 max-w-full items-center gap-2.5"
>
Expand Down
Loading