diff --git a/templates/assets/app/global.css b/templates/assets/app/global.css
index 47561c76a4..3c5e19deb6 100644
--- a/templates/assets/app/global.css
+++ b/templates/assets/app/global.css
@@ -207,10 +207,6 @@
grid-template-columns: minmax(0, 1fr) 284px;
}
- .assets-live-candidates-grid {
- grid-template-columns: minmax(0, 1fr) minmax(18rem, 22rem);
- }
-
.assets-brand-kit-settings-grid {
grid-template-columns: minmax(0, 1fr) 320px;
}
diff --git a/templates/assets/app/routes/brand-kits.$id.tsx b/templates/assets/app/routes/brand-kits.$id.tsx
index 66e193d6c7..e47406e6c5 100644
--- a/templates/assets/app/routes/brand-kits.$id.tsx
+++ b/templates/assets/app/routes/brand-kits.$id.tsx
@@ -1521,6 +1521,7 @@ type LaneGalleryItem = {
thumbnail: ReactNode; // i18n-ignore structural preview slot name
menu?: ReactNode;
primaryActions?: ReactNode;
+ headerActions?: ReactNode;
onToggle?: (checked: boolean) => void;
};
@@ -3909,6 +3910,89 @@ export function LiveCandidatesStage({
);
}
+ function candidateHeaderActions({
+ canUseCandidate,
+ saving,
+ promoting,
+ candidateLibraryId,
+ onSaveCandidate,
+ onAddToReferences,
+ onUseCandidate,
+ onDismiss,
+ }: {
+ canUseCandidate: boolean;
+ saving?: boolean;
+ promoting?: boolean;
+ candidateLibraryId?: string | null;
+ onSaveCandidate?: (folderId: string | null) => void;
+ onAddToReferences?: () => void;
+ onUseCandidate?: () => void;
+ onDismiss: () => void;
+ }) {
+ const busy = saving || promoting || dismissing;
+ const actionLibraryId = candidateLibraryId || libraryId;
+ const candidateFolders =
+ foldersByLibraryId[actionLibraryId] ??
+ (actionLibraryId === libraryId ? folders : []);
+ if (!canUseCandidate) {
+ return (
+
+ );
+ }
+ return (
+
+ {onUseCandidate ? (
+
+ ) : null}
+ onSaveCandidate?.(folderId)}
+ />
+
+
+
+ );
+ }
+
function slotItem(slot: VariantSlot): LaneGalleryItem {
const isFailed = slot.status === "failed";
const canUseCandidate = slot.status === "ready" && Boolean(slot.assetId);
@@ -3953,6 +4037,21 @@ export function LiveCandidatesStage({
slot,
}),
}),
+ headerActions: candidateHeaderActions({
+ canUseCandidate,
+ saving,
+ promoting,
+ candidateLibraryId: libraryId,
+ onSaveCandidate: (folderId) => onSave(slot, folderId),
+ onAddToReferences: () => onMoveToReferences(slot),
+ onUseCandidate: onUse ? () => onUse(slot) : undefined,
+ onDismiss: () =>
+ setDismissTarget({
+ kind: "slot",
+ title,
+ slot,
+ }),
+ }),
};
}
@@ -3997,6 +4096,21 @@ export function LiveCandidatesStage({
asset,
}),
}),
+ headerActions: candidateHeaderActions({
+ canUseCandidate: true,
+ saving,
+ promoting,
+ candidateLibraryId: asset.libraryId,
+ onSaveCandidate: (folderId) => onSaveDraft(asset, folderId),
+ onAddToReferences: () => onMoveDraftToReferences(asset),
+ onUseCandidate: onUseDraft ? () => onUseDraft(asset) : undefined,
+ onDismiss: () =>
+ setDismissTarget({
+ kind: "asset",
+ title: assetDisplayTitle(asset),
+ asset,
+ }),
+ }),
};
}
@@ -4063,154 +4177,103 @@ export function LiveCandidatesStage({
-
-
-
- {t("library.candidates")}
-
-
-
-
-
-
-
-
-
-
- {activeItem?.onOpen ? (
-
- ) : activeItem?.href ? (
-
- {activeItem.preview}
-
- ) : (
- activeItem?.preview
- )}
-
- {activeItem?.busy ? (
-
-
-
- ) : null}
- {activeItem?.onOpen ? (
-
- ) : activeItem?.href ? (
-
- ) : null}
-
-
- {items.map((item) => {
- const active = item.id === activeItem?.id;
- return (
-
- );
- })}
-
-
-