Skip to content

Fix local folder picker cancel error and heading redundancy - #4563

Merged
enzoames merged 2 commits into
mainfrom
ai_main_f3a1cbcd5ef14d45b7bf
Sep 9, 2026
Merged

Fix local folder picker cancel error and heading redundancy#4563
enzoames merged 2 commits into
mainfrom
ai_main_f3a1cbcd5ef14d45b7bf

Conversation

@builder-io-integration

@builder-io-integration builder-io-integration Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes two UX issues in the Local files settings page: a raw browser error shown when the user cancels the folder picker, and a redundant "Local files"/"Local folders" heading pair.

Problem

When a user opened the native folder picker (showDirectoryPicker) and backed out, the raw DOMException message ("Failed to execute 'showDirectoryPicker' on 'Window': The user aborted a request.") was surfaced as an error banner, which is confusing and non-user-friendly since cancelling isn't actually a failure. Additionally, the page heading "Local files" was immediately followed by a section heading "Local folders", which read as redundant/duplicated copy.

Solution

Added a helper to detect user-cancellation of the native folder picker (via AbortError name or ABORT_ERR code) and used it to suppress the error state in that case, while still surfacing real failures (e.g. permission denied). Also renamed the "Local folders" heading to "Folders" across locales to remove the redundancy with the "Local files" page title.

Key Changes

  • Added isUserCancelledFolderPickerError in local-folder-picker-safety.ts to identify AbortError/ABORT_ERR from showDirectoryPicker() rejections, distinct from other errors.
  • Updated _app.local-files.tsx to check isUserCancelledFolderPickerError in the catch block and return early (no error state) when the user simply cancelled the picker.
  • Added unit tests covering: recognizing AbortError DOMExceptions, recognizing abort by error code when name is unavailable, and rejecting real failures (NotAllowedError, generic Error, null, non-object values).
  • Updated the localFolders i18n string from "Local folders" to "Folders" (and localized equivalents in zh-TW, zh-CN, and es) to resolve the heading redundancy.

Fixes feedback from Slack thread #an-factory-test-5 (Factory item edd61ff12be975b12c1a5db93fc07836217ba6118be111724e916cdc435a4f0a).
Source: https://slack.com/app_redirect?team=T0GCV21GE&channel=C0BUK2293SA&message_ts=1788463870.010759


Edit in Builder  Preview


To clone this PR locally use the Github CLI with command gh pr checkout 4563

You can tag me at @BuilderIO for anything you want me to fix or change

…l files heading

Cancelling the native showDirectoryPicker() dialog surfaced the raw
AbortError message as a 'Folder add failed' banner. Treat cancellation
as a no-op instead of an error.

Also renames the in-page 'Local folders' section heading to 'Folders'
so it doesn't read as a duplicate of the 'Local files' page title
directly above it.
@netlify

This comment has been minimized.

@builder-io-integration builder-io-integration Bot changed the title fix(content): local folder picker cancel + heading redundancy Fix local folder picker cancel error and heading redundancy Sep 9, 2026
builder-io-integration[bot]

This comment was marked as outdated.

@steve8708

Copy link
Copy Markdown
Contributor

@builderio-bot look at the latest PR feedback and fix anything you agree with. Be skeptical. Reply on each comment thread whether you fixed it and why. Get CI green and keep the branch mergeable.

@gitguardian

gitguardian Bot commented Sep 9, 2026

Copy link
Copy Markdown

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secret in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
32919281 Triggered JSON Web Token c2c3425 packages/core/src/email-catalog/redact-body.spec.ts View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

@builder-io-integration

Copy link
Copy Markdown
Contributor Author

Reviewed the latest PR feedback:

  • Automated code review (builder-io-integration bot): reported "No confirmed issues found" — agreed, nothing to change there. It also noted it couldn't run browser automation; I already verified the fix locally via the added unit tests (isUserCancelledFolderPickerError covering the cancel/abort-code/non-cancellation cases) plus the existing local-files layout tests, all passing.
  • CI: all required checks are green (lint, typecheck, tests, build, security guards).
  • Merged latest main into this branch to pick up unrelated fixes and keep it mergeable/up to date; re-ran the targeted test suites afterward and confirmed my changes are intact and passing.

The PR shows mergeStateStatus: BLOCKED only because it's awaiting a required human review approval — no outstanding code/CI issue on my end.

@builder-io-integration

Copy link
Copy Markdown
Contributor Author

I checked PR #4563's feedback:

  • The only automated review (builder-io-integration bot) reported "No confirmed issues found" — I agree, nothing to fix there.
  • All CI checks are green (lint, typecheck, tests, build, security guards).
  • No inline review comments exist on the PR.
  • Merged latest main into the branch to keep it current, re-ran the targeted tests, and confirmed my changes are intact and passing.

The PR is mergeable: MERGEABLE but mergeStateStatus: BLOCKED solely because it's waiting on a required human review approval — that's not a code or CI issue I can resolve. I posted a summary reply on the PR thread explaining this.



🟢 No actionable PR feedback to fix; CI green, branch up to date and mergeable, pending required review approval.

@builder-io-integration builder-io-integration Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Builder reviewed your changes — looks good ✅

Review Details

Incremental Code Review Summary

I re-reviewed the latest PR #4563 head. The current diff remains a narrowly scoped Content UI repair: it suppresses the folder-add error only for native picker cancellation (AbortError/ABORT_ERR), preserves real failure reporting, and renames the redundant folders heading across the configured locale entries.

Two independent incremental review passes found no new confirmed issues. The helper’s object-shape checks and the route’s early return remain compatible with the existing cleanup/finally behavior, and the added regression suite passes 6/6 tests. No previous review comments were open, so there were no resolved threads to update.

Findings

No new confirmed issues found.

🧪 Browser testing: Attempted — the dev server was healthy, but the browser-test planner and executors had no Chrome automation tools registered. All planned UI cases were reported as unable to verify due to that environment-wide tooling blocker.

@enzoames
enzoames merged commit 7c5e0ae into main Sep 9, 2026
44 checks passed
@enzoames
enzoames deleted the ai_main_f3a1cbcd5ef14d45b7bf branch September 9, 2026 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants