Compare commits

...

4 Commits

Author SHA1 Message Date
bwees
660c68c660 fix: logic error on button 2026-01-14 14:33:57 -06:00
bwees
49449ca8e3 fix: save button loading when applying edits 2026-01-14 14:30:22 -06:00
bwees
db5d96d66b chore: cleanup logic for editing button enabling 2026-01-14 14:30:22 -06:00
bwees
7139a5af4b feat: enable image editing 2026-01-14 14:30:19 -06:00
3 changed files with 23 additions and 24 deletions

View File

@@ -8,6 +8,7 @@
import AddToStackAction from '$lib/components/asset-viewer/actions/add-to-stack-action.svelte'; import AddToStackAction from '$lib/components/asset-viewer/actions/add-to-stack-action.svelte';
import ArchiveAction from '$lib/components/asset-viewer/actions/archive-action.svelte'; import ArchiveAction from '$lib/components/asset-viewer/actions/archive-action.svelte';
import DeleteAction from '$lib/components/asset-viewer/actions/delete-action.svelte'; import DeleteAction from '$lib/components/asset-viewer/actions/delete-action.svelte';
import EditAction from '$lib/components/asset-viewer/actions/edit-action.svelte';
import KeepThisDeleteOthersAction from '$lib/components/asset-viewer/actions/keep-this-delete-others.svelte'; import KeepThisDeleteOthersAction from '$lib/components/asset-viewer/actions/keep-this-delete-others.svelte';
import RatingAction from '$lib/components/asset-viewer/actions/rating-action.svelte'; import RatingAction from '$lib/components/asset-viewer/actions/rating-action.svelte';
import RemoveAssetFromStack from '$lib/components/asset-viewer/actions/remove-asset-from-stack.svelte'; import RemoveAssetFromStack from '$lib/components/asset-viewer/actions/remove-asset-from-stack.svelte';
@@ -20,7 +21,7 @@
import UnstackAction from '$lib/components/asset-viewer/actions/unstack-action.svelte'; import UnstackAction from '$lib/components/asset-viewer/actions/unstack-action.svelte';
import ButtonContextMenu from '$lib/components/shared-components/context-menu/button-context-menu.svelte'; import ButtonContextMenu from '$lib/components/shared-components/context-menu/button-context-menu.svelte';
import MenuOption from '$lib/components/shared-components/context-menu/menu-option.svelte'; import MenuOption from '$lib/components/shared-components/context-menu/menu-option.svelte';
import { AppRoute } from '$lib/constants'; import { AppRoute, ProjectionType } from '$lib/constants';
import { featureFlagsManager } from '$lib/managers/feature-flags-manager.svelte'; import { featureFlagsManager } from '$lib/managers/feature-flags-manager.svelte';
import { getGlobalActions } from '$lib/services/app.service'; import { getGlobalActions } from '$lib/services/app.service';
import { getAssetActions, handleReplaceAsset } from '$lib/services/asset.service'; import { getAssetActions, handleReplaceAsset } from '$lib/services/asset.service';
@@ -72,7 +73,7 @@
onUndoDelete?: OnUndoDelete; onUndoDelete?: OnUndoDelete;
onRunJob: (name: AssetJobName) => void; onRunJob: (name: AssetJobName) => void;
onPlaySlideshow: () => void; onPlaySlideshow: () => void;
// onEdit: () => void; onEdit: () => void;
onClose?: () => void; onClose?: () => void;
playOriginalVideo: boolean; playOriginalVideo: boolean;
setPlayOriginalVideo: (value: boolean) => void; setPlayOriginalVideo: (value: boolean) => void;
@@ -92,7 +93,7 @@
onRunJob, onRunJob,
onPlaySlideshow, onPlaySlideshow,
onClose, onClose,
// onEdit, onEdit,
playOriginalVideo = false, playOriginalVideo = false,
setPlayOriginalVideo, setPlayOriginalVideo,
}: Props = $props(); }: Props = $props();
@@ -116,18 +117,15 @@
$derived(getAssetActions($t, asset)); $derived(getAssetActions($t, asset));
const sharedLink = getSharedLink(); const sharedLink = getSharedLink();
// TODO: Enable when edits are ready for release const editorDisabled = $derived(
// let showEditorButton = $derived( !isOwner ||
// isOwner && asset.type !== AssetTypeEnum.Image ||
// asset.type === AssetTypeEnum.Image && asset.livePhotoVideoId ||
// !( (asset.exifInfo?.projectionType === ProjectionType.EQUIRECTANGULAR &&
// asset.exifInfo?.projectionType === ProjectionType.EQUIRECTANGULAR || asset.originalPath.toLowerCase().endsWith('.insp')) ||
// (asset.originalPath && asset.originalPath.toLowerCase().endsWith('.insp')) asset.originalPath.toLowerCase().endsWith('.gif') ||
// ) && asset.originalPath.toLowerCase().endsWith('.svg'),
// !(asset.originalPath && asset.originalPath.toLowerCase().endsWith('.gif')) && );
// !(asset.originalPath && asset.originalPath.toLowerCase().endsWith('.svg')) &&
// !asset.livePhotoVideoId,
// );
</script> </script>
<CommandPaletteDefaultProvider <CommandPaletteDefaultProvider
@@ -180,9 +178,9 @@
<RatingAction {asset} {onAction} /> <RatingAction {asset} {onAction} />
{/if} {/if}
<!-- {#if showEditorButton} {#if !editorDisabled}
<EditAction onAction={onEdit} /> <EditAction onAction={onEdit} />
{/if} --> {/if}
{#if isOwner} {#if isOwner}
<DeleteAction {asset} {onAction} {preAction} {onUndoDelete} /> <DeleteAction {asset} {onAction} {preAction} {onUndoDelete} />

View File

@@ -255,12 +255,12 @@
}); });
}; };
// const showEditor = () => { const showEditor = () => {
// if (assetViewerManager.isShowActivityPanel) { if (assetViewerManager.isShowActivityPanel) {
// assetViewerManager.isShowActivityPanel = false; assetViewerManager.isShowActivityPanel = false;
// } }
// isShowEditor = !isShowEditor; isShowEditor = !isShowEditor;
// }; };
const handleRunJob = async (name: AssetJobName) => { const handleRunJob = async (name: AssetJobName) => {
try { try {
@@ -431,6 +431,7 @@
onCopyImage={copyImage} onCopyImage={copyImage}
preAction={handlePreAction} preAction={handlePreAction}
onAction={handleAction} onAction={handleAction}
onEdit={showEditor}
{onUndoDelete} {onUndoDelete}
onRunJob={handleRunJob} onRunJob={handleRunJob}
onPlaySlideshow={() => ($slideshowState = SlideshowState.PlaySlideshow)} onPlaySlideshow={() => ($slideshowState = SlideshowState.PlaySlideshow)}

View File

@@ -62,7 +62,7 @@
/> />
<p class="text-lg text-immich-fg dark:text-immich-dark-fg capitalize">{$t('editor')}</p> <p class="text-lg text-immich-fg dark:text-immich-dark-fg capitalize">{$t('editor')}</p>
</HStack> </HStack>
<Button shape="round" size="small" onclick={applyEdits}>{$t('save')}</Button> <Button shape="round" size="small" onclick={applyEdits} loading={editManager.isApplyingEdits}>{$t('save')}</Button>
</HStack> </HStack>
<section> <section>