Skip to content

Codex/unify project sidebar - #1139

Merged
qdaxb merged 1 commit into
wecode-ai:mainfrom
FicoHu:codex/unify-project-sidebar
May 19, 2026
Merged

qdaxb merged 1 commit into
wecode-ai:mainfrom
FicoHu:codex/unify-project-sidebar

Conversation

@FicoHu

@FicoHu FicoHu commented May 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features

    • Workspace project creation: OpenClaw devices are excluded from the device selection for workspace projects.
  • Tests

    • Added test coverage verifying workspace project creation excludes OpenClaw devices from the available device list.

Review Change Stack

@coderabbitai

coderabbitai Bot commented May 19, 2026 •

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c17d6b8e-c9c4-4d27-8b35-14f5c0ca4639

📥 Commits

Reviewing files that changed from the base of the PR and between 0065b01 and e99f7b7.

📒 Files selected for processing (2)
  • frontend/src/__tests__/features/projects/components/ProjectCreateDialog.test.tsx
  • frontend/src/features/projects/components/ProjectCreateDialog.tsx
✅ Files skipped from review due to trivial changes (1)
  • frontend/src/features/projects/components/ProjectCreateDialog.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • frontend/src/tests/features/projects/components/ProjectCreateDialog.test.tsx

📝 Walkthrough

Walkthrough

Filters workspace-mode device options in ProjectCreateDialog to exclude devices with bind_shell === 'openclaw' and adds a Jest test verifying ClaudeCode devices appear while OpenClaw devices do not.

Changes

Workspace device filtering and test

Layer / File(s) Summary
Exclude OpenClaw from onlineDevices
frontend/src/features/projects/components/ProjectCreateDialog.tsx
Adds bind_shell !== 'openclaw' to the devices.filter(...) that builds onlineDevices, preserving the existing 'online'/'busy' criteria.
Test: workspace excludes OpenClaw
frontend/src/__tests__/features/projects/components/ProjectCreateDialog.test.tsx
New Jest test that mocks useDevices with ClaudeCode and OpenClaw devices, renders the dialog in mode="workspace", and asserts ClaudeCode is shown while OpenClaw is not.

Estimated Code Review Effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 I hop through code to clear the way,
OpenClaw hidden, ClaudeCode on display,
A tiny test to make it stay,
Workspace picks the right array,
Hooray, the dialog shows the day!

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Title check ⚠️ Warning The PR title 'Codex/unify project sidebar' does not match the actual changes, which filter OpenClaw devices from ProjectCreateDialog. Update the title to reflect the actual change, e.g., 'Filter OpenClaw devices from ProjectCreateDialog workspace options'.
Docstring Coverage ⚠️ Warning Docstring coverage is 8.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9df23e880a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

open={createDialogOpen}
onOpenChange={setCreateDialogOpen}
mode={isWorkspaceSection ? 'workspace' : 'group'}
mode={isUnifiedSection || isWorkspaceSection ? 'workspace' : 'group'}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Honor the workspace feature flag before opening creation

When NEXT_PUBLIC_ENABLE_PROJECT_WORKSPACE is false or the user is outside PROJECT_WORKSPACE_WHITELIST, ProjectContext.isWorkspaceEnabled is false, but the sidebar now renders the default unified section and this line always opens ProjectCreateDialog in workspace mode for that section. This bypasses the existing feature gate that previously guarded the workspace section in TaskSidebar, so users with the workspace feature disabled can still click the sidebar + and create workspace projects; gate the create action/dialog mode on isWorkspaceEnabled or fall back to group creation when disabled.

Useful? React with 👍 / 👎.

@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

