Fix local folder picker cancel error and heading redundancy - #4563
Conversation
…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.
This comment has been minimized.
This comment has been minimized.
|
@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. |
…f3a1cbcd5ef14d45b7bf
|
| 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
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secret safely. Learn here the best practices.
- Revoke and rotate this secret.
- 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
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 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.
|
Reviewed the latest PR feedback:
The PR shows |
|
I checked PR #4563's feedback:
The PR is ⠀ |
There was a problem hiding this comment.
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.
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 rawDOMExceptionmessage ("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
AbortErrorname orABORT_ERRcode) 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
isUserCancelledFolderPickerErrorinlocal-folder-picker-safety.tsto identifyAbortError/ABORT_ERRfromshowDirectoryPicker()rejections, distinct from other errors._app.local-files.tsxto checkisUserCancelledFolderPickerErrorin the catch block and return early (no error state) when the user simply cancelled the picker.AbortErrorDOMExceptions, recognizing abort by error code when name is unavailable, and rejecting real failures (NotAllowedError, genericError,null, non-object values).localFoldersi18n 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 itemedd61ff12be975b12c1a5db93fc07836217ba6118be111724e916cdc435a4f0a).Source: https://slack.com/app_redirect?team=T0GCV21GE&channel=C0BUK2293SA&message_ts=1788463870.010759
To clone this PR locally use the Github CLI with command
gh pr checkout 4563You can tag me at @BuilderIO for anything you want me to fix or change