Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.fr.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ Le tri reste gratuit et illimité. **Plus**, c'est pour vos séances les plus ex
| **La précision maximale** | 5 modèles de plus, environ 777 Mo à télécharger une fois : RetinaFace ResNet-50 trouve les petits visages des photos de groupe (un second passage à 1 280 px), DINOv2 regroupe les rafales et les quasi-doublons (il sépare les doublons des scènes différentes environ deux fois plus nettement que le CLIP B/32 de la précision Standard : +0,25 de cosinus contre +0,11), CLIP ViT-L/14 (un modèle de vision environ 3,5 fois plus grand) pour la recherche et la note esthétique, RF-DETR-Seg juge les sujets sans visage exploitable (de dos, les animaux), avec la note esthétique LAION V2. Plus lent, plus fin. |
| **La recherche IA** | Tapez « première danse », « robe bleue » ou « blue dress » : les bonnes photos remontent en tête. |
| **Des statistiques détaillées** | Sur toutes vos séances : le taux de sélection, global et par séance ; pourquoi des photos sont rejetées (la raison principale donnée par l'IA, ou votre propre choix) ; combien de fois vous avez inversé le choix de l'IA, dans un sens et dans l'autre ; les photos par mois de prise de vue ; les rafales regroupées ; vos boîtiers et leur taux de sélection ; et la vitesse d'analyse mesurée sur votre ordinateur, par précision. Un tableau de vos séances ouvre chacune d'elles. Calculées sur votre ordinateur, jamais envoyées. |
| **Aucune promotion Pelli** | La version gratuite montre deux petites cartes Pelli, sur l'écran d'accueil et à la fin d'un export. Plus les retire. |
| **Aucune promotion Pelli** | La version gratuite montre deux petites cartes Pelli, sur l'écran d'accueil et à la fin d'un export, et une seule fois, après votre troisième export, une carte qui invite à suivre Pelli sur Instagram ou à mettre une étoile au projet sur GitHub. Plus les retire. |

- **Une clé par ordinateur, transférable.** Le paiement se fait avec Stripe dans votre navigateur, et l'app s'active toute seule. Votre clé (`XXXX-XXXX-XXXX-XXXX`) s'affiche dans l'app et sur la page de confirmation : pour passer Plus sur un autre ordinateur, *Libérer cette licence* dans *Réglages → Pelli Instant Plus*, puis saisissez la clé sur l'autre. Réinstaller sur le même ordinateur demande seulement de ressaisir la clé.
- **Discret.** Pelli ne garde ni nom, ni e-mail, ni pays pour Plus : seulement la clé, une empreinte de l'identifiant de votre ordinateur et la référence du paiement. Stripe s'occupe du paiement et envoie le reçu, comme pour tout paiement Pelli. Une fois activé, Plus marche hors ligne.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ Sorting stays free and unlimited. **Plus** is for your most demanding shoots: **
| **Maximum precision** | 5 more models, about 777 MB, downloaded once: RetinaFace ResNet-50 finds the small faces of group photos (a second pass at 1280 px), DINOv2 groups bursts and near-duplicates (it separates duplicates from different scenes about twice as clearly as Standard's CLIP B/32: +0.25 of cosine against +0.11), CLIP ViT-L/14 (a vision model about 3.5 times bigger) for search and the aesthetic score, RF-DETR-Seg judges subjects without a usable face (seen from behind, animals), with the LAION V2 aesthetic head. Slower, finer. |
| **AI search** | Type "first dance", "blue dress" or "robe bleue": the matching photos come first. |
| **Detailed statistics** | Across all your shoots: the keep rate, overall and per shoot; why photos were rejected (the main reason the AI gave, or your own choice); how often you turned the AI's call around, both ways; photos per month of capture; bursts stacked; your cameras and their keep rate; and the analysis speed measured on your computer, per precision. A table of your shoots opens each one. Computed on your computer, never sent. |
| **No Pelli promotion** | The free version shows two small Pelli cards, on the home screen and at the end of an export. Plus removes them. |
| **No Pelli promotion** | The free version shows two small Pelli cards, on the home screen and at the end of an export, and once, after your third export, a card inviting you to follow Pelli on Instagram or star the project on GitHub. Plus removes them. |

- **One key per computer, transferable.** Payment goes through Stripe in your browser, and the app activates by itself. Your key (`XXXX-XXXX-XXXX-XXXX`) is shown in the app and on the confirmation page: to move Plus to another computer, *Release this licence* in *Settings → Pelli Instant Plus*, then enter the key on the other one. Reinstalling on the same computer just needs the key again.
- **Private.** Pelli keeps no name, no e-mail and no country for Plus: only the key, a hash of your computer's id and the payment's reference. Stripe handles the payment and sends the receipt, as for every Pelli payment. Once activated, Plus works offline.
Expand Down
6 changes: 5 additions & 1 deletion src/components/export/ExportProgress.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Button, Progress, Spinner } from '@heroui/react'
import { CircleCheck, ExternalLink, FolderSearch, Info, TriangleAlert, UploadCloud } from 'lucide-react'
import type { ReactNode } from 'react'
import { PelliExportPromo } from '@/components/promo/PelliPromo'
import { SupportCard, useSupportCard } from '@/components/promo/SupportCard'
import { IconBox } from '@/components/ui/IconBox'
import { api } from '@/lib/api'
import { formatBytes, formatNumber } from '@/lib/format'
Expand Down Expand Up @@ -70,6 +71,7 @@ export function ExportReportView() {
const error = useExportStore((s) => s.error)
const errorCode = useExportStore((s) => s.errorCode)
const signOut = useAppStore((s) => s.signOut)
const askSupport = useSupportCard()
const folder = context?.rejectsFolder ?? '_Rejets Pelli'

return (
Expand Down Expand Up @@ -115,7 +117,9 @@ export function ExportReportView() {
{t('export.lightroomHint')}
</p>
)}
{!error && !uploadReport && <PelliExportPromo className="mx-auto mt-5 max-w-md" />}
{/* One card at a time: the one-time support card replaces the Pelli line when it shows. */}
{!error && askSupport && <SupportCard className="mx-auto mt-5 max-w-md" />}
{!error && !askSupport && !uploadReport && <PelliExportPromo className="mx-auto mt-5 max-w-md" />}
<div className="mt-6 flex flex-wrap justify-center gap-2">
{context && (
<Button variant="flat" startContent={<FolderSearch className="size-4" />} onPress={() => void api().revealInFolder(context.revealPath)}>
Expand Down
81 changes: 81 additions & 0 deletions src/components/promo/SupportCard.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
import { Heart, Star, X } from 'lucide-react'
import { useState } from 'react'
import { api } from '@/lib/api'
import { cn } from '@/lib/cn'
import { useT } from '@/lib/i18n'
import { GITHUB_URL, INSTAGRAM_URL } from '@/lib/links'
import { shouldAskSupport } from '@/lib/support'
import { usePlusStore } from '@/store/plus-store'
import { usePrefsStore } from '@/store/prefs-store'

/** Whether the export report shows the support card: decided once, so opening a link doesn't make it vanish. */
export function useSupportCard(): boolean {
const exportsDone = usePrefsStore((s) => s.exportsDone)
const closed = usePrefsStore((s) => s.supportCardClosed)
const plusLoaded = usePlusStore((s) => s.loaded)
const plusActive = usePlusStore((s) => s.status.active)
const [shown] = useState(() => shouldAskSupport({ exportsDone, closed, plusLoaded, plusActive }))
return shown
}

/**
* The one-time card at the end of an export: follow Pelli on Instagram first
* (photographers rarely have a GitHub account), a GitHub star second. Opening
* either link or closing the card means it never shows again.
*/
export function SupportCard({ className }: { className?: string }) {
const t = useT()
const closeSupportCard = usePrefsStore((s) => s.closeSupportCard)
const [open, setOpen] = useState(true)
if (!open) return null

const visit = (url: string) => {
closeSupportCard()
void api().openExternal(url)
}

return (
<div
className={cn(
'relative rounded-2xl border border-[#5840f0]/20 bg-gradient-to-r from-[#5840f0]/[0.12] to-[#5840f0]/[0.03] px-4 py-3.5 text-left',
className,
)}
>
<button
type="button"
aria-label={t('common.close')}
onClick={() => {
closeSupportCard()
setOpen(false)
}}
className="focus-ring absolute right-2 top-2 rounded-full p-1 text-default-400 transition-colors duration-150 hover:text-default-600"
>
<X className="size-3.5" aria-hidden />
</button>
<div className="flex items-start gap-3 pr-5">
<span className="flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-white/[0.07] text-[#b8adf8]" aria-hidden>
<Heart className="size-4" />
</span>
<div className="min-w-0 flex-1">
<p className="text-[13px] font-semibold text-foreground">{t('support.title')}</p>
<p className="mt-0.5 text-pretty text-[12px] leading-snug text-default-500">{t('support.body')}</p>
<button
type="button"
onClick={() => visit(INSTAGRAM_URL)}
className="focus-ring btn-brand mt-2.5 inline-flex h-8 items-center rounded-full px-4 text-[12px] font-semibold"
>
{t('support.instagram')}
</button>
<button
type="button"
onClick={() => visit(GITHUB_URL)}
className="focus-ring group mt-2 flex items-start gap-1.5 text-left text-[12px] leading-snug text-default-500 transition-colors duration-150 hover:text-default-700"
>
<Star className="mt-px size-3.5 shrink-0 text-[#b8adf8]" aria-hidden />
<span className="text-pretty underline-offset-2 group-hover:underline">{t('support.github')}</span>
</button>
</div>
</div>
</div>
)
}
6 changes: 6 additions & 0 deletions src/lib/i18n/locales/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -727,6 +727,12 @@ export const de: Catalogue<typeof fr> = {
homeCta: 'Kostenlos testen',
export: 'Senden Sie diese Auswahl mit einer Pelli-Galerie an Ihre Kunden',
},
support: {
title: 'Spart Ihnen Pelli Instant Zeit?',
body: 'Folgen Sie Pelli auf Instagram: Tipps zur Bildauswahl, Neuigkeiten und Blicke hinter die Kulissen.',
instagram: '@pelli.io auf Instagram folgen',
github: 'Oder geben Sie uns einen Stern auf GitHub: Das ist kostenlos und hilft uns am meisten.',
},
onboarding: {
skip: 'Überspringen',
back: 'Zurück',
Expand Down
6 changes: 6 additions & 0 deletions src/lib/i18n/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -727,6 +727,12 @@ export const en: Catalogue<typeof fr> = {
homeCta: 'Free trial',
export: 'Send this selection to your clients with a Pelli gallery',
},
support: {
title: 'Is Pelli Instant saving you time?',
body: 'Follow Pelli on Instagram for culling tips, news and behind the scenes.',
instagram: 'Follow @pelli.io on Instagram',
github: 'Or leave a star on GitHub: it’s free, and it’s the best way to help us.',
},
onboarding: {
skip: 'Skip',
back: 'Back',
Expand Down
6 changes: 6 additions & 0 deletions src/lib/i18n/locales/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -727,6 +727,12 @@ export const es: Catalogue<typeof fr> = {
homeCta: 'Prueba gratis',
export: 'Envía esta selección a tus clientes con una galería de Pelli',
},
support: {
title: '¿Pelli Instant te ahorra tiempo?',
body: 'Sigue a Pelli en Instagram: consejos de selección, novedades y entre bastidores.',
instagram: 'Seguir a @pelli.io en Instagram',
github: 'O deja una estrella en GitHub: es gratis y es la mejor manera de ayudarnos.',
},
onboarding: {
skip: 'Omitir',
back: 'Atrás',
Expand Down
6 changes: 6 additions & 0 deletions src/lib/i18n/locales/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -725,6 +725,12 @@ export const fr = {
homeCta: 'Essai gratuit',
export: 'Envoyez cette sélection à vos clients avec une galerie Pelli',
},
support: {
title: 'Pelli Instant vous fait gagner du temps ?',
body: 'Suivez Pelli sur Instagram : astuces de tri, nouveautés et coulisses.',
instagram: 'Suivre @pelli.io sur Instagram',
github: 'Ou laissez une étoile sur GitHub : c’est gratuit, et c’est la meilleure façon de nous aider.',
},
onboarding: {
skip: 'Passer',
back: 'Retour',
Expand Down
6 changes: 6 additions & 0 deletions src/lib/i18n/locales/it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -727,6 +727,12 @@ export const it: Catalogue<typeof fr> = {
homeCta: 'Prova gratuita',
export: 'Invia questa selezione ai tuoi clienti con una galleria Pelli',
},
support: {
title: 'Pelli Instant ti fa risparmiare tempo?',
body: 'Segui Pelli su Instagram: consigli per la selezione, novità e dietro le quinte.',
instagram: 'Segui @pelli.io su Instagram',
github: 'Oppure lascia una stella su GitHub: è gratis ed è il modo migliore per aiutarci.',
},
onboarding: {
skip: 'Salta',
back: 'Indietro',
Expand Down
6 changes: 6 additions & 0 deletions src/lib/i18n/locales/nl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -727,6 +727,12 @@ export const nl: Catalogue<typeof fr> = {
homeCta: 'Gratis proberen',
export: 'Stuur deze selectie naar je klanten met een Pelli-galerij',
},
support: {
title: 'Bespaart Pelli Instant je tijd?',
body: 'Volg Pelli op Instagram: tips voor het selecteren, nieuws en een kijkje achter de schermen.',
instagram: 'Volg @pelli.io op Instagram',
github: 'Of geef ons een ster op GitHub: het is gratis en de beste manier om ons te helpen.',
},
onboarding: {
skip: 'Overslaan',
back: 'Terug',
Expand Down
6 changes: 6 additions & 0 deletions src/lib/i18n/locales/pl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -802,6 +802,12 @@ export const pl: Catalogue<typeof fr> = {
homeCta: 'Bezpłatny okres próbny',
export: 'Wyślij ten wybór klientom w galerii Pelli',
},
support: {
title: 'Pelli Instant oszczędza Ci czas?',
body: 'Obserwuj Pelli na Instagramie: porady dotyczące selekcji, nowości i kulisy.',
instagram: 'Obserwuj @pelli.io na Instagramie',
github: 'Albo zostaw gwiazdkę na GitHubie: to nic nie kosztuje, a najbardziej nam pomaga.',
},
onboarding: {
skip: 'Pomiń',
back: 'Wstecz',
Expand Down
6 changes: 6 additions & 0 deletions src/lib/i18n/locales/pt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -727,6 +727,12 @@ export const pt: Catalogue<typeof fr> = {
homeCta: 'Teste grátis',
export: 'Envie esta seleção aos seus clientes com uma galeria Pelli',
},
support: {
title: 'O Pelli Instant economiza seu tempo?',
body: 'Siga o Pelli no Instagram: dicas de seleção, novidades e bastidores.',
instagram: 'Seguir @pelli.io no Instagram',
github: 'Ou deixe uma estrela no GitHub: é grátis e é a melhor forma de nos ajudar.',
},
onboarding: {
skip: 'Pular',
back: 'Voltar',
Expand Down
6 changes: 6 additions & 0 deletions src/lib/i18n/locales/sv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -727,6 +727,12 @@ export const sv: Catalogue<typeof fr> = {
homeCta: 'Prova gratis',
export: 'Skicka det här urvalet till dina kunder med ett Pelli-galleri',
},
support: {
title: 'Sparar Pelli Instant tid åt dig?',
body: 'Följ Pelli på Instagram: tips om bildurval, nyheter och en titt bakom kulisserna.',
instagram: 'Följ @pelli.io på Instagram',
github: 'Eller ge oss en stjärna på GitHub: det är gratis och det bästa sättet att hjälpa oss.',
},
onboarding: {
skip: 'Hoppa över',
back: 'Tillbaka',
Expand Down
2 changes: 2 additions & 0 deletions src/lib/links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

export const GITHUB_URL = 'https://github.com/Synapsr/Pelli-Instant'
export const PELLI_URL = 'https://pelli.io'
/** Pelli's Instagram, which the one-time support card invites to follow. */
export const INSTAGRAM_URL = 'https://www.instagram.com/pelli.io/'

/** Where the Pelli promotion of the free version leads (`home`, `export`). */
export function pelliPromoUrl(campaign: 'home' | 'export'): string {
Expand Down
22 changes: 22 additions & 0 deletions src/lib/support.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { describe, expect, it } from 'vitest'
import { SUPPORT_AFTER_EXPORTS, shouldAskSupport } from './support'

const base = { exportsDone: SUPPORT_AFTER_EXPORTS, closed: false, plusLoaded: true, plusActive: false }

describe('support card', () => {
it('shows after a few successful exports', () => {
expect(shouldAskSupport(base)).toBe(true)
expect(shouldAskSupport({ ...base, exportsDone: SUPPORT_AFTER_EXPORTS + 5 })).toBe(true)
expect(shouldAskSupport({ ...base, exportsDone: SUPPORT_AFTER_EXPORTS - 1 })).toBe(false)
expect(shouldAskSupport({ ...base, exportsDone: 0 })).toBe(false)
})

it('never comes back once closed or used', () => {
expect(shouldAskSupport({ ...base, closed: true })).toBe(false)
})

it('is hidden with Plus, and until the engine said whether Plus is active', () => {
expect(shouldAskSupport({ ...base, plusActive: true })).toBe(false)
expect(shouldAskSupport({ ...base, plusLoaded: false })).toBe(false)
})
})
23 changes: 23 additions & 0 deletions src/lib/support.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/**
* The free version's one-time "support us" card: after a few successful
* exports, it asks to follow Pelli on Instagram, and in second place to star
* the project on GitHub. Shown once, at the end of an export, never as a
* pop-up; hidden with Plus, like the other Pelli cards.
*/

/** Successful exports before the card shows: by then the app has proved useful. */
export const SUPPORT_AFTER_EXPORTS = 3

export interface SupportCardInput {
/** successful exports on this computer */
exportsDone: number
/** the card was closed, or one of its links opened */
closed: boolean
/** whether the engine already said if Plus is active */
plusLoaded: boolean
plusActive: boolean
}

export function shouldAskSupport({ exportsDone, closed, plusLoaded, plusActive }: SupportCardInput): boolean {
return plusLoaded && !plusActive && !closed && exportsDone >= SUPPORT_AFTER_EXPORTS
}
3 changes: 3 additions & 0 deletions src/store/export-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { t } from '@/lib/i18n'
import { notify } from '@/lib/notify'
import { playSound } from '@/lib/sound'
import { useAppStore } from './app-store'
import { usePrefsStore } from './prefs-store'

export type ExportPhase = 'configure' | 'exporting' | 'uploading' | 'done'

Expand Down Expand Up @@ -94,6 +95,7 @@ export const useExportStore = create<ExportState>((set, get) => ({
await api().uploadToPelli(projectId, upload)
} else {
set({ phase: 'done' })
if (report.errors.length === 0) usePrefsStore.getState().countExport()
playSound('exportDone')
}
} catch (error) {
Expand Down Expand Up @@ -161,6 +163,7 @@ export const useExportStore = create<ExportState>((set, get) => ({
onUploadDone: (report) => {
if (report.projectId !== get().projectId || get().phase !== 'uploading') return
set({ phase: 'done', uploadReport: report })
if (report.failed === 0 && (get().report?.errors.length ?? 0) === 0) usePrefsStore.getState().countExport()
playSound('exportDone')
if (!get().background) return
const skippedOnly = report.uploaded === 0 && (report.skipped ?? 0) > 0
Expand Down
20 changes: 20 additions & 0 deletions src/store/prefs-store.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,24 @@ describe('preferences', () => {
expect(mapping.labelLanguage).toBe('en')
expect(xmpExportMapping(mapping, 'fr')).toMatchObject({ labelLanguage: 'en', label: { toReview: 'blue' } })
})

it('counts successful exports and remembers a closed support card', async () => {
const saved = new Map<string, string>()
vi.stubGlobal('localStorage', {
getItem: (key: string) => saved.get(key) ?? null,
setItem: (key: string, value: string) => saved.set(key, value),
removeItem: (key: string) => saved.delete(key),
})
vi.resetModules()
const { usePrefsStore: fresh } = await import('./prefs-store')
// Preferences saved before the card existed start from zero, card not closed.
expect(fresh.getState().exportsDone).toBe(0)
expect(fresh.getState().supportCardClosed).toBe(false)
fresh.getState().countExport()
fresh.getState().countExport()
fresh.getState().closeSupportCard()
const stored = JSON.parse(saved.get('pelli-cull:prefs') ?? '{}')
expect(stored.state.exportsDone).toBe(2)
expect(stored.state.supportCardClosed).toBe(true)
})
})
Loading
Loading