Skip to content

fix: empty folder selection reverts in DirectoryPicker + add create-folder button#1466

Merged
gsxdsm merged 6 commits into
mainfrom
gsxdsm/issue-1454-manage-projet-bug
Jun 6, 2026
Merged

fix: empty folder selection reverts in DirectoryPicker + add create-folder button#1466
gsxdsm merged 6 commits into
mainfrom
gsxdsm/issue-1454-manage-projet-bug

Conversation

@gsxdsm

@gsxdsm gsxdsm commented Jun 6, 2026

Copy link
Copy Markdown
Collaborator

Problem

When selecting a folder path in "Manage project" (Setup Wizard or Project Overview), if the selected folder was empty (contained no subdirectories), the DirectoryPicker would automatically revert to the previous folder after navigation.

Root Cause

The useEffect in DirectoryPicker that auto-fetches directory entries when the browser panel opens used the value prop to determine which path to fetch:

fetchEntries(value || undefined, browser.showHidden);

After the user navigated into an empty folder:

  1. The API returned entries: []
  2. The effect re-ran because entries.length === 0
  3. It incorrectly used the stale value prop (the original path) instead of browser.currentPath (the navigated path)
  4. This caused the browser to jump back to the original directory

Fix

Changed the effect to prioritize browser.currentPath when available:

fetchEntries(browser.currentPath || value || undefined, browser.showHidden);

New Feature: Create Folder Button

As requested, added a "New folder" button to the DirectoryPicker toolbar. Users can now create folders directly within the directory picker when setting up a project, allowing precise control over where and how to name the new project directory.

Changes

File Change
DirectoryPicker.tsx Fix useEffect path selection; add create folder UI state and handlers
DirectoryPicker.css Styles for create folder input, actions, and error display
routes.ts New POST /api/create-directory endpoint
api/legacy.ts New createDirectory() API client function
DirectoryPicker.test.tsx 4 new tests: empty folder navigation, create folder success/error

Test Results

  • 42 DirectoryPicker tests pass (14 cases × 3 configs)
  • Build succeeds
  • Smoke test passes

Summary by CodeRabbit

  • New Features

    • Create subfolders directly from the directory picker via a "New folder" button, inline input, keyboard shortcuts (Enter/Escape), and inline error feedback. Backend now exposes folder-creation support.
  • Bug Fixes

    • Navigating into an empty folder no longer reverts to the previous directory.
  • Tests

    • Added tests for folder creation success, error handling, and directory list refresh.
  • Documentation

    • Added a guide describing the empty-folder navigation bug and its resolution.
  • Localization

    • Added translation strings for the new folder-creation UI (multiple locales).

…older button

Fix bug where navigating into an empty folder in the DirectoryPicker
would automatically revert to the previous folder. The useEffect that
auto-fetches on open was using the stale 'value' prop instead of
'browser.currentPath' after navigation.

Also adds a 'New folder' button to the DirectoryPicker toolbar so users
can create folders directly when setting up a project.

- DirectoryPicker.tsx: fix useEffect to use browser.currentPath || value
- DirectoryPicker.tsx: add create folder UI state and handlers
- DirectoryPicker.css: styles for create folder input and actions
- routes.ts: add POST /api/create-directory endpoint
- legacy.ts: add createDirectory API client
- DirectoryPicker.test.tsx: add tests for empty folder nav and create folder
@coderabbitai

coderabbitai Bot commented Jun 6, 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

Adds backend POST /api/create-directory, a client helper createDirectory, DirectoryPicker create-folder UI/state/handlers, tests for navigation and folder creation, documentation of the empty-folder navigation fix, localization updates, and a release changeset.

Changes

Create Directory Feature