🤖 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/__tests__/utils/version.test.ts`:
- Around line 8-12: Add assertions to the isVersionAtLeast tests to cover
uppercase 'V' and whitespace normalization: update the test case in
frontend/src/__tests__/utils/version.test.ts (the test block using
isVersionAtLeast) to include checks like isVersionAtLeast('V1.7.11', '1.7.11')
and isVersionAtLeast('  v1.7.11 ', '1.7.11') (and their symmetric variants) to
ensure the parser trims input and accepts both 'v' and 'V' prefixes.
🪄 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: c5245237-bc39-4148-8f7a-78720285608f

📥 Commits

Reviewing files that changed from the base of the PR and between 2005db6 and 9df23e8.

📒 Files selected for processing (14)
  • frontend/src/__tests__/features/projects/components/ProjectCreateDialog.test.tsx
  • frontend/src/__tests__/features/projects/components/project-sidebar-behavior.test.tsx
  • frontend/src/__tests__/utils/version.test.ts
  • frontend/src/features/projects/components/DroppableProject.tsx
  • frontend/src/features/projects/components/ProjectCreateDialog.tsx
  • frontend/src/features/projects/components/ProjectSection.tsx
  • frontend/src/features/projects/components/ProjectTaskMenu.tsx
  • frontend/src/features/projects/contexts/dndContext.tsx
  • frontend/src/features/projects/utils/projectClassification.ts
  • frontend/src/features/tasks/components/sidebar/TaskMenu.tsx
  • frontend/src/features/tasks/components/sidebar/TaskSidebar.tsx
  • frontend/src/i18n/locales/en/projects.json
  • frontend/src/i18n/locales/zh-CN/projects.json
  • frontend/src/lib/utils.ts

Comment on lines +8 to +12
test('accepts versions with a v prefix', () => {
expect(isVersionAtLeast('v1.7.11', '1.7.11')).toBe(true)
expect(isVersionAtLeast('1.7.11', 'v1.7.11')).toBe(true)
expect(isVersionAtLeast('v1.7.10', 'v1.7.11')).toBe(false)
})

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

Add coverage for uppercase V and whitespace normalization.

Line 8 currently validates only lowercase v. Since parser logic now trims and accepts V, add explicit assertions to prevent regressions.

Suggested test additions
 describe('version utils', () => {
   test('accepts versions with a v prefix', () => {
     expect(isVersionAtLeast('v1.7.11', '1.7.11')).toBe(true)
     expect(isVersionAtLeast('1.7.11', 'v1.7.11')).toBe(true)
     expect(isVersionAtLeast('v1.7.10', 'v1.7.11')).toBe(false)
+    expect(isVersionAtLeast('V1.7.11', '1.7.11')).toBe(true)
+    expect(isVersionAtLeast('  v1.7.11  ', '1.7.11')).toBe(true)
   })
 })
📝 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
test('accepts versions with a v prefix', () => {
expect(isVersionAtLeast('v1.7.11', '1.7.11')).toBe(true)
expect(isVersionAtLeast('1.7.11', 'v1.7.11')).toBe(true)
expect(isVersionAtLeast('v1.7.10', 'v1.7.11')).toBe(false)
})
test('accepts versions with a v prefix', () => {
expect(isVersionAtLeast('v1.7.11', '1.7.11')).toBe(true)
expect(isVersionAtLeast('1.7.11', 'v1.7.11')).toBe(true)
expect(isVersionAtLeast('v1.7.10', 'v1.7.11')).toBe(false)
expect(isVersionAtLeast('V1.7.11', '1.7.11')).toBe(true)
expect(isVersionAtLeast(' v1.7.11 ', '1.7.11')).toBe(true)
})
🤖 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__/utils/version.test.ts` around lines 8 - 12, Add
assertions to the isVersionAtLeast tests to cover uppercase 'V' and whitespace
normalization: update the test case in
frontend/src/__tests__/utils/version.test.ts (the test block using
isVersionAtLeast) to include checks like isVersionAtLeast('V1.7.11', '1.7.11')
and isVersionAtLeast('  v1.7.11 ', '1.7.11') (and their symmetric variants) to
ensure the parser trims input and accepts both 'v' and 'V' prefixes.

@FicoHu
FicoHu force-pushed the codex/unify-project-sidebar branch from 8296d6e to 0065b01 Compare May 19, 2026 11:50
@FicoHu
FicoHu force-pushed the codex/unify-project-sidebar branch from 0065b01 to e99f7b7 Compare May 19, 2026 11:55
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