Skip to content

style(wework): polish workbench chrome - #1223

Merged
qdaxb merged 5 commits into
wecode-ai:mainfrom
Micro66:human/yak-20260601-031339
Jun 2, 2026
Merged

qdaxb merged 5 commits into
wecode-ai:mainfrom
Micro66:human/yak-20260601-031339

Conversation

@Micro66

@Micro66 Micro66 commented Jun 1, 2026 •

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • New Features

    • Project section shows task lists by default, adds time‑ago labels, and includes a “Show more” control (i18n updated).
  • Style

    • Refined typography, sizing, spacing, and icon dimensions across chat composer, messages, sidebars, dialogs, settings, and workspace panels.
    • Menus and dialogs now render as body‑level overlays with improved positioning; sidebar visuals use a bordered/translucent background and hidden scrollbars; main nav composition adjusted.
  • Tests

    • Updated tests to match the new layout, navigation partitioning, and overlay/positioning expectations.

@coderabbitai

coderabbitai Bot commented Jun 1, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

UI/spacing/typography tightened across composer controls, message rendering, sidebars, workspace panels, and dialogs; ProjectSection now always renders with task truncation and relative-time labels; several portals/menus moved to body with measured positioning; tests and locales updated to match these changes.

Changes

UI styling, layout behavior, i18n, and tests

