feat(web): add RemoveFromAlbumAction to asset viewer nav bar (#27000)

This commit is contained in:
Timon
2026-03-26 18:20:28 +01:00
committed by GitHub
parent c9c2322b9d
commit 67cedfef17
4 changed files with 34 additions and 7 deletions
@@ -103,6 +103,20 @@
await navigate({ targetRoute: 'current', assetId: null, assetGridRouteSearchParams: $gridScrollTarget });
};
const handleRemoveFromAlbum = async (assetIds: string[]) => {
timelineManager.removeAssets(assetIds);
if (!assetIds.includes(assetCursor.current.id)) {
return;
}
// keep the cleanup workflow in viewer by moving to adjacent asset first
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
(await navigateToAsset(assetCursor?.nextAsset)) ||
(await navigateToAsset(assetCursor?.previousAsset)) ||
(await handleClose(assetCursor.current));
};
const handlePreAction = async (action: Action) => {
switch (action.type) {
case removeAction:
@@ -232,6 +246,7 @@
}}
onUndoDelete={handleUndoDelete}
onRandom={handleRandom}
onRemoveFromAlbum={handleRemoveFromAlbum}
onClose={handleClose}
/>
{/await}