diff --git a/frontend/src/components/ImmichAssetPicker.css b/frontend/src/components/ImmichAssetPicker.css index 6e7d3c8..0917a0a 100644 --- a/frontend/src/components/ImmichAssetPicker.css +++ b/frontend/src/components/ImmichAssetPicker.css @@ -45,7 +45,7 @@ .iap :is(.iap-open, .iap-select, .iap-face-choice, .pz-tab):focus-visible { outline: 2px solid var(--pz-a500); outline-offset: -3px; } .iap-clear-label { display: inline; } .iap-empty { display: grid; justify-items: center; align-content: center; min-height: 210px; gap: 12px; color: var(--pz-faint); text-align: center; } -.iap-empty > p { margin: 0; font: 400 15px/1.45 var(--pz-sans); color: var(--pz-ink-2); } +.iap-empty > p { margin: 0; font: 400 20px/1.2 var(--pz-serif); color: var(--pz-ink-2); } .iap-empty .pz-busy { width: 40px; height: 24px; } .iap-pagination { display: flex; align-items: center; justify-content: space-between; padding: 0 22px 18px; } .iap-footer { position: sticky; bottom: 0; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 18px 28px; background: var(--pz-surface); border-top: 1px solid var(--pz-line); z-index: 2; } @@ -58,7 +58,7 @@ .iap-image--large { background: var(--pz-ink); } .iap-image--large img { width: 100%; height: 100%; object-fit: contain; } .iap-preview-caption { display: grid; gap: 4px; padding: 14px 28px 20px; } -.iap-preview-caption > p { margin: 0; font: 400 15px/1.4 var(--pz-serif); color: var(--pz-ink); overflow-wrap: anywhere; } +.iap-preview-caption > p { margin: 0; font: 400 20px/1.2 var(--pz-serif); color: var(--pz-ink); overflow-wrap: anywhere; } @media (hover: hover) and (pointer: fine) { .iap-open:hover .iap-image img { transform: scale(1.035); } .iap-asset:hover { box-shadow: 0 0 0 1px var(--pz-a300), var(--pz-shadow); } diff --git a/frontend/src/components/MediaManagerPanel.jsx b/frontend/src/components/MediaManagerPanel.jsx index f9ce9a7..952b156 100644 --- a/frontend/src/components/MediaManagerPanel.jsx +++ b/frontend/src/components/MediaManagerPanel.jsx @@ -113,7 +113,7 @@ const MediaManagerPanel = ({ for (const item of immichFiles) { const ok = await onUpload({ file: item.file, - caption: item.file.name.replace(/.[^.]+$/, '') || null, + caption: item.file.name.replace(/\.[^.]+$/, '') || null, source: source.trim() || null, mediaType: item.file.type.startsWith('video/') ? 'video' : 'photo', citationText: '', @@ -231,59 +231,44 @@ const MediaManagerPanel = ({ )} {pickingImmich && canManage && setPickingImmich(false)} onSelect={addImmichFile} />} - {!isCitation && !isYoutubeVideo && !immichAvailable && ( -
- - { setFile(event.target.files?.[0] || null); setImmichFiles([]) }} - /> -
- )} - {!isCitation && !isYoutubeVideo && immichAvailable && (() => { - // Depuis Immich est un lien dans la zone de dépôt (pas un bouton à part) - const immichLink = + {!isCitation && !isYoutubeVideo && (() => { + // Immich ne donne que des photos et des vidéos : le lien n'apparaît que pour ces deux types + const withImmich = immichAvailable && (mediaType === 'photo' || mediaType === 'video') + // Le lien est un bouton dans le label : un clic dessus n'ouvre pas le sélecteur de fichiers + const immichLink = withImmich && const count = immichFiles.length - const label = count === 1 ? t('1 souvenir choisi dans Immich') : count > 1 ? t('{n} souvenirs choisis dans Immich', { n: count }) : file ? file.name : null + const title = count === 1 ? t('1 souvenir choisi dans Immich') + : count > 1 ? t('{n} souvenirs choisis dans Immich', { n: count }) + : file ? file.name : t('Choisir un fichier') + const hint = count > 0 ? <>{t('En ajouter d’autres')} {immichLink} + : file ? t('Pour en prendre un autre, touchez ici') + : mediaType === 'photo' ? t('5 Mo au maximum') : t('20 Mo au maximum') return (
+ { setFile(event.target.files?.[0] || null); setImmichFiles([]) }} /> -
{ if (!event.target.closest('button')) fileInput.current?.click() }}> - - - {label || <>{t('Choisir un fichier')} {t('ou')} {immichLink}} - {file ? <>{t('Pour en prendre un autre, touchez ici')} {t('ou')} {immichLink} : count > 0 ? <>{t('ou')} {immichLink} : (mediaType === 'photo' ? t('5 Mo au maximum') : t('20 Mo au maximum'))} - -
{count > 0 && ( - <> - -

{t('Chaque souvenir garde le nom de son fichier Immich.')}

- + )}
) @@ -316,17 +301,16 @@ const MediaManagerPanel = ({ )}
-
+ {immichFiles.length === 0 &&
0} value={caption} onChange={(event) => setCaption(event.target.value)} placeholder={t('Été à Quiberon, 1978')} /> -
+
} {canManage &&
diff --git a/frontend/src/i18n/en/fiche.js b/frontend/src/i18n/en/fiche.js index f3bcb2d..dd0143a 100644 --- a/frontend/src/i18n/en/fiche.js +++ b/frontend/src/i18n/en/fiche.js @@ -302,7 +302,8 @@ export default { '1 souvenir choisi dans Immich': '1 memory picked from Immich', '{n} souvenirs choisis dans Immich': '{n} memories picked from Immich', 'Souvenirs choisis dans Immich': 'Memories picked from Immich', - 'Chaque souvenir garde le nom de son fichier Immich.': 'Each memory keeps the name of its Immich file.', + 'En ajouter d’autres': 'Add more', + 'Ajouter ces {n} souvenirs': 'Add these {n} memories', 'Filtrer par visage': 'Filter by face', 'Effacer les filtres': 'Clear filters', 'Personne reconnue dans Immich': 'Person recognized in Immich',