Layer / File(s) Summary
Backend directory creation endpoint
packages/dashboard/src/routes.ts
POST /api/create-directory validates the path is absolute and non-traversing, checks the target does not exist, confirms the parent is a directory, creates the directory via mkdir, and returns a success payload or ApiError.
Frontend API client
packages/dashboard/app/api/legacy.ts
Exports createDirectory(path) that POSTs to the backend endpoint and returns the success response with the resolved path.
Component state and submission logic
packages/dashboard/app/components/DirectoryPicker.tsx
Extends BrowserState with createFolderOpen and createFolderError; initializes state; prefers currentPath on open; adds handlers to toggle the create-folder panel, validate and submit folder names with path-separator normalization, refresh entries on success, and handle keyboard navigation (Enter to submit, Escape to cancel).
Component UI and styling
packages/dashboard/app/components/DirectoryPicker.css, packages/dashboard/app/components/DirectoryPicker.tsx
CSS rules define toggle button states, create-folder panel layout, input width, action row spacing, and error styling. UI renders a "New folder" toolbar button and a conditional create-folder input panel with folder name field, Create/Cancel buttons, and inline error display.
Component tests
packages/dashboard/app/components/__tests__/DirectoryPicker.test.tsx
Extended mocks for Plus icon and createDirectory API function. Added test cases verifying navigation into empty directories, successful folder creation with directory refresh, and error display on creation failure.
Docs and changeset
docs/solutions/ui-bugs/directorypicker-empty-folder-reverts-on-navigation.md, .changeset/directory-picker-create-folder.md
Adds a report describing the empty-folder revert bug, the fix to prefer browser.currentPath in the fetch effect, prevention guidance, links to the regression test, and a changeset documenting the new "New folder" feature and server endpoint.
Localization
packages/i18n/locales/*/app.json
Adds dirPicker translation keys for cancel, create-folder labels/ARIA/confirm/error/title, and a new-folder placeholder across supported locales.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 I nudged a path and gave it a name,
A POST whispered softly, no traversal, no blame,
From picker to server the new folder grows,
The UI blinks green where the creation flows,
Tests hum a chorus — the rabbit hops home. 🌿

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 60.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 accurately captures both main changes: fixing the empty folder reversion bug and adding the new create-folder button feature.
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
  • Commit unit tests in branch gsxdsm/issue-1454-manage-projet-bug

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: 2

Caution

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

⚠️ Outside diff range comments (1)
packages/dashboard/app/components/DirectoryPicker.tsx (1)

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

Incomplete useEffect dependency array.

The effect calls fetchEntries but doesn't include it in the dependency array. If fetchEntries changes (e.g., when nodeId or localNodeId props change), the effect will continue using the stale function reference.

🔧 Recommended fix
 useEffect(() => {
   if (browser.isOpen && browser.currentPath) {
     fetchEntries(browser.currentPath, browser.showHidden);
   }
-}, [browser.showHidden]);
+}, [browser.showHidden, fetchEntries]);

Note: ESLint may warn about missing browser.isOpen and browser.currentPath. These are intentionally omitted to avoid unnecessary re-runs (we only want to refetch when showHidden changes, not when the user navigates). If ESLint complains, add an inline disable with justification.

🤖 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 `@packages/dashboard/app/components/DirectoryPicker.tsx` around lines 105 -
109, The effect in DirectoryPicker.tsx uses fetchEntries but omits it from the
dependency array causing a stale closure; update the useEffect dependency array
to include fetchEntries so it re-runs when that function changes (e.g., due to
nodeId/localNodeId changes), and keep browser.showHidden there; if ESLint warns
about including browser.isOpen or browser.currentPath, add an inline
eslint-disable-next-line comment with a brief justification that those fields
are intentionally omitted to avoid re-fetching on navigation.
🧹 Nitpick comments (1)
packages/dashboard/app/components/DirectoryPicker.tsx (1)

120-144: ⚡ Quick win

Consider frontend validation for folder name.

While the backend validates the path and prevents .. traversal, the frontend could validate that newFolderName doesn't contain path separators (/ or \) or path traversal components. This would provide immediate feedback to users rather than a server error.

✨ Suggested validation
 const handleCreateFolder = useCallback(async () => {
   if (!newFolderName.trim() || !browser.currentPath) return;
+
+  // Validate folder name doesn't contain path separators or traversal
+  if (newFolderName.includes("/") || newFolderName.includes("\\") || newFolderName.includes("..")) {
+    setBrowser((prev) => ({
+      ...prev,
+      createFolderError: "Folder name cannot contain path separators or '..'",
+    }));
+    return;
+  }

   // Normalize path separator for the current platform by using the same
🤖 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 `@packages/dashboard/app/components/DirectoryPicker.tsx` around lines 120 -
144, Add client-side validation in handleCreateFolder to reject folder names
containing path separators or traversal components before calling
createDirectory: check newFolderName.trim() for '/' or '\' or sequences like
'..' (and empty string), and if invalid setBrowser to set createFolderError with
a clear message and stop (do not call createDirectory or fetchEntries). Ensure
you still clear newFolderName and close createFolderOpen only on success; keep
existing error handling for createDirectory failures.
🤖 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 `@packages/dashboard/src/routes.ts`:
- Around line 4483-4516: The mkdir call can fail due to races and should map
known errno values to 4xx API errors instead of letting them bubble as 500s:
wrap the await mkdir(resolvedPath) in a try/catch, inspect the caught error
(e.g. as { code?: string }), and convert EEXIST to a badRequest("Directory
already exists") (or similar client-facing 4xx), ENOENT and ENOTDIR to
badRequest("Parent directory does not exist") / badRequest("Parent path is not a
directory") as appropriate, and rethrow any other errors; reference the existing
symbols resolvedPath, mkdir, stat, parentPath, parentStat and preserve current
behavior for non-errno errors.
- Around line 4469-4481: The handler currently calls resolve(rawPath) before
validating type and absoluteness, which lets non-strings throw and relative
inputs be turned into cwd-relative paths; instead validate rawPath is a string,
then use path.isAbsolute(rawPath) (or rawPath.startsWith('/')) to require an
absolute path, check for ".." traversal on the original rawPath, and only then
call resolve(rawPath) to normalize; update the checks around rawPath,
resolvedPath, resolve(), badRequest() and remove the ineffective resolvedPath
!== resolve(resolvedPath) branch so invalid or non-string inputs return
badRequest rather than causing a 500 or creating paths under cwd.

---

Outside diff comments:
In `@packages/dashboard/app/components/DirectoryPicker.tsx`:
- Around line 105-109: The effect in DirectoryPicker.tsx uses fetchEntries but
omits it from the dependency array causing a stale closure; update the useEffect
dependency array to include fetchEntries so it re-runs when that function
changes (e.g., due to nodeId/localNodeId changes), and keep browser.showHidden
there; if ESLint warns about including browser.isOpen or browser.currentPath,
add an inline eslint-disable-next-line comment with a brief justification that
those fields are intentionally omitted to avoid re-fetching on navigation.

---

Nitpick comments:
In `@packages/dashboard/app/components/DirectoryPicker.tsx`:
- Around line 120-144: Add client-side validation in handleCreateFolder to
reject folder names containing path separators or traversal components before
calling createDirectory: check newFolderName.trim() for '/' or '\' or sequences
like '..' (and empty string), and if invalid setBrowser to set createFolderError
with a clear message and stop (do not call createDirectory or fetchEntries).
Ensure you still clear newFolderName and close createFolderOpen only on success;
keep existing error handling for createDirectory failures.
🪄 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 Plus

Run ID: ca5f6813-6be7-485f-903b-4f9906dbd61c

📥 Commits

Reviewing files that changed from the base of the PR and between f49ab49 and d8e325b.

📒 Files selected for processing (5)
  • packages/dashboard/app/api/legacy.ts
  • packages/dashboard/app/components/DirectoryPicker.css
  • packages/dashboard/app/components/DirectoryPicker.tsx
  • packages/dashboard/app/components/__tests__/DirectoryPicker.test.tsx
  • packages/dashboard/src/routes.ts

Comment thread packages/dashboard/src/routes.ts Outdated
Comment thread packages/dashboard/src/routes.ts
@greptile-apps

greptile-apps Bot commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes a useEffect guard in DirectoryPicker that caused the browser to revert when navigating into an empty folder, and adds a "New folder" button with a POST /api/create-directory backend endpoint. All previously flagged issues (infinite re-fetch loop, ineffective resolve-based path guard, missing browser.loading on Create button, missing !browser.currentPath guard, missing changeset) have been addressed in the current revision.

  • Bug fix: Replaced browser.entries.length === 0 condition with !browser.currentPath so the initial-open fetch fires exactly once and never re-triggers after navigation.
  • New feature: Inline create-folder UI with keyboard support (Enter/Escape), client-side name validation, loading-state guard on the Create button, and inline error display; backed by a new POST /api/create-directory route with isAbsolute, no-.., and parent-exists validation.
  • i18n: Translation strings added across all 6 supported locales.

Confidence Score: 5/5

Safe to merge — the useEffect guard change is a narrow, well-tested one-liner and the new endpoint has solid server-side validation.

The core fix (replacing entries.length === 0 with !browser.currentPath) is correct and the create-folder feature is well-guarded on both client and server. All blocking issues raised in earlier review rounds have been resolved. The only open item is a test-coverage gap for the remote-node surface in the regression test, which does not affect correctness.

The regression test in DirectoryPicker.test.tsx only covers the local (no nodeId) surface for the empty-folder revert fix; a complementary test with nodeId set would close the FN-5893 gap.

Important Files Changed

Filename Overview
packages/dashboard/app/components/DirectoryPicker.tsx Fixes empty-folder revert via !browser.currentPath guard; adds create-folder UI with proper loading/path guards. All previously flagged issues addressed.
packages/dashboard/src/routes.ts New POST /api/create-directory endpoint with isAbsolute check, no-.. validation, parent-exists verification, and TOCTOU-safe mkdir error handling.
packages/dashboard/app/components/tests/DirectoryPicker.test.tsx Adds 3 new tests for empty-folder navigation, create-folder success, and create-folder error; regression test only covers local (no nodeId) surface.
packages/dashboard/app/api/legacy.ts Adds createDirectory() API client function with correct POST body shape and typed response.
packages/dashboard/app/components/DirectoryPicker.css Adds CSS rules for create-folder toggle, input, actions, and error display using existing design tokens.
.changeset/directory-picker-create-folder.md Correct minor bump for @runfusion/fusion with clear feature description.

Sequence Diagram

sequenceDiagram
    participant User
    participant DirectoryPicker
    participant API as /api/browse-directory
    participant CreateAPI as /api/create-directory

    User->>DirectoryPicker: Click Browse
    DirectoryPicker->>API: browseDirectory(value)
    API-->>DirectoryPicker: "{currentPath, entries}"
    Note over DirectoryPicker: browser.currentPath set

    User->>DirectoryPicker: Click empty-folder entry
    DirectoryPicker->>API: browseDirectory("/empty-folder")
    API-->>DirectoryPicker: "{currentPath: "/empty-folder", entries: []}"
    Note over DirectoryPicker: useEffect: !browser.currentPath = false → no re-fetch

    User->>DirectoryPicker: Click "New folder"
    DirectoryPicker->>DirectoryPicker: "createFolderOpen = true"

    User->>DirectoryPicker: Type name + click Create
    DirectoryPicker->>CreateAPI: "POST {path: "/empty-folder/new-dir"}"
    CreateAPI->>CreateAPI: isAbsolute + no-.. check\nparent exists check\nmkdir
    CreateAPI-->>DirectoryPicker: "{success: true, path}"
    DirectoryPicker->>API: browseDirectory(browser.currentPath)
    API-->>DirectoryPicker: refreshed entries
Loading

Reviews (6): Last reviewed commit: "fix: disable Create button when currentP..." | Re-trigger Greptile

Comment thread packages/dashboard/app/components/DirectoryPicker.tsx Outdated
Comment thread packages/dashboard/src/routes.ts Outdated
Comment thread packages/dashboard/app/components/DirectoryPicker.tsx
Comment thread packages/dashboard/app/components/DirectoryPicker.tsx
gsxdsm added 2 commits June 6, 2026 01:42
- routes.ts: use isAbsolute() before resolve() for proper path validation
- routes.ts: wrap mkdir() in try/catch to map EEXIST/ENOENT/ENOTDIR to 4xx
- DirectoryPicker.tsx: use !browser.currentPath guard to prevent re-fetch loop
- DirectoryPicker.tsx: disable Create button during in-flight requests
- DirectoryPicker.tsx: add fetchEntries to useEffect dependency array
- DirectoryPicker.tsx: client-side validation for folder names
- Add changeset for the new create-folder feature
@gsxdsm

gsxdsm commented Jun 6, 2026

Copy link
Copy Markdown
Collaborator Author

@coderabbitai All actionable review comments have been addressed:

  1. ✅ Path validation now uses isAbsolute() before resolve()
  2. mkdir() races mapped to 4xx responses
  3. ✅ Re-trigger loop fixed with !browser.currentPath guard
  4. ✅ Create button disabled during in-flight requests
  5. ✅ Changeset added for the new feature
  6. fetchEntries added to dependency array
  7. ✅ Frontend validation for folder names

@gsxdsm

gsxdsm commented Jun 6, 2026

Copy link
Copy Markdown
Collaborator Author

@greptile-apps All feedback items have been addressed:

  1. ✅ Re-trigger loop: Changed guard from entries.length === 0 to !browser.currentPath — effect only fires on initial open, never after navigation.
  2. ✅ Absolute path validation: Now uses path.isAbsolute() before resolve(), removed the always-false resolvedPath !== resolve(resolvedPath) check.
  3. ✅ Create button: Now disabled with browser.loading to prevent duplicate requests.
  4. ✅ Changeset: Added .changeset/directory-picker-create-folder.md with @runfusion/fusion: minor.
  5. ✅ Dependency array: Added fetchEntries to the showHidden effect with eslint-disable justification.
  6. ✅ Frontend validation: Folder names are validated client-side for path separators and .. traversal.

The empty-folder regression test now deterministically asserts the loop never fires (no mock exhaustion needed).

@coderabbitai

coderabbitai Bot commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

@gsxdsm Thanks for the thorough follow-through! All seven items are solid improvements — the isAbsolute() guard + race-condition 4xx mapping on the server side, the !browser.currentPath guard closing the re-trigger loop, in-flight button disabling, and the frontend name validation together make this a well-hardened feature. I'll trigger a fresh review pass to verify the updated state.

(ノ◕ヮ◕)ノ*:・゚✧


🧠 Learnings used
Learnt from: gsxdsm
Repo: Runfusion/Fusion PR: 1354
File: plugins/fusion-plugin-acp-runtime/src/path-jail.ts:210-223
Timestamp: 2026-06-03T19:58:31.339Z
Learning: In `plugins/fusion-plugin-acp-runtime/src/path-jail.ts`, `openWithinCwd` has a known TOCTOU residual: it re-validates via `realpath(safePath)` (pathname check) rather than the opened fd's inode (e.g., `/proc/self/fd/<fd>` or `openat`/`RESOLVE_BENEATH`). The accepted mitigation is "truncate-after-validate" (commit 590383bd3), which ensures no write is committed to an escaped path before the jail check rejects it. Full `openat`/`RESOLVE_BENEATH`-based fd-inode hardening is an explicitly accepted P2/P3 residual tracked in the PR description for a future PR. Do not re-flag this as a blocking issue in reviews of this package.

Learnt from: CR
Repo: Runfusion/Fusion PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-06-06T07:39:43.692Z
Learning: Applies to packages/{engine,dashboard}/src/**/*.{js,ts,tsx} : FN-5419: git run-audit now includes `pull:fast-forward` and `stash:pop-conflict`; dashboard git surfaces now include the extended `POST /api/git/pull` integration-worktree path plus companion `POST /api/git/stash-resolve`, `POST /api/git/stash-drop`, and `POST /api/git/stash-apply` routes.

