Fix asset preview details toggle and clear candidates UX - #2861
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Here's a visual recap of what changed: Open the full interactive recap |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Builder reviewed your changes — looks good ✅
Review Details
Code Review Summary
PR #2861 is a low-risk UI and localization refinement for the Assets library. It synchronizes the preview dialog's details-toggle label with showDetails, adds count-aware copy to the live-candidate clearing affordances, removes the failed-candidate action when there are no failed slots, and prevents clearing an empty candidate set. The implementation preserves the existing action mutation and cache invalidation flow, keeps aria-pressed aligned with the toggle state, and adds the new translation keys across the supported locale data, including zh-TW.
No clear bugs were identified by either independent code-review pass. The shared candidate action is also used by the main Assets library route, so that route was included in the verification scope. The development server is healthy, but browser executors could not run because Chrome automation tools were unavailable in this session; source-level checks were completed instead.
Risk assessment: Low. No authentication, data-access, schema, or API contract changes are present.
🧪 Browser testing: Could not verify — dev server is available, but browser automation tooling was unavailable to all executors in this session; rerun when Chrome MCP access is restored.

Summary
Fixes two UI issues in the assets library: the preview dialog's details button label never updated when toggled, and the "Clear all" candidates action lacked useful context and hid the "Dismiss failed" option incorrectly.
Problem
In
AssetPreviewDialog, the button always showed "View details" regardless of whether details were shown or hidden, and there was no "Hide details" label for the toggled state. InLiveCandidatesActions, the "Clear all" button/menu item didn't show how many candidates would be affected, the "Dismiss failed" menu item was rendered (but disabled) even when there were no failed items, and "Clear all" remained enabled even when there were zero candidates.Solution
Added a
hideDetailstranslation key and made the preview dialog button label switch based on theshowDetailsstate. Introduced aclearAllWithCounttranslation key across all locales and used it to show the candidate count in the clear action's label and menu item. UpdatedLiveCandidatesActionsto conditionally render the "Dismiss failed" menu item only when failed candidates exist, and disabled the "Clear all" action when there are no candidates to clear.Key Changes
AssetPreviewDialog.tsx: toggle button text betweenlibrary.viewDetailsandlibrary.hideDetailsbased onshowDetailsi18n-data.ts: addedclearAllWithCountandhideDetailskeys for all supported locales (en-US, zh-CN, es, fr, de, ja, ko, pt, hi, ar); updatedclearCandidatesDescriptioncopy for clarityi18n/zh-TW.ts: addedclearAllWithCountandhideDetailskeysbrand-kits.$id.tsx(LiveCandidatesActions): useclearAllWithCountwithtotalCountfor the action label and menu item; only render "Dismiss failed" menu item whenhasFailedis true; disable "Clear all" whentotalCount === 0To clone this PR locally use the Github CLI with command
gh pr checkout 2861You can tag me at @BuilderIO for anything you want me to fix or change