Skip to content

Fix asset preview details toggle and clear candidates UX - #2861

Open
NKoech123 wants to merge 1 commit into
mainfrom
ai_main_85c5cf7f06354ca59bbd
Open

Fix asset preview details toggle and clear candidates UX#2861
NKoech123 wants to merge 1 commit into
mainfrom
ai_main_85c5cf7f06354ca59bbd

Conversation

@NKoech123

@NKoech123 NKoech123 commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

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. In LiveCandidatesActions, 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 hideDetails translation key and made the preview dialog button label switch based on the showDetails state. Introduced a clearAllWithCount translation key across all locales and used it to show the candidate count in the clear action's label and menu item. Updated LiveCandidatesActions to 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 between library.viewDetails and library.hideDetails based on showDetails
  • i18n-data.ts: added clearAllWithCount and hideDetails keys for all supported locales (en-US, zh-CN, es, fr, de, ja, ko, pt, hi, ar); updated clearCandidatesDescription copy for clarity
  • i18n/zh-TW.ts: added clearAllWithCount and hideDetails keys
  • brand-kits.$id.tsx (LiveCandidatesActions): use clearAllWithCount with totalCount for the action label and menu item; only render "Dismiss failed" menu item when hasFailed is true; disable "Clear all" when totalCount === 0

Edit in Builder  Preview


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

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

@NKoech123
NKoech123 requested a review from enzoames August 13, 2026 17:01
@netlify

This comment has been minimized.

@builder-io-integration builder-io-integration Bot changed the title Update from the Builder.io agent Fix asset preview details toggle and clear candidates UX Aug 13, 2026
@netlify

This comment has been minimized.

@github-actions

Copy link
Copy Markdown
Contributor

Here's a visual recap of what changed:

Visual recap

Open the full interactive recap

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@builder-io-integration builder-io-integration 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.

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.

@NKoech123
NKoech123 enabled auto-merge (squash) August 14, 2026 00:12
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