Learnt from: CR
Repo: Runfusion/Fusion PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-05-30T23:34:20.469Z
Learning: Applies to packages/@(fusion|runfusion)/**/*.{ts,tsx} : Git run-audit now includes `pull:fast-forward` and `stash:pop-conflict`. Dashboard git surfaces include the extended `POST /api/git/pull` integration-worktree path plus companion `POST /api/git/stash-resolve`, `POST /api/git/stash-drop`, and `POST /api/git/stash-apply` routes.
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@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: 2

Caution

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

⚠️ Outside diff range comments (1)
packages/dashboard/app/components/DirectoryPicker.tsx (1)

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

Reopening after a browse error cannot recover.

Line 79 blocks initial fetch when browser.error is set, and Line 71 doesn’t clear that error when reopening. After one failure, closing/reopening the picker won’t trigger a retry.

Suggested fix
   const handleToggleBrowser = useCallback(() => {
     setBrowser((prev) => {
       if (!prev.isOpen) {
         // Opening — fetch entries
-        return { ...prev, isOpen: true };
+        return { ...prev, isOpen: true, error: null };
       }
       return { ...prev, isOpen: false };
     });
   }, []);

Also applies to: 79-82

🤖 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 `@packages/dashboard/app/components/DirectoryPicker.tsx` around lines 67 - 74,
The component never clears browser.error when reopening, so after one failed
fetch the picker won’t retry; update handleToggleBrowser to clear browser.error
(via setBrowser) when opening so the fetch-on-open path can run, and/or adjust
the initial-fetch logic (the effect or function that triggers fetching when
isOpen becomes true) to ignore a stale browser.error and attempt a retry;
reference handleToggleBrowser, setBrowser, and browser.error (and the
fetch-on-open effect/fetch function) when making the change.
🤖 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 `@packages/dashboard/app/components/DirectoryPicker.tsx`:
- Around line 123-129: The validation error string for new folder names is
hard-coded instead of localized; replace the literal message passed into
setBrowser(..., createFolderError: "...") with a call to the translation
function used elsewhere (e.g., t("...")) so the error is localizable — update
the block that checks trimmedName.includes(...) / trimmedName.includes("\\") /
trimmedName.includes("..") to set createFolderError using t(...) (reference
symbols: trimmedName, newFolderName, setBrowser, createFolderError, and the
component's t function).
- Line 108: The file contains an invalid ESLint suppression comment "//
eslint-disable-next-line react-hooks/exhaustive-deps" that references a rule the
project doesn't register; remove that suppression and either add the correct
dependencies to the related useEffect (in the DirectoryPicker component) or, if
a deliberate omission is required, replace it with a project-registered
suppression (e.g., remove the line and ensure the useEffect's dependency array
on the useEffect call in DirectoryPicker includes all referenced variables or
add a short comment explaining why a missing dependency is intentional). Locate
the offending comment near the useEffect inside the DirectoryPicker component
and remove it or fix the dependency array there so ESLint no longer needs the
undefined rule suppression.

---

Outside diff comments:
In `@packages/dashboard/app/components/DirectoryPicker.tsx`:
- Around line 67-74: The component never clears browser.error when reopening, so
after one failed fetch the picker won’t retry; update handleToggleBrowser to
clear browser.error (via setBrowser) when opening so the fetch-on-open path can
run, and/or adjust the initial-fetch logic (the effect or function that triggers
fetching when isOpen becomes true) to ignore a stale browser.error and attempt a
retry; reference handleToggleBrowser, setBrowser, and browser.error (and the
fetch-on-open effect/fetch function) when making the change.
🪄 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 Plus

Run ID: 3a6d7594-d700-45c4-aadb-d0c882d6312c

📥 Commits

Reviewing files that changed from the base of the PR and between 020a1cf and ee5f5e8.

📒 Files selected for processing (3)
  • .changeset/directory-picker-create-folder.md
  • packages/dashboard/app/components/DirectoryPicker.tsx
  • packages/dashboard/src/routes.ts
✅ Files skipped from review due to trivial changes (1)
  • .changeset/directory-picker-create-folder.md

Comment thread packages/dashboard/app/components/DirectoryPicker.tsx Outdated
Comment thread packages/dashboard/app/components/DirectoryPicker.tsx
Comment thread packages/dashboard/app/components/DirectoryPicker.tsx Outdated
gsxdsm added 2 commits June 6, 2026 06:59
- Add dirPicker.createFolderError to all locale files (en, es, fr, ko, zh-CN, zh-TW)
- Use t() for the folder name validation error in DirectoryPicker
- Add missing dirPicker keys: cancel, createFolder, createFolderAria,
  createFolderConfirm, createFolderTitle, newFolderPlaceholder
@gsxdsm
gsxdsm merged commit ba16805 into main Jun 6, 2026
5 checks passed
@gsxdsm
gsxdsm deleted the gsxdsm/issue-1454-manage-projet-bug branch June 6, 2026 16:24
@gsxdsm gsxdsm mentioned this pull request Jun 8, 2026
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.

1 participant