Layer / File(s) Summary
ProjectSection, locales, and tests
frontend/src/features/projects/components/ProjectSection.tsx, frontend/src/i18n/locales/*, frontend/src/__tests__/*
ProjectSection always renders, adds visibleTasks truncation and formatTimeAgo() using updated_at; added workspaceSection.showMore and relativeTime locales; updated tests to reflect new default rendering and visibility.
Dropdown positioning, portals, and dialog rendering
wework/src/components/common/ActionMenu.tsx, wework/src/components/projects/ProjectCreateDialog.tsx, wework/src/components/layout/DesktopWorkbenchLayout.test.tsx
ActionMenu now measures trigger/menu and positions a portal'd fixed menu via useLayoutEffect; ProjectCreateDialog renders into document.body via createPortal; tests added to validate menu/dialog placements and sidebar scroll class changes.
Desktop sidebar and TaskSidebar updates
wework/src/components/layout/DesktopSidebar.tsx, frontend/src/features/tasks/components/sidebar/TaskSidebar.tsx
Sidebar and TaskSidebar spacing/typography updated, navigation partitioning changed (fixed vs more), logo/header/collapse controls simplified, worklists scroll container hides scrollbars, and tests adjusted for secondary nav distribution.
Chat composer controls and message typography
wework/src/components/chat/composer/*, wework/src/components/chat/MessageList.tsx, wework/src/components/common/TextInputDialog.tsx
Composer subcomponents (AddContextMenu, ComposerToolbar, ModelSelector, SkillSelector, ProjectChatComposer, ProjectWorkBar) had sizing/typography tightened; MessageList and ReactMarkdown renderers adjusted to the new typographic scale; dialog input/button sizes reduced.
Workspace panels, settings, environment popover, and cards
wework/src/components/layout/workspace-panels/*, wework/src/components/layout/DesktopSettingsMenu.tsx, wework/src/components/layout/EnvironmentInfoPopover.tsx, wework/src/components/layout/WorkspacePanelCards.tsx
Workspace panel actions/cards and settings/environment UI updated to consistent smaller text/line-height scale and reduced icon/button sizing; root aside styling made translucent/blurred with border and inset shadow.
Misc small edits and tests
executor/agents/claude_code/claude_code_agent.py, frontend/src/__tests__/*, frontend/src/features/resource-library/components/MyResources.tsx
Minor import reordering, test invocation formatting, small JSX reformatting, and localized test expectation tweaks.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • qdaxb

Poem

🐰 Buttons trimmed and classes tight,
Tasks show time in smaller type,
Portals leap onto the body’s floor,
Tests hop in to check once more,
A tidy nibble — hop, then write!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'style(wework): polish workbench chrome' accurately describes the primary focus of the changeset, which is a comprehensive styling update to the workbench UI components.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (3)
wework/src/components/layout/workspace-panels/WorkspacePanelActions.tsx (1)

36-56: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Don’t shrink these panel toggles below the mobile touch target.

Both workspace toggle buttons are now 32x32, which makes them miss the repo’s minimum mobile hit area. Keep them at least h-11 min-w-[44px] so the panel controls stay usable on touch devices. As per coding guidelines, "All interactive elements on mobile must be at least 44px × 44px - use h-11 min-w-[44px] for buttons".

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@wework/src/components/layout/workspace-panels/WorkspacePanelActions.tsx`
around lines 36 - 56, The toggle buttons for bottom and right panels (look for
the elements with data-testid "toggle-bottom-workspace-panel-button" and
"toggle-right-workspace-panel-button", and handlers
onToggleBottomPanel/onToggleRightPanel using icons PanelBottom and PanelRight)
are too small; update their className to enforce the repo mobile hit area by
replacing the current size utilities (e.g. "h-8 w-8") with "h-11 min-w-[44px]"
while preserving existing centering, rounding, text and hover classes and the
conditional bg/text utilities so the buttons remain visually identical but meet
the 44×44px touch target requirement.
frontend/src/features/projects/components/ProjectSection.tsx (1)

174-183: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

The new 32px controls regress the mobile touch target across the whole section.

The create button, project expander, overflow trigger, new-conversation button, and show-more button were all tightened to h-8/w-8. That puts several primary interactions below the repo’s 44px minimum touch size. Please keep these controls at least h-11 tall before merging. As per coding guidelines, "All interactive elements on mobile must be at least 44px × 44px - use h-11 min-w-[44px] for buttons".

Also applies to: 325-332, 354-380, 453-458

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@frontend/src/features/projects/components/ProjectSection.tsx` around lines
174 - 183, Several interactive controls in ProjectSection (the create Button
with data-testid based on isUnifiedSection/isWorkspaceSection, the project
expander, overflow trigger, new-conversation button, and show-more button) were
reduced to h-8/w-8 and violate the 44×44 mobile touch target rule; update these
Button elements to use at least h-11 and min-w-[44px] (or the shared utility
h-11 min-w-[44px]) instead of h-8/w-8 so they meet the "All interactive elements
on mobile must be at least 44px × 44px" guideline, ensuring you replace
className usages like "h-8 min-w-8 w-8" with "h-11 min-w-[44px]" (and remove
fixed small widths) across the referenced Button instances.
wework/src/components/common/TextInputDialog.tsx (1)

47-52: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Keep the dialog controls at the mobile minimum and use the standard primary action.

These changes shrink the close button, input, cancel button, and confirm button to 32px-36px tall. That drops below the repo’s 44px mobile target, and the confirm action in this dialog still bypasses the required variant="primary" styling. Please keep these controls at least h-11 tall and render the confirm action with the shared primary button treatment. As per coding guidelines, "All interactive elements on mobile must be at least 44px × 44px - use h-11 min-w-[44px] for buttons" and "Primary action buttons in dialogs MUST use variant=\"primary\" to ensure visual consistency and proper styling".

Also applies to: 60-65, 67-88

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@wework/src/components/common/TextInputDialog.tsx` around lines 47 - 52, The
dialog controls are undersized and the confirm button doesn't use the shared
primary styling; update the close button, cancel button, confirm button, and the
input to meet mobile minimums by using className="h-11 min-w-[44px]" (or h-11
for inputs) and ensure the confirm action is rendered with the shared Button
component using variant="primary" (e.g., where
confirmLabel/handleConfirm/onConfirm is used). Locate the close button (onClose,
cancelLabel, inputTestId) and the dialog action buttons in TextInputDialog.tsx
and replace their current height classes (e.g., h-8, h-9, h-10) with h-11
min-w-[44px]; change the confirm button JSX to pass variant="primary" to the
shared Button component so it uses the repo primary styling.
🧹 Nitpick comments (1)
frontend/src/__tests__/features/projects/components/project-sidebar-behavior.test.tsx (1)

178-212: ⚡ Quick win

Add one regression test for the new task cap and time label branches.

These updated assertions only cover the one-task path, so the newly added DEFAULT_VISIBLE_PROJECT_TASKS, project-show-more-tasks-button, and relativeTime.* rendering paths can still regress unnoticed. A fixture with 6+ tasks and stable updated_at values would close that gap.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@frontend/src/__tests__/features/projects/components/project-sidebar-behavior.test.tsx`
around lines 178 - 212, Add a regression test that renders ProjectSection with a
project fixture containing at least 6 tasks (set deterministic updated_at
timestamps) and a mock DEFAULT_VISIBLE_PROJECT_TASKS threshold to verify the
"project-show-more-tasks-button" appears; assert only
DEFAULT_VISIBLE_PROJECT_TASKS task rows are initially rendered, click the
show-more button and assert the remaining tasks become visible, and verify
relative time labels (selectors matching "relativeTime.*") render the expected
stable strings for the provided updated_at values.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@frontend/src/features/projects/components/ProjectSection.tsx`:
- Around line 166-171: The button with data-testid "project-section-toggle" in
ProjectSection.tsx is currently a focusable inert control with
aria-expanded={true}; either make it non-interactive markup if the section is
always open (replace the <button> with a heading or <span> and remove
aria-expanded), or restore proper toggle behavior by introducing component state
(e.g., isExpanded), set aria-expanded={isExpanded}, and wire an
onClick/onKeyDown handler to toggle that state (keep data-testid and accessible
label) so keyboard users can interact with the control.

---

Outside diff comments:
In `@frontend/src/features/projects/components/ProjectSection.tsx`:
- Around line 174-183: Several interactive controls in ProjectSection (the
create Button with data-testid based on isUnifiedSection/isWorkspaceSection, the
project expander, overflow trigger, new-conversation button, and show-more
button) were reduced to h-8/w-8 and violate the 44×44 mobile touch target rule;
update these Button elements to use at least h-11 and min-w-[44px] (or the
shared utility h-11 min-w-[44px]) instead of h-8/w-8 so they meet the "All
interactive elements on mobile must be at least 44px × 44px" guideline, ensuring
you replace className usages like "h-8 min-w-8 w-8" with "h-11 min-w-[44px]"
(and remove fixed small widths) across the referenced Button instances.

In `@wework/src/components/common/TextInputDialog.tsx`:
- Around line 47-52: The dialog controls are undersized and the confirm button
doesn't use the shared primary styling; update the close button, cancel button,
confirm button, and the input to meet mobile minimums by using className="h-11
min-w-[44px]" (or h-11 for inputs) and ensure the confirm action is rendered
with the shared Button component using variant="primary" (e.g., where
confirmLabel/handleConfirm/onConfirm is used). Locate the close button (onClose,
cancelLabel, inputTestId) and the dialog action buttons in TextInputDialog.tsx
and replace their current height classes (e.g., h-8, h-9, h-10) with h-11
min-w-[44px]; change the confirm button JSX to pass variant="primary" to the
shared Button component so it uses the repo primary styling.

In `@wework/src/components/layout/workspace-panels/WorkspacePanelActions.tsx`:
- Around line 36-56: The toggle buttons for bottom and right panels (look for
the elements with data-testid "toggle-bottom-workspace-panel-button" and
"toggle-right-workspace-panel-button", and handlers
onToggleBottomPanel/onToggleRightPanel using icons PanelBottom and PanelRight)
are too small; update their className to enforce the repo mobile hit area by
replacing the current size utilities (e.g. "h-8 w-8") with "h-11 min-w-[44px]"
while preserving existing centering, rounding, text and hover classes and the
conditional bg/text utilities so the buttons remain visually identical but meet
the 44×44px touch target requirement.

---

Nitpick comments:
In
`@frontend/src/__tests__/features/projects/components/project-sidebar-behavior.test.tsx`:
- Around line 178-212: Add a regression test that renders ProjectSection with a
project fixture containing at least 6 tasks (set deterministic updated_at
timestamps) and a mock DEFAULT_VISIBLE_PROJECT_TASKS threshold to verify the
"project-show-more-tasks-button" appears; assert only
DEFAULT_VISIBLE_PROJECT_TASKS task rows are initially rendered, click the
show-more button and assert the remaining tasks become visible, and verify
relative time labels (selectors matching "relativeTime.*") render the expected
stable strings for the provided updated_at values.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5ff03f73-fc41-4c50-bff3-563be913b0e6

📥 Commits

Reviewing files that changed from the base of the PR and between 9770de2 and 80433b9.

📒 Files selected for processing (22)
  • frontend/src/__tests__/features/projects/components/project-sidebar-behavior.test.tsx
  • frontend/src/__tests__/features/tasks/components/sidebar/TaskSidebar.test.tsx
  • frontend/src/features/projects/components/ProjectSection.tsx
  • frontend/src/features/tasks/components/sidebar/TaskSidebar.tsx
  • frontend/src/i18n/locales/en/projects.json
  • frontend/src/i18n/locales/zh-CN/projects.json
  • wework/src/components/chat/MessageList.tsx
  • wework/src/components/chat/composer/AddContextMenu.tsx
  • wework/src/components/chat/composer/ComposerToolbar.tsx
  • wework/src/components/chat/composer/ModelSelector.tsx
  • wework/src/components/chat/composer/ProjectChatComposer.tsx
  • wework/src/components/chat/composer/ProjectWorkBar.tsx
  • wework/src/components/chat/composer/SkillSelector.tsx
  • wework/src/components/common/ActionMenu.tsx
  • wework/src/components/common/TextInputDialog.tsx
  • wework/src/components/layout/DesktopSettingsMenu.tsx
  • wework/src/components/layout/DesktopSidebar.tsx
  • wework/src/components/layout/DesktopWorkbenchMain.tsx
  • wework/src/components/layout/EnvironmentInfoPopover.tsx
  • wework/src/components/layout/workspace-panels/WorkspacePanelActions.tsx
  • wework/src/components/layout/workspace-panels/WorkspacePanelCards.tsx
  • wework/src/components/projects/ProjectCreateDialog.tsx
✅ Files skipped from review due to trivial changes (11)
  • wework/src/components/common/ActionMenu.tsx
  • wework/src/components/chat/composer/ProjectWorkBar.tsx
  • wework/src/components/layout/DesktopSettingsMenu.tsx
  • wework/src/components/chat/composer/SkillSelector.tsx
  • wework/src/components/layout/DesktopSidebar.tsx
  • wework/src/components/chat/MessageList.tsx
  • wework/src/components/chat/composer/ModelSelector.tsx
  • wework/src/components/layout/EnvironmentInfoPopover.tsx
  • wework/src/components/projects/ProjectCreateDialog.tsx
  • wework/src/components/chat/composer/AddContextMenu.tsx
  • wework/src/components/layout/workspace-panels/WorkspacePanelCards.tsx
🚧 Files skipped from review as they are similar to previous changes (2)
  • wework/src/components/layout/DesktopWorkbenchMain.tsx
  • wework/src/components/chat/composer/ComposerToolbar.tsx

Comment on lines 166 to 171
<button
type="button"
data-testid="project-section-toggle"
onClick={() => setSectionCollapsed(!sectionCollapsed)}
aria-expanded={!sectionCollapsed}
className="flex h-full min-w-0 flex-1 items-center justify-between"
aria-expanded={true}
className="flex h-full min-w-0 flex-1 items-center"
>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Replace the inert section-header button with non-interactive markup, or wire the toggle back up.

project-section-toggle is still a focusable <button>, but it no longer performs any action and aria-expanded is hardcoded to true. That leaves keyboard users on a dead control. If this section is intentionally always open, render a heading/span here instead of a button.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@frontend/src/features/projects/components/ProjectSection.tsx` around lines
166 - 171, The button with data-testid "project-section-toggle" in
ProjectSection.tsx is currently a focusable inert control with
aria-expanded={true}; either make it non-interactive markup if the section is
always open (replace the <button> with a heading or <span> and remove
aria-expanded), or restore proper toggle behavior by introducing component state
(e.g., isExpanded), set aria-expanded={isExpanded}, and wire an
onClick/onKeyDown handler to toggle that state (keep data-testid and accessible
label) so keyboard users can interact with the control.

Micro66 added 2 commits June 2, 2026 14:21
…031339

# Conflicts:
#	wework/src/components/chat/composer/ModelSelector.tsx
#	wework/src/components/chat/composer/ProjectWorkBar.tsx
#	wework/src/components/layout/DesktopSidebar.tsx
#	wework/src/components/projects/ProjectCreateDialog.tsx

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
wework/src/components/projects/ProjectCreateDialog.tsx (1)

260-447: ⚠️ Potential issue | 🟠 Major | 🏗️ Heavy lift

Add modal semantics and move focus into the portaled dialog.

Now that this mounts under document.body, it behaves like a real modal overlay, but the dialog still has no role="dialog" / aria-modal and doesn't move focus inside on open. Keyboard and screen-reader users can stay behind the backdrop or tab back into the page.

♿ Suggested starting point
-      <div
-        data-testid="project-create-dialog"
-        className="w-full max-w-[560px] rounded-lg border border-[`#d8d8d8`] bg-white p-6 shadow-2xl"
-      >
+      <div
+        role="dialog"
+        aria-modal="true"
+        aria-labelledby="project-create-dialog-title"
+        data-testid="project-create-dialog"
+        className="w-full max-w-[560px] rounded-lg border border-[`#d8d8d8`] bg-white p-6 shadow-2xl"
+      >
...
-            <h2 className="text-base font-semibold text-[`#202124`]">{title}</h2>
+            <h2 id="project-create-dialog-title" className="text-base font-semibold text-[`#202124`]">
+              {title}
+            </h2>
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@wework/src/components/projects/ProjectCreateDialog.tsx` around lines 260 -
447, The dialog lacks modal semantics and focus management; add role="dialog"
and aria-modal="true" to the element with data-testid="project-create-dialog"
and give the title element a stable id (e.g. project-create-title) then set
aria-labelledby on the dialog to that id; implement focus management by creating
a ref for the dialog element (used in the createPortal JSX), add tabIndex={-1}
to make it focusable, and in a useEffect when the dialog mounts (or when open)
move focus into the dialog ref and save/restore the previously focused element
on unmount/close (onClose) so keyboard/screen-reader users are trapped into the
modal until closed.
🧹 Nitpick comments (1)
wework/src/components/layout/DesktopWorkbenchLayout.test.tsx (1)

471-525: 🏗️ Heavy lift

Split the new overlay/flyout cases into a dedicated spec file.

This test file is already over 1,300 lines, so adding more portal/layout coverage here makes the fixture harder to maintain. Please move these cases into a focused spec such as DesktopWorkbenchLayout.overlays.test.tsx. As per coding guidelines, "File size limit: If a file exceeds 1000 lines, split it into multiple sub-modules".

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@wework/src/components/layout/DesktopWorkbenchLayout.test.tsx` around lines
471 - 525, Move the two overlay/flyout tests ("renders project create menu as a
body-level flyout to the right of the trigger" and "renders project create
dialog as a page-level overlay") out of the large DesktopWorkbenchLayout test
file into a new focused spec (e.g., DesktopWorkbenchLayout.overlays.test.tsx);
copy the tests as-is but also copy/import any helpers they depend on
(DesktopWorkbenchLayout component, baseProps, render, screen, userEvent,
waitFor, createRect) and keep the getBoundingClientRect spy and its mockRestore
in the first test, then delete the two tests from the original file so the large
file is reduced while the portal/overlay assertions (test IDs:
'projects-create-button', 'projects-create-button-menu',
'project-create-dialog', 'project-existing-folder-button') remain covered in the
new spec.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@wework/src/components/common/ActionMenu.tsx`:
- Around line 160-165: The menu item's height is set to h-8 (32px) which
violates the 44px touch target; in the ActionMenu component update the className
for the menu row (the array building that currently includes 'flex h-8 w-full
items-center gap-2 px-3 text-left text-[13px] leading-[18px]') to use 'h-11' and
add 'min-w-[44px]' (i.e., replace 'h-8' with 'h-11 min-w-[44px]') while leaving
the danger conditional classes unchanged so all shared menu items meet mobile
tap-target guidelines.
- Around line 147-159: The pointer-selection guard pointerSelectionRef.current
can remain true if the item click unmounts the button before its click handler
runs; update the logic that closes the menu (e.g., inside handleItemSelect or
the callback that performs menu close/unmount) to set
pointerSelectionRef.current = false when an item action closes the menu so
future keyboard activations are not dropped; ensure the reset happens after
performing the item action but before or as part of the menu-unmount/close flow
so both onPointerDown and onClick paths are safe.

In `@wework/src/components/layout/DesktopWorkbenchLayout.test.tsx`:
- Around line 472-485: The getBoundingClientRect stub is too broad because
element.querySelector('[data-testid="projects-create-button"]') matches
ancestors; narrow it to only return the trigger rect for the actual anchor by
checking the element itself (e.g. use
element.matches('[data-testid="projects-create-button"]') or
element.dataset.testid === 'projects-create-button') inside the
vi.spyOn(HTMLElement.prototype, 'getBoundingClientRect').mockImplementation
callback so only the true trigger element (not its ancestors) returns the
createRect({ left:104, top:246, width:28, height:28 }); keep the existing
separate case for 'projects-create-button-menu' unchanged.

---

Outside diff comments:
In `@wework/src/components/projects/ProjectCreateDialog.tsx`:
- Around line 260-447: The dialog lacks modal semantics and focus management;
add role="dialog" and aria-modal="true" to the element with
data-testid="project-create-dialog" and give the title element a stable id (e.g.
project-create-title) then set aria-labelledby on the dialog to that id;
implement focus management by creating a ref for the dialog element (used in the
createPortal JSX), add tabIndex={-1} to make it focusable, and in a useEffect
when the dialog mounts (or when open) move focus into the dialog ref and
save/restore the previously focused element on unmount/close (onClose) so
keyboard/screen-reader users are trapped into the modal until closed.

---

Nitpick comments:
In `@wework/src/components/layout/DesktopWorkbenchLayout.test.tsx`:
- Around line 471-525: Move the two overlay/flyout tests ("renders project
create menu as a body-level flyout to the right of the trigger" and "renders
project create dialog as a page-level overlay") out of the large
DesktopWorkbenchLayout test file into a new focused spec (e.g.,
DesktopWorkbenchLayout.overlays.test.tsx); copy the tests as-is but also
copy/import any helpers they depend on (DesktopWorkbenchLayout component,
baseProps, render, screen, userEvent, waitFor, createRect) and keep the
getBoundingClientRect spy and its mockRestore in the first test, then delete the
two tests from the original file so the large file is reduced while the
portal/overlay assertions (test IDs: 'projects-create-button',
'projects-create-button-menu', 'project-create-dialog',
'project-existing-folder-button') remain covered in the new spec.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a23a7b25-72c0-446a-83eb-24bb35d73ab2

📥 Commits

Reviewing files that changed from the base of the PR and between 26479ec and c285b12.

📒 Files selected for processing (3)
  • wework/src/components/common/ActionMenu.tsx
  • wework/src/components/layout/DesktopWorkbenchLayout.test.tsx
  • wework/src/components/projects/ProjectCreateDialog.tsx

Comment on lines +147 to +159
onPointerDown={event => {
event.preventDefault()
event.stopPropagation()
pointerSelectionRef.current = true
void handleItemSelect(item)
}}
onClick={() => {
if (pointerSelectionRef.current) {
pointerSelectionRef.current = false
return
}
void handleItemSelect(item)
}}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Reset the pointer-selection guard when an item closes the menu.

Closing the menu on pointerdown can unmount the button before its click handler runs. When that happens, pointerSelectionRef.current stays true, and the next keyboard activation gets dropped once.

🔧 Proposed fix
  const handleItemSelect = async (item: ActionMenuItem) => {
+   pointerSelectionRef.current = false
    setOpen(false)
    setMenuPosition(null)
    await item.onSelect()
  }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@wework/src/components/common/ActionMenu.tsx` around lines 147 - 159, The
pointer-selection guard pointerSelectionRef.current can remain true if the item
click unmounts the button before its click handler runs; update the logic that
closes the menu (e.g., inside handleItemSelect or the callback that performs
menu close/unmount) to set pointerSelectionRef.current = false when an item
action closes the menu so future keyboard activations are not dropped; ensure
the reset happens after performing the item action but before or as part of the
menu-unmount/close flow so both onPointerDown and onClick paths are safe.

Comment on lines +160 to +165
className={[
'flex h-8 w-full items-center gap-2 px-3 text-left text-[13px] leading-[18px]',
item.danger
? 'text-[#ff7b7b] hover:bg-white/10'
: 'text-white hover:bg-white/10',
].join(' ')}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Don't shrink shared menu items below the 44px touch target.

h-8 makes each action only 32px tall. Since this is a shared component, the new sizing regresses the mobile tap-target requirement and makes the menu harder to use on touch devices. As per coding guidelines, "All interactive elements on mobile must be at least 44px × 44px - use h-11 min-w-[44px] for buttons".

📏 Proposed fix
-                  'flex h-8 w-full items-center gap-2 px-3 text-left text-[13px] leading-[18px]',
+                  'flex h-11 min-h-[44px] w-full items-center gap-2 px-3 text-left text-[13px] leading-[18px]',
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
className={[
'flex h-8 w-full items-center gap-2 px-3 text-left text-[13px] leading-[18px]',
item.danger
? 'text-[#ff7b7b] hover:bg-white/10'
: 'text-white hover:bg-white/10',
].join(' ')}
className={[
'flex h-11 min-h-[44px] w-full items-center gap-2 px-3 text-left text-[13px] leading-[18px]',
item.danger
? 'text-[`#ff7b7b`] hover:bg-white/10'
: 'text-white hover:bg-white/10',
].join(' ')}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@wework/src/components/common/ActionMenu.tsx` around lines 160 - 165, The menu
item's height is set to h-8 (32px) which violates the 44px touch target; in the
ActionMenu component update the className for the menu row (the array building
that currently includes 'flex h-8 w-full items-center gap-2 px-3 text-left
text-[13px] leading-[18px]') to use 'h-11' and add 'min-w-[44px]' (i.e., replace
'h-8' with 'h-11 min-w-[44px]') while leaving the danger conditional classes
unchanged so all shared menu items meet mobile tap-target guidelines.

Comment on lines +472 to +485
const getBoundingClientRectSpy = vi
.spyOn(HTMLElement.prototype, 'getBoundingClientRect')
.mockImplementation(function () {
const element = this as HTMLElement

if (element.querySelector('[data-testid="projects-create-button"]')) {
return createRect({ left: 104, top: 246, width: 28, height: 28 })
}

if (element.dataset.testid === 'projects-create-button-menu') {
return createRect({ left: 0, top: 0, width: 176, height: 76 })
}

return createRect({ left: 0, top: 0, width: 0, height: 0 })

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Narrow the getBoundingClientRect stub to the actual trigger anchor.

element.querySelector('[data-testid="projects-create-button"]') matches every ancestor that contains the button, not just the menu anchor. That can make unrelated layout measurements return the trigger rect and hide real positioning regressions.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@wework/src/components/layout/DesktopWorkbenchLayout.test.tsx` around lines
472 - 485, The getBoundingClientRect stub is too broad because
element.querySelector('[data-testid="projects-create-button"]') matches
ancestors; narrow it to only return the trigger rect for the actual anchor by
checking the element itself (e.g. use
element.matches('[data-testid="projects-create-button"]') or
element.dataset.testid === 'projects-create-button') inside the
vi.spyOn(HTMLElement.prototype, 'getBoundingClientRect').mockImplementation
callback so only the true trigger element (not its ancestors) returns the
createRect({ left:104, top:246, width:28, height:28 }); keep the existing
separate case for 'projects-create-button-menu' unchanged.

…031339

# Conflicts:
#	frontend/src/features/tasks/components/sidebar/TaskSidebar.tsx

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
frontend/src/features/tasks/components/sidebar/TaskSidebar.tsx (1)

778-778: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Fix height calculation to match margin.

The margin was changed from my-3 (24px total) to my-2 (16px total), but the height calculation still subtracts 24px. This creates a mismatch that affects the sidebar's vertical sizing.

📏 Proposed fix
-      <div
-        className="hidden lg:flex lg:flex-col w-full h-full bg-base rounded-3xl shadow-sidebar my-2"
-        style={{ height: 'calc(100% - 24px)' }}
+      <div
+        className="hidden lg:flex lg:flex-col w-full h-full bg-base rounded-3xl shadow-sidebar my-2"
+        style={{ height: 'calc(100% - 16px)' }}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@frontend/src/features/tasks/components/sidebar/TaskSidebar.tsx` at line 778,
The sidebar's vertical spacing was changed in TaskSidebar (className string in
TaskSidebar.tsx) from my-3 to my-2 but the height calculation still subtracts
24px; update the height calculation used by TaskSidebar (wherever the inline
style/CSS calc for height is defined in this component) to subtract 16px (total)
to match my-2 so the sidebar height and margins align.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@frontend/src/features/tasks/components/sidebar/TaskSidebar.tsx`:
- Line 778: The sidebar's vertical spacing was changed in TaskSidebar (className
string in TaskSidebar.tsx) from my-3 to my-2 but the height calculation still
subtracts 24px; update the height calculation used by TaskSidebar (wherever the
inline style/CSS calc for height is defined in this component) to subtract 16px
(total) to match my-2 so the sidebar height and margins align.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ebcfdbd3-3126-4d82-b3ef-f034bc13d263

📥 Commits

Reviewing files that changed from the base of the PR and between c285b12 and 7f45303.

📒 Files selected for processing (2)
  • frontend/src/__tests__/features/tasks/components/sidebar/TaskSidebar.test.tsx
  • frontend/src/features/tasks/components/sidebar/TaskSidebar.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • frontend/src/tests/features/tasks/components/sidebar/TaskSidebar.test.tsx

@qdaxb
qdaxb merged commit 07f635f into wecode-ai:main Jun 2, 2026
25 of 26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants