mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-23 13:23:04 +00:00
fix(journey): select all takes every photo in the range and imports keep their order
The photo picker's Select all took only the pages already loaded, 50 at a time, and replaced whatever had been picked on another tab. It now loads the rest of a day, trip or date-range search before selecting (cancelled by closing the picker or switching tab), adds to earlier picks, and Deselect all only clears what is in view. Add stays disabled until that loading is done. The whole-library tab keeps selecting what is loaded and shows the count as "N+". A date-filtered Immich search stopped at 1,000 photos without a word, because its page budget was absolute; it is now relative to the page asked for, with an absolute ceiling of 270 raw pages sized so the picker's deepest page still gets a full answer. Adds go out in batches of 500 ids, under the JSON body limit, and each batch is sent oldest first, so photos land in an entry in the order they were taken. When a later batch fails, the photos already saved are counted and the journey reloads while the error still shows, through one hook for desktop and phone. After a provider add, the capture-time lookup runs at most four at a time per user, shared by all of that user's batches. When it fills a row, a journey:photos:updated event reloads open journeys once per batch, from the REST routes and the MCP add tool alike. Device uploads, which arrive one file per request, get the same lookup without the event. Addresses discussion #1587.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
// FE-JRN-GALLERY-001 to FE-JRN-GALLERY-019
|
||||
// FE-JRN-GALLERY-001 to FE-JRN-GALLERY-020
|
||||
|
||||
import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest'
|
||||
import { act, useRef, useState } from 'react'
|
||||
@@ -9,6 +9,9 @@ import { server } from '../../../tests/helpers/msw/server'
|
||||
import { useJourneyStore, type GalleryPhoto, type JourneyEntry, type JourneyTrip } from '../../store/journeyStore'
|
||||
import type { UploadProgress } from '../../utils/uploadQueue'
|
||||
import { GalleryView } from './JourneyDetailPageGalleryView'
|
||||
import { useProviderPhotoAdds } from '../../pages/journeyDetail/useProviderPhotoAdds'
|
||||
import { journeyApi } from '../../api/client'
|
||||
import { ProviderPhotoBatchError } from '../../api/providerPhotoBatches'
|
||||
|
||||
type ToastKind = 'success' | 'error' | 'warning' | 'info'
|
||||
|
||||
@@ -74,7 +77,8 @@ const entries: JourneyEntry[] = [
|
||||
]
|
||||
|
||||
/** Mirrors the page wiring: the gallery reports its connected providers up,
|
||||
and the host renders one button per provider next to Upload. */
|
||||
and the host renders one button per provider next to Upload. The picker's
|
||||
Add goes through the same hook the page takes from useJourneyDetail. */
|
||||
function GalleryHarness({ gallery, onPhotoClick, onRefresh, onRegisterUpload }: {
|
||||
gallery: GalleryPhoto[]
|
||||
onPhotoClick: (photos: GalleryPhoto[], index: number) => void
|
||||
@@ -83,6 +87,7 @@ function GalleryHarness({ gallery, onPhotoClick, onRefresh, onRegisterUpload }:
|
||||
}) {
|
||||
const [providers, setProviders] = useState<{ id: string; name: string }[]>([])
|
||||
const browseRef = useRef<((provider: string) => void) | null>(null)
|
||||
const { addPickedPhotos } = useProviderPhotoAdds(onRefresh)
|
||||
return (
|
||||
<>
|
||||
{providers.map(p => (
|
||||
@@ -96,6 +101,7 @@ function GalleryHarness({ gallery, onPhotoClick, onRefresh, onRegisterUpload }:
|
||||
trips={trips}
|
||||
onPhotoClick={onPhotoClick}
|
||||
onRefresh={onRefresh}
|
||||
onAddProviderPhotos={addPickedPhotos}
|
||||
onRegisterUpload={onRegisterUpload}
|
||||
onRegisterProviders={(p, browse) => { setProviders(p); browseRef.current = browse }}
|
||||
/>
|
||||
@@ -309,6 +315,26 @@ describe('GalleryView', () => {
|
||||
expect(onRefresh).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('FE-JRN-GALLERY-020: an add that fails after earlier batches landed counts those, refreshes, and still reports the failure (#1587)', async () => {
|
||||
useConnectedImmich()
|
||||
const add = vi.spyOn(journeyApi, 'addProviderPhotosToGallery')
|
||||
.mockRejectedValueOnce(new ProviderPhotoBatchError({ photos: [], added: 500 }, new Error('502')))
|
||||
const user = userEvent.setup()
|
||||
const { onRefresh } = mountGallery([])
|
||||
|
||||
try {
|
||||
await user.click(await screen.findByRole('button', { name: 'Immich' }))
|
||||
await user.click(await screen.findByAltText(''))
|
||||
await user.click(screen.getByRole('button', { name: 'Add (1)' }))
|
||||
|
||||
await waitFor(() => expect(onRefresh).toHaveBeenCalledTimes(1))
|
||||
expect(toastSpy).toHaveBeenCalledWith('500 photos added', 'success', undefined)
|
||||
expect(toastSpy).toHaveBeenCalledWith('Error', 'error', undefined)
|
||||
} finally {
|
||||
add.mockRestore()
|
||||
}
|
||||
})
|
||||
|
||||
it('FE-JRN-GALLERY-014: uploads picked files and refreshes on success', async () => {
|
||||
let registered: (() => void) | null = null
|
||||
const { container, onRefresh } = mountGallery([], fn => { registered = fn })
|
||||
|
||||
@@ -9,11 +9,11 @@ import { useToast } from '../shared/Toast'
|
||||
import { getApiErrorMessage } from '../../types'
|
||||
import type { JourneyEntry, GalleryPhoto, JourneyTrip } from '../../store/journeyStore'
|
||||
import { photoUrl, posterlessVideo } from '../../pages/journeyDetail/JourneyDetailPage.helpers'
|
||||
import { ProviderPicker } from './JourneyDetailPageProviderPicker'
|
||||
import { ProviderPicker, type ProviderPhotoGroup } from './JourneyDetailPageProviderPicker'
|
||||
import { ScrollTrigger } from './JourneyDetailPageScrollTrigger'
|
||||
import EmptyState from '../shared/EmptyState'
|
||||
|
||||
export function GalleryView({ entries, gallery, journeyId, userId, trips, onPhotoClick, onRefresh, onRegisterUpload, onRegisterProviders }: {
|
||||
export function GalleryView({ entries, gallery, journeyId, userId, trips, onPhotoClick, onRefresh, onAddProviderPhotos, onRegisterUpload, onRegisterProviders }: {
|
||||
entries: JourneyEntry[]
|
||||
gallery: GalleryPhoto[]
|
||||
journeyId: number
|
||||
@@ -21,6 +21,8 @@ export function GalleryView({ entries, gallery, journeyId, userId, trips, onPhot
|
||||
trips: JourneyTrip[]
|
||||
onPhotoClick: (photos: GalleryPhoto[], index: number) => void
|
||||
onRefresh: () => void
|
||||
/** What the picker's Add does: the host's useProviderPhotoAdds, shared with the phone screen. */
|
||||
onAddProviderPhotos: (journeyId: number, provider: string, groups: ProviderPhotoGroup[], entryId: number | null) => Promise<void>
|
||||
onRegisterUpload?: (fn: () => void) => void
|
||||
onRegisterProviders?: (providers: { id: string; name: string }[], browse: (provider: string) => void) => void
|
||||
}) {
|
||||
@@ -208,27 +210,7 @@ export function GalleryView({ entries, gallery, journeyId, userId, trips, onPhot
|
||||
existingAssetIds={new Set(gallery.filter(p => p.asset_id).map(p => p.asset_id!))}
|
||||
onClose={() => setShowPicker(false)}
|
||||
onAdd={async (groups, entryId) => {
|
||||
let added = 0
|
||||
let anyFailed = false
|
||||
for (const group of groups) {
|
||||
try {
|
||||
if (entryId) {
|
||||
const result = await journeyApi.addProviderPhotos(entryId, pickerProvider!, group.assetIds, undefined, group.passphrase, group.mediaTypes)
|
||||
added += result.added || 0
|
||||
} else {
|
||||
const result = await journeyApi.addProviderPhotosToGallery(journeyId, pickerProvider!, group.assetIds, group.passphrase, group.mediaTypes)
|
||||
added += result.added || 0
|
||||
}
|
||||
} catch {
|
||||
anyFailed = true
|
||||
}
|
||||
}
|
||||
if (added > 0) {
|
||||
toast.success(t('journey.photosAdded', { count: added }))
|
||||
onRefresh()
|
||||
} else if (anyFailed) {
|
||||
toast.error(t('common.error'))
|
||||
}
|
||||
await onAddProviderPhotos(journeyId, pickerProvider!, groups, entryId)
|
||||
setShowPicker(false)
|
||||
}}
|
||||
/>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// FE-JRN-PICKER-001 to FE-JRN-PICKER-023
|
||||
// FE-JRN-PICKER-001 to FE-JRN-PICKER-036
|
||||
|
||||
import { describe, it, expect, afterAll, beforeAll, beforeEach, vi } from 'vitest'
|
||||
import { http, HttpResponse, delay } from 'msw'
|
||||
@@ -6,6 +6,7 @@ import userEvent from '@testing-library/user-event'
|
||||
import { render, screen, waitFor, within, fireEvent } from '../../../tests/helpers/render'
|
||||
import { server } from '../../../tests/helpers/msw/server'
|
||||
import type { JourneyEntry, JourneyTrip } from '../../store/journeyStore'
|
||||
import { PROVIDER_SEARCH_LAST_PAGE } from '../../pages/journeyDetail/JourneyDetailPage.helpers'
|
||||
import { ProviderPicker } from './JourneyDetailPageProviderPicker'
|
||||
|
||||
const trips: JourneyTrip[] = [
|
||||
@@ -115,7 +116,7 @@ describe('ProviderPicker', () => {
|
||||
await waitFor(() => expect(ranges).toHaveLength(2))
|
||||
// utc_offset_minutes rides along on every search: the server cannot tell
|
||||
// which 24 hours a date-only bound means without it (#2336).
|
||||
expect(ranges[1]).toEqual({ from: '', to: '', page: 1, size: 50, utc_offset_minutes: 0 })
|
||||
expect(ranges[1]).toEqual({ from: '', to: '', page: 1, size: 200, utc_offset_minutes: 0 })
|
||||
})
|
||||
|
||||
it('FE-JRN-PICKER-006: the album tab loads albums and reports when there are none', async () => {
|
||||
@@ -418,6 +419,339 @@ describe('ProviderPicker', () => {
|
||||
await waitFor(() => expect(order()).toEqual(['rome', 'helsinki']))
|
||||
})
|
||||
|
||||
describe('select all across pages (#1587)', () => {
|
||||
const SEARCH = '/api/integrations/memories/immich/search'
|
||||
/** The tile button of one asset, found by the thumbnail it shows. */
|
||||
const tile = (container: HTMLElement, id: string) =>
|
||||
container.querySelector(`img[src*="/assets/0/${id}/"]`)!.closest('button') as HTMLButtonElement
|
||||
|
||||
function pagedTrip(pages: Record<number, Record<string, unknown>[]>, bodies: Record<string, unknown>[] = []) {
|
||||
const last = Math.max(...Object.keys(pages).map(Number))
|
||||
server.use(http.post(SEARCH, async ({ request }) => {
|
||||
const body = await request.json() as { page: number }
|
||||
bodies.push(body)
|
||||
return HttpResponse.json({ assets: pages[body.page] ?? [], hasMore: body.page < last })
|
||||
}))
|
||||
return bodies
|
||||
}
|
||||
|
||||
it('FE-JRN-PICKER-024: on a trip, loads the pages still missing with the same search, then selects every photo', async () => {
|
||||
const bodies = pagedTrip({ 1: [asset('p1a'), asset('p1b')], 2: [asset('p2a')], 3: [asset('p3a')] })
|
||||
const user = userEvent.setup()
|
||||
mountPicker()
|
||||
|
||||
// Pages are still pending, so the count says it is a floor.
|
||||
await user.click(await screen.findByRole('button', { name: /Select all \(2\+\)/ }))
|
||||
|
||||
expect(await screen.findByRole('button', { name: 'Add (4)' })).toBeEnabled()
|
||||
expect(bodies.map((b) => b.page)).toEqual([1, 2, 3])
|
||||
expect(bodies[2]).toEqual({ from: '2026-03-14', to: '2026-03-20', page: 3, size: 200, utc_offset_minutes: 0 })
|
||||
// Everything is in now: the count is exact and the next press takes them back.
|
||||
expect(screen.getByRole('button', { name: /Deselect all \(4\)/ })).toBeInTheDocument()
|
||||
expect(await screen.findAllByAltText('')).toHaveLength(4)
|
||||
})
|
||||
|
||||
it('FE-JRN-PICKER-025: the button is busy while the pages load', async () => {
|
||||
let release!: () => void
|
||||
const gate = new Promise<void>((resolve) => { release = resolve })
|
||||
server.use(http.post(SEARCH, async ({ request }) => {
|
||||
const body = await request.json() as { page: number }
|
||||
if (body.page === 2) await gate
|
||||
return HttpResponse.json({ assets: [asset(`p${body.page}`)], hasMore: body.page < 2 })
|
||||
}))
|
||||
const user = userEvent.setup()
|
||||
mountPicker()
|
||||
|
||||
const button = await screen.findByRole('button', { name: /Select all \(1\+\)/ })
|
||||
await user.click(button)
|
||||
|
||||
await waitFor(() => expect(button).toHaveAttribute('aria-busy', 'true'))
|
||||
expect(button).toBeDisabled()
|
||||
release()
|
||||
await waitFor(() => expect(button).toHaveAttribute('aria-busy', 'false'))
|
||||
expect(button).toBeEnabled()
|
||||
expect(screen.getByRole('button', { name: 'Add (2)' })).toBeEnabled()
|
||||
})
|
||||
|
||||
it('FE-JRN-PICKER-026: on All Photos, selects what is loaded and never drains the library', async () => {
|
||||
const bodies: Record<string, unknown>[] = []
|
||||
server.use(http.post(SEARCH, async ({ request }) => {
|
||||
const body = await request.json() as { from: string }
|
||||
bodies.push(body)
|
||||
return body.from
|
||||
? HttpResponse.json({ assets: [asset('t1')], hasMore: false })
|
||||
: HttpResponse.json({ assets: [asset('lib1'), asset('lib2')], hasMore: true })
|
||||
}))
|
||||
const user = userEvent.setup()
|
||||
mountPicker()
|
||||
await screen.findByRole('button', { name: /Select all \(1\)/ })
|
||||
|
||||
await user.click(screen.getByRole('button', { name: /All Photos/ }))
|
||||
await user.click(await screen.findByRole('button', { name: /Select all \(2\+\)/ }))
|
||||
|
||||
expect(screen.getByRole('button', { name: 'Add (2)' })).toBeEnabled()
|
||||
expect(screen.getByRole('button', { name: /Deselect all \(2\+\)/ })).toBeInTheDocument()
|
||||
// The trip search and the first library page, nothing after them.
|
||||
expect(bodies).toHaveLength(2)
|
||||
})
|
||||
|
||||
it('FE-JRN-PICKER-027: adds to picks from another tab, and deselect all takes back only the photos in view', async () => {
|
||||
server.use(http.post(SEARCH, async ({ request }) => {
|
||||
const body = await request.json() as { from: string }
|
||||
return body.from
|
||||
? HttpResponse.json({ assets: [asset('t1'), asset('t2')], hasMore: false })
|
||||
: HttpResponse.json({ assets: [asset('lib1')], hasMore: false })
|
||||
}))
|
||||
const user = userEvent.setup()
|
||||
const { container, onAdd } = mountPicker()
|
||||
await screen.findByRole('button', { name: /Select all \(2\)/ })
|
||||
|
||||
await user.click(tile(container, 't1'))
|
||||
await user.click(screen.getByRole('button', { name: /All Photos/ }))
|
||||
await user.click(await screen.findByRole('button', { name: /Select all \(1\)/ }))
|
||||
expect(screen.getByRole('button', { name: 'Add (2)' })).toBeEnabled()
|
||||
|
||||
await user.click(screen.getByRole('button', { name: /Deselect all \(1\)/ }))
|
||||
await user.click(screen.getByRole('button', { name: 'Add (1)' }))
|
||||
expect(onAdd).toHaveBeenCalledWith([{ assetIds: ['t1'], mediaTypes: ['image'], passphrase: undefined }], null)
|
||||
})
|
||||
|
||||
it('FE-JRN-PICKER-028: switching tab mid-run cancels it and selects nothing', async () => {
|
||||
let release!: () => void
|
||||
const gate = new Promise<void>((resolve) => { release = resolve })
|
||||
const pages: number[] = []
|
||||
server.use(http.post(SEARCH, async ({ request }) => {
|
||||
const body = await request.json() as { page: number }
|
||||
pages.push(body.page)
|
||||
if (body.page === 2) await gate
|
||||
return HttpResponse.json({ assets: [asset(`p${body.page}`)], hasMore: body.page < 3 })
|
||||
}))
|
||||
const user = userEvent.setup()
|
||||
mountPicker()
|
||||
|
||||
await user.click(await screen.findByRole('button', { name: /Select all \(1\+\)/ }))
|
||||
await waitFor(() => expect(pages).toEqual([1, 2]))
|
||||
await user.click(screen.getByRole('button', { name: 'Date Range' }))
|
||||
release()
|
||||
await new Promise((resolve) => setTimeout(resolve, 30))
|
||||
|
||||
expect(pages).toEqual([1, 2])
|
||||
expect(screen.getByRole('button', { name: 'Add' })).toBeDisabled()
|
||||
expect(screen.getByRole('button', { name: /Select all \(1\+\)/ })).toHaveAttribute('aria-busy', 'false')
|
||||
})
|
||||
|
||||
it('FE-JRN-PICKER-029: closing the picker mid-run stops it', async () => {
|
||||
let release!: () => void
|
||||
const gate = new Promise<void>((resolve) => { release = resolve })
|
||||
const pages: number[] = []
|
||||
server.use(http.post(SEARCH, async ({ request }) => {
|
||||
const body = await request.json() as { page: number }
|
||||
pages.push(body.page)
|
||||
if (body.page === 2) await gate
|
||||
return HttpResponse.json({ assets: [asset(`p${body.page}`)], hasMore: body.page < 3 })
|
||||
}))
|
||||
const user = userEvent.setup()
|
||||
const { unmount } = mountPicker()
|
||||
|
||||
await user.click(await screen.findByRole('button', { name: /Select all \(1\+\)/ }))
|
||||
await waitFor(() => expect(pages).toEqual([1, 2]))
|
||||
unmount()
|
||||
release()
|
||||
await new Promise((resolve) => setTimeout(resolve, 30))
|
||||
|
||||
expect(pages).toEqual([1, 2])
|
||||
})
|
||||
|
||||
it('FE-JRN-PICKER-030: a page that fails keeps what arrived selected, and pressing again carries on', async () => {
|
||||
let failPage2 = true
|
||||
const pages: number[] = []
|
||||
server.use(http.post(SEARCH, async ({ request }) => {
|
||||
const body = await request.json() as { page: number }
|
||||
pages.push(body.page)
|
||||
if (body.page === 2 && failPage2) return new HttpResponse(null, { status: 502 })
|
||||
return HttpResponse.json({ assets: [asset(`p${body.page}`)], hasMore: body.page < 2 })
|
||||
}))
|
||||
const user = userEvent.setup()
|
||||
mountPicker()
|
||||
|
||||
await user.click(await screen.findByRole('button', { name: /Select all \(1\+\)/ }))
|
||||
expect(await screen.findByRole('button', { name: 'Add (1)' })).toBeEnabled()
|
||||
// Still pending, so still a floor, and still a select rather than a deselect.
|
||||
const again = await screen.findByRole('button', { name: /Select all \(1\+\)/ })
|
||||
|
||||
failPage2 = false
|
||||
await user.click(again)
|
||||
expect(await screen.findByRole('button', { name: 'Add (2)' })).toBeEnabled()
|
||||
expect(pages).toEqual([1, 2, 2])
|
||||
})
|
||||
|
||||
it('FE-JRN-PICKER-033: Add waits for a Select all that is still loading, so it never sends only the earlier picks', async () => {
|
||||
let release!: () => void
|
||||
const gate = new Promise<void>((resolve) => { release = resolve })
|
||||
server.use(http.post(SEARCH, async ({ request }) => {
|
||||
const body = await request.json() as { page: number }
|
||||
if (body.page === 2) await gate
|
||||
return HttpResponse.json({ assets: [asset(`p${body.page}`)], hasMore: body.page < 2 })
|
||||
}))
|
||||
const user = userEvent.setup()
|
||||
const { container, onAdd } = mountPicker()
|
||||
await screen.findByRole('button', { name: /Select all \(1\+\)/ })
|
||||
|
||||
// A pick from before the run makes Add live on its own.
|
||||
await user.click(tile(container, 'p1'))
|
||||
const add = screen.getByRole('button', { name: 'Add (1)' })
|
||||
expect(add).toBeEnabled()
|
||||
|
||||
await user.click(screen.getByRole('button', { name: /Select all \(1\+\)/ }))
|
||||
await waitFor(() => expect(add).toBeDisabled())
|
||||
fireEvent.click(add)
|
||||
expect(onAdd).not.toHaveBeenCalled()
|
||||
|
||||
release()
|
||||
const full = await screen.findByRole('button', { name: 'Add (2)' })
|
||||
await waitFor(() => expect(full).toBeEnabled())
|
||||
await user.click(full)
|
||||
expect(onAdd).toHaveBeenCalledTimes(1)
|
||||
expect(onAdd).toHaveBeenCalledWith([{ assetIds: ['p1', 'p2'], mediaTypes: ['image', 'image'], passphrase: undefined }], null)
|
||||
})
|
||||
|
||||
it('FE-JRN-PICKER-034: a Select all cancelled by a tab switch gives Add back, with only the earlier picks', async () => {
|
||||
let release!: () => void
|
||||
const gate = new Promise<void>((resolve) => { release = resolve })
|
||||
const pages: number[] = []
|
||||
server.use(http.post(SEARCH, async ({ request }) => {
|
||||
const body = await request.json() as { page: number }
|
||||
pages.push(body.page)
|
||||
if (body.page === 2) await gate
|
||||
return HttpResponse.json({ assets: [asset(`p${body.page}`)], hasMore: body.page < 2 })
|
||||
}))
|
||||
const user = userEvent.setup()
|
||||
const { container, onAdd } = mountPicker()
|
||||
await screen.findByRole('button', { name: /Select all \(1\+\)/ })
|
||||
await user.click(tile(container, 'p1'))
|
||||
|
||||
await user.click(screen.getByRole('button', { name: /Select all \(1\+\)/ }))
|
||||
await waitFor(() => expect(pages).toEqual([1, 2]))
|
||||
expect(screen.getByRole('button', { name: 'Add (1)' })).toBeDisabled()
|
||||
|
||||
await user.click(screen.getByRole('button', { name: 'Date Range' }))
|
||||
const add = screen.getByRole('button', { name: 'Add (1)' })
|
||||
await waitFor(() => expect(add).toBeEnabled())
|
||||
release()
|
||||
await new Promise((resolve) => setTimeout(resolve, 30))
|
||||
|
||||
// The page that arrived after the cancel selected nothing.
|
||||
expect(screen.getByRole('button', { name: 'Add (1)' })).toBeEnabled()
|
||||
await user.click(add)
|
||||
expect(onAdd).toHaveBeenCalledWith([{ assetIds: ['p1'], mediaTypes: ['image'], passphrase: undefined }], null)
|
||||
})
|
||||
|
||||
it('FE-JRN-PICKER-035: offers Select all while every photo in view is already added but more pages are pending', async () => {
|
||||
// Say the trip's last day came in earlier from the Day tab: the newest page
|
||||
// is all greyed out, and the older days are still to load.
|
||||
const bodies = pagedTrip({ 1: [asset('old1'), asset('old2')], 2: [asset('new1')] })
|
||||
const user = userEvent.setup()
|
||||
const { onAdd } = mountPicker({ existingAssetIds: new Set(['old1', 'old2']) })
|
||||
|
||||
await user.click(await screen.findByRole('button', { name: /Select all \(0\+\)/ }))
|
||||
|
||||
expect(await screen.findByRole('button', { name: 'Add (1)' })).toBeEnabled()
|
||||
expect(bodies.map((b) => b.page)).toEqual([1, 2])
|
||||
await user.click(screen.getByRole('button', { name: 'Add (1)' }))
|
||||
expect(onAdd).toHaveBeenCalledWith([{ assetIds: ['new1'], mediaTypes: ['image'], passphrase: undefined }], null)
|
||||
})
|
||||
|
||||
/** A trip that never runs out: every page says there is more, only the first and the last hold a photo. */
|
||||
function endlessTrip(pages: number[]) {
|
||||
server.use(http.post(SEARCH, async ({ request }) => {
|
||||
const body = await request.json() as { page: number }
|
||||
pages.push(body.page)
|
||||
const photos = body.page === 1 || body.page === PROVIDER_SEARCH_LAST_PAGE ? [asset(`p${body.page}`)] : []
|
||||
return HttpResponse.json({ assets: photos, hasMore: true })
|
||||
}))
|
||||
}
|
||||
|
||||
it('FE-JRN-PICKER-036: Select all stops at the last page and keeps the "+", and nothing past it is asked for, by a second press or by scrolling', async () => {
|
||||
const pages: number[] = []
|
||||
endlessTrip(pages)
|
||||
const user = userEvent.setup()
|
||||
const { container } = mountPicker()
|
||||
/** The scroll trigger at the foot of the grid, the spinner that loads the next page. */
|
||||
const scrollTrigger = () => container.querySelector('.mt-2.py-4 .animate-spin')
|
||||
const selectAll = await screen.findByRole('button', { name: /Select all \(1\+\)/ })
|
||||
expect(scrollTrigger()).toBeInTheDocument()
|
||||
|
||||
await user.click(selectAll)
|
||||
|
||||
// The server's scan ceiling is sized for this page, so it is still
|
||||
// answered, and nothing past it is asked for.
|
||||
expect(await screen.findByRole('button', { name: 'Add (2)' }, { timeout: 10000 })).toBeEnabled()
|
||||
expect(pages).toHaveLength(PROVIDER_SEARCH_LAST_PAGE)
|
||||
expect(Math.max(...pages)).toBe(PROVIDER_SEARCH_LAST_PAGE)
|
||||
expect(scrollTrigger()).not.toBeInTheDocument()
|
||||
// Everything loaded is picked and there is more: a deselect, with the "+",
|
||||
// and selecting again takes what is loaded without asking any further.
|
||||
await user.click(screen.getByRole('button', { name: /Deselect all \(2\+\)/ }))
|
||||
expect(screen.getByRole('button', { name: 'Add' })).toBeDisabled()
|
||||
await user.click(screen.getByRole('button', { name: /Select all \(2\+\)/ }))
|
||||
expect(screen.getByRole('button', { name: 'Add (2)' })).toBeEnabled()
|
||||
expect(pages).toHaveLength(PROVIDER_SEARCH_LAST_PAGE)
|
||||
}, 20000)
|
||||
})
|
||||
|
||||
it('FE-JRN-PICKER-031: sends each group oldest first, by wall clock where the provider has one (#1587)', async () => {
|
||||
searchReturns([
|
||||
asset('late', { takenAt: '2026-03-15T12:00:00.000Z' }),
|
||||
asset('early', { takenAt: '2026-03-15T08:00:00.000Z', mediaType: 'video' }),
|
||||
// Later as an instant, earliest on the photographer's own clock.
|
||||
asset('wallclock', { takenAt: '2026-03-15T20:00:00.000Z', localTakenAt: '2026-03-15T06:00:00.000Z' }),
|
||||
asset('undated', { takenAt: null }),
|
||||
])
|
||||
const user = userEvent.setup()
|
||||
const { onAdd } = mountPicker()
|
||||
|
||||
await user.click(await screen.findByRole('button', { name: /Select all \(4\)/ }))
|
||||
await user.click(screen.getByRole('button', { name: 'Add (4)' }))
|
||||
|
||||
expect(onAdd).toHaveBeenCalledWith(
|
||||
[{
|
||||
assetIds: ['wallclock', 'early', 'late', 'undated'],
|
||||
mediaTypes: ['image', 'video', 'image', 'image'],
|
||||
passphrase: undefined,
|
||||
}],
|
||||
null,
|
||||
)
|
||||
})
|
||||
|
||||
it('FE-JRN-PICKER-032: a search after an album pages again and carries no album passphrase', async () => {
|
||||
const pages: number[] = []
|
||||
server.use(
|
||||
http.get('/api/integrations/memories/immich/albums', () => HttpResponse.json({
|
||||
albums: [{ id: 'alb1', albumName: 'Rome', assetCount: 1, passphrase: 'pw' }],
|
||||
})),
|
||||
http.get('/api/integrations/memories/immich/albums/alb1/photos', () => HttpResponse.json({ assets: [asset('alb-a1')] })),
|
||||
http.post('/api/integrations/memories/immich/search', async ({ request }) => {
|
||||
const body = await request.json() as { page: number }
|
||||
pages.push(body.page)
|
||||
return HttpResponse.json({ assets: [asset(`p${body.page}`)], hasMore: body.page < 2 })
|
||||
}),
|
||||
)
|
||||
const user = userEvent.setup()
|
||||
const { onAdd } = mountPicker()
|
||||
await screen.findByRole('button', { name: /Select all \(1\+\)/ })
|
||||
|
||||
await user.click(screen.getByRole('button', { name: 'Albums' }))
|
||||
await user.click(await screen.findByRole('button', { name: 'Rome (1)' }))
|
||||
await screen.findByRole('button', { name: /Select all \(1\)/ })
|
||||
await user.click(screen.getByRole('button', { name: 'Trip Period' }))
|
||||
|
||||
// The trip is paged again: without the reset the album left behind hid the "+".
|
||||
await user.click(await screen.findByRole('button', { name: /Select all \(1\+\)/ }))
|
||||
expect(await screen.findByRole('button', { name: 'Add (2)' })).toBeEnabled()
|
||||
await user.click(screen.getByRole('button', { name: 'Add (2)' }))
|
||||
expect(onAdd).toHaveBeenCalledWith([{ assetIds: ['p1', 'p2'], mediaTypes: ['image', 'image'], passphrase: undefined }], null)
|
||||
})
|
||||
|
||||
it('FE-JRN-PICKER-020: closes through the header button and the backdrop', async () => {
|
||||
const user = userEvent.setup()
|
||||
const { container, onClose } = mountPicker()
|
||||
|
||||
@@ -1,12 +1,17 @@
|
||||
import { Calendar, Camera, Check, ChevronRight, Play, X } from 'lucide-react';
|
||||
import { Calendar, Camera, Check, ChevronRight, Loader2, Play, X } from 'lucide-react';
|
||||
import { useEffect, useMemo, useRef, useState } from 'react';
|
||||
import { memoriesApi } from '../../api/client';
|
||||
import { useTranslation } from '../../i18n';
|
||||
import {
|
||||
fetchRemainingProviderPages,
|
||||
groupPhotosByDate,
|
||||
PROVIDER_SEARCH_LAST_PAGE,
|
||||
PROVIDER_SEARCH_PAGE_SIZE,
|
||||
sortByCaptureTimeAsc,
|
||||
sortProviderPhotos,
|
||||
utcOffsetMinutesForDay,
|
||||
type GeoPoint,
|
||||
type ProviderPhotoAsset,
|
||||
} from '../../pages/journeyDetail/JourneyDetailPage.helpers';
|
||||
import type { JourneyEntry, JourneyTrip } from '../../store/journeyStore';
|
||||
import { DatePicker } from './JourneyDetailPageDatePicker';
|
||||
@@ -14,6 +19,22 @@ import { ScrollTrigger } from './JourneyDetailPageScrollTrigger';
|
||||
|
||||
export type ProviderPhotoGroup = { assetIds: string[]; passphrase?: string; mediaTypes?: string[] };
|
||||
|
||||
/** A tile as the search and album routes answer it; only what a pick needs is spelled out. */
|
||||
type PickerAsset = ProviderPhotoAsset & { mediaType?: string };
|
||||
|
||||
/**
|
||||
* One picked asset. The capture times ride along only to order the ids at
|
||||
* submit (#1587): a pick survives tab and album switches, and by then the asset
|
||||
* may no longer be in the loaded list to look them up in.
|
||||
*/
|
||||
type SelectedAsset = {
|
||||
albumId?: string;
|
||||
passphrase?: string;
|
||||
mediaType?: string;
|
||||
takenAt?: string | null;
|
||||
localTakenAt?: string | null;
|
||||
};
|
||||
|
||||
export function ProviderPicker({
|
||||
provider,
|
||||
userId,
|
||||
@@ -53,9 +74,9 @@ export function ProviderPicker({
|
||||
const [searchPage, setSearchPage] = useState(1);
|
||||
const [searchFrom, setSearchFrom] = useState('');
|
||||
const [searchTo, setSearchTo] = useState('');
|
||||
const [selected, setSelected] = useState<Map<string, { albumId?: string; passphrase?: string; mediaType?: string }>>(
|
||||
new Map()
|
||||
);
|
||||
const [selected, setSelected] = useState<Map<string, SelectedAsset>>(new Map());
|
||||
// "Select all" is loading the pages that were still missing (#1587).
|
||||
const [draining, setDraining] = useState(false);
|
||||
const [customFrom, setCustomFrom] = useState('');
|
||||
const [customTo, setCustomTo] = useState('');
|
||||
const [targetEntryId, setTargetEntryId] = useState<number | null>(initialEntryId ?? null);
|
||||
@@ -83,11 +104,37 @@ export function ProviderPicker({
|
||||
return abortRef.current.signal;
|
||||
};
|
||||
|
||||
// Closing the picker cancels whatever it is still loading, a "Select all" that
|
||||
// is working through the remaining pages included.
|
||||
useEffect(() => () => abortRef.current?.abort(), []);
|
||||
|
||||
// The body of one page of a search. Shared by the page a search opens with,
|
||||
// the pages scrolled into view and the ones "Select all" loads, so every page
|
||||
// asks for the same days in the same zone (#1587).
|
||||
//
|
||||
// The bounds are calendar days as this browser reads them, so the zone they
|
||||
// are meant in travels with them. Without it the server can only take them
|
||||
// as UTC days and a reader outside UTC gets somebody else's 24 hours
|
||||
// (#2336). A single offset leaves a one-hour sliver at the far end of a
|
||||
// multi-day range that crosses a DST change, and none at all for a single
|
||||
// day, which is the case this fixes.
|
||||
const searchRequest = (from: string, to: string, page: number) => ({
|
||||
from,
|
||||
to,
|
||||
page,
|
||||
size: PROVIDER_SEARCH_PAGE_SIZE,
|
||||
utc_offset_minutes: utcOffsetMinutesForDay(from || to),
|
||||
});
|
||||
|
||||
const searchPhotos = async (from: string, to: string, page: number = 1, append: boolean = false) => {
|
||||
const signal = cancelPending();
|
||||
if (page === 1) {
|
||||
setLoading(true);
|
||||
setPhotos([]);
|
||||
// A search shows no album, so none may colour its picks, its thumbnails or
|
||||
// its paging. Left set, a trip search after an album never paged again.
|
||||
setSelectedAlbum(null);
|
||||
setSelectedAlbumPassphrase(undefined);
|
||||
} else {
|
||||
setLoadingMore(true);
|
||||
}
|
||||
@@ -95,17 +142,7 @@ export function ProviderPicker({
|
||||
setSearchTo(to);
|
||||
setSearchPage(page);
|
||||
try {
|
||||
// The bounds are calendar days as this browser reads them, so the zone they
|
||||
// are meant in travels with them. Without it the server can only take them
|
||||
// as UTC days and a reader outside UTC gets somebody else's 24 hours
|
||||
// (#2336). A single offset leaves a one-hour sliver at the far end of a
|
||||
// multi-day range that crosses a DST change, and none at all for a single
|
||||
// day, which is the case this fixes.
|
||||
const data = await memoriesApi.search(
|
||||
provider,
|
||||
{ from, to, page, size: 50, utc_offset_minutes: utcOffsetMinutesForDay(from || to) },
|
||||
signal,
|
||||
);
|
||||
const data = await memoriesApi.search(provider, searchRequest(from, to, page), signal);
|
||||
const assets = data.assets || [];
|
||||
setPhotos((prev) => (append ? [...prev, ...assets] : assets));
|
||||
setHasMore(!!data.hasMore);
|
||||
@@ -120,11 +157,6 @@ export function ProviderPicker({
|
||||
}
|
||||
};
|
||||
|
||||
const loadMorePhotos = () => {
|
||||
if (loadingMore || !hasMore) return;
|
||||
searchPhotos(searchFrom, searchTo, searchPage + 1, true);
|
||||
};
|
||||
|
||||
const loadAlbumPhotos = async (album: { id: string; passphrase?: string }) => {
|
||||
const signal = cancelPending();
|
||||
setLoading(true);
|
||||
@@ -175,6 +207,29 @@ export function ProviderPicker({
|
||||
|
||||
// Albums come back whole, so they never page.
|
||||
const morePagesPending = hasMore && !selectedAlbum;
|
||||
const dateBounded = Boolean(searchFrom || searchTo);
|
||||
// A date-bounded search ends at PROVIDER_SEARCH_LAST_PAGE, scrolled or loaded
|
||||
// by "Select all" (#1587). Past it the server's scan ceiling could only answer
|
||||
// an empty page with no more to come, so the picker stops asking and keeps
|
||||
// what the server last said: the count keeps its "+".
|
||||
const canLoadMore = morePagesPending && !(dateBounded && searchPage >= PROVIDER_SEARCH_LAST_PAGE);
|
||||
// A date-bounded search is a trip or a day, so "Select all" loads the rest of
|
||||
// it first (#1587). The All Photos tab is the whole library: there it stays
|
||||
// "everything loaded so far", and the count says there is more.
|
||||
const selectAllLoadsRest = canLoadMore && dateBounded;
|
||||
|
||||
const loadMorePhotos = () => {
|
||||
if (loadingMore || !canLoadMore) return;
|
||||
searchPhotos(searchFrom, searchTo, searchPage + 1, true);
|
||||
};
|
||||
|
||||
const selectionEntry = (asset: PickerAsset | undefined): SelectedAsset => ({
|
||||
albumId: selectedAlbum ?? undefined,
|
||||
passphrase: selectedAlbumPassphrase,
|
||||
mediaType: asset?.mediaType,
|
||||
takenAt: asset?.takenAt ?? null,
|
||||
localTakenAt: asset?.localTakenAt ?? null,
|
||||
});
|
||||
|
||||
const toggleAsset = (id: string) => {
|
||||
setSelected((prev) => {
|
||||
@@ -182,13 +237,78 @@ export function ProviderPicker({
|
||||
if (next.has(id)) {
|
||||
next.delete(id);
|
||||
} else {
|
||||
const mediaType = (photos as any[]).find((p) => p.id === id)?.mediaType;
|
||||
next.set(id, { albumId: selectedAlbum ?? undefined, passphrase: selectedAlbumPassphrase, mediaType });
|
||||
next.set(id, selectionEntry(photos.find((p) => p.id === id)));
|
||||
}
|
||||
return next;
|
||||
});
|
||||
};
|
||||
|
||||
// Adds to what is picked rather than replacing it: picks made on another tab
|
||||
// or in an album survive a "Select all" here.
|
||||
const addToSelection = (assets: PickerAsset[]) => {
|
||||
setSelected((prev) => {
|
||||
const next = new Map(prev);
|
||||
for (const asset of assets) {
|
||||
if (existingAssetIds.has(asset.id) || next.has(asset.id)) continue;
|
||||
next.set(asset.id, selectionEntry(asset));
|
||||
}
|
||||
return next;
|
||||
});
|
||||
};
|
||||
|
||||
const removeFromSelection = (assets: PickerAsset[]) => {
|
||||
setSelected((prev) => {
|
||||
const next = new Map(prev);
|
||||
for (const asset of assets) next.delete(asset.id);
|
||||
return next;
|
||||
});
|
||||
};
|
||||
|
||||
const selectAll = async (inView: PickerAsset[]) => {
|
||||
const controller = abortRef.current;
|
||||
if (!selectAllLoadsRest || !controller) {
|
||||
addToSelection(inView);
|
||||
return;
|
||||
}
|
||||
// The search's own controller: a new search, a tab switch or closing the
|
||||
// picker aborts it, and with it this run.
|
||||
const signal = controller.signal;
|
||||
const loaded: PickerAsset[] = [];
|
||||
setDraining(true);
|
||||
setLoadingMore(true);
|
||||
try {
|
||||
await fetchRemainingProviderPages<PickerAsset>(
|
||||
(page) => memoriesApi.search(provider, searchRequest(searchFrom, searchTo, page), signal),
|
||||
searchPage + 1,
|
||||
signal,
|
||||
(assets, page, more) => {
|
||||
loaded.push(...assets);
|
||||
setPhotos((prev) => [...prev, ...assets]);
|
||||
setSearchPage(page);
|
||||
setHasMore(more);
|
||||
},
|
||||
);
|
||||
} catch {
|
||||
// A page that failed leaves the rest pending: what did arrive is still
|
||||
// selected below, the count keeps its "+", and pressing again carries on
|
||||
// from the page that failed.
|
||||
} finally {
|
||||
setDraining(false);
|
||||
setLoadingMore(false);
|
||||
}
|
||||
if (!signal.aborted) addToSelection([...inView, ...loaded]);
|
||||
};
|
||||
|
||||
// Leaving a tab ends a "Select all" that is still loading its pages.
|
||||
const switchTab = (id: typeof filter) => {
|
||||
if (draining && id !== filter) cancelPending();
|
||||
setFilter(id);
|
||||
};
|
||||
|
||||
// While Select all is still loading pages, the selection holds only the picks
|
||||
// from before it: an Add then would send those and drop the rest (#1587).
|
||||
const addDisabled = selected.size === 0 || adding || draining;
|
||||
|
||||
const targetLabel = targetEntryId
|
||||
? entries.find((e) => e.id === targetEntryId)?.title ||
|
||||
entries.find((e) => e.id === targetEntryId)?.entry_date ||
|
||||
@@ -251,7 +371,7 @@ export function ProviderPicker({
|
||||
<button
|
||||
type="button"
|
||||
key={f.id}
|
||||
onClick={() => setFilter(f.id)}
|
||||
onClick={() => switchTab(f.id)}
|
||||
className={`rounded-lg px-3 py-1.5 text-[12px] font-medium transition-colors ${
|
||||
filter === f.id
|
||||
? 'bg-zinc-900 text-white dark:bg-white dark:text-zinc-900'
|
||||
@@ -441,42 +561,42 @@ export function ProviderPicker({
|
||||
sortedPhotos.length > 0 &&
|
||||
(() => {
|
||||
const selectable = sortedPhotos.filter((a: any) => !existingAssetIds.has(a.id));
|
||||
const allSelected = selectable.length > 0 && selectable.every((a: any) => selected.has(a.id));
|
||||
if (selectable.length === 0) return null;
|
||||
// Pages still to load on a trip or a day mean not everything is picked yet.
|
||||
const allSelected =
|
||||
selectable.length > 0 && !selectAllLoadsRest && selectable.every((a) => selected.has(a.id));
|
||||
// Every photo in view may already be in the journey while the rest of
|
||||
// the trip is not: the button is what loads that rest, so it stays.
|
||||
if (selectable.length === 0 && !selectAllLoadsRest) return null;
|
||||
return (
|
||||
<div className="flex-shrink-0 border-b border-zinc-200 bg-white px-4 py-2 dark:border-zinc-700 dark:bg-zinc-900">
|
||||
<button
|
||||
type="button"
|
||||
disabled={loadingMore}
|
||||
aria-busy={draining}
|
||||
onClick={() => {
|
||||
if (allSelected) {
|
||||
setSelected(new Map());
|
||||
removeFromSelection(selectable);
|
||||
} else {
|
||||
setSelected(
|
||||
new Map(
|
||||
selectable.map((a: any) => [
|
||||
a.id,
|
||||
{
|
||||
albumId: selectedAlbum ?? undefined,
|
||||
passphrase: selectedAlbumPassphrase,
|
||||
mediaType: a.mediaType,
|
||||
},
|
||||
])
|
||||
)
|
||||
);
|
||||
void selectAll(selectable);
|
||||
}
|
||||
}}
|
||||
className="inline-flex items-center gap-1.5 rounded-lg border border-zinc-200 px-2.5 py-1 text-[11px] font-medium text-zinc-500 hover:bg-zinc-50 dark:border-zinc-700 dark:text-zinc-400 dark:hover:bg-zinc-800"
|
||||
className="inline-flex items-center gap-1.5 rounded-lg border border-zinc-200 px-2.5 py-1 text-[11px] font-medium text-zinc-500 hover:bg-zinc-50 disabled:cursor-wait disabled:opacity-60 dark:border-zinc-700 dark:text-zinc-400 dark:hover:bg-zinc-800"
|
||||
>
|
||||
<div
|
||||
className={`flex h-3.5 w-3.5 items-center justify-center rounded border ${
|
||||
allSelected
|
||||
? 'border-zinc-900 bg-zinc-900 dark:border-white dark:bg-white'
|
||||
: 'border-zinc-300 dark:border-zinc-600'
|
||||
}`}
|
||||
>
|
||||
{allSelected && <Check size={9} className="text-white dark:text-zinc-900" strokeWidth={3} />}
|
||||
</div>
|
||||
{allSelected ? t('journey.picker.deselectAll') : t('journey.picker.selectAll')} ({selectable.length})
|
||||
{draining ? (
|
||||
<Loader2 size={14} className="animate-spin text-content-muted" aria-hidden="true" />
|
||||
) : (
|
||||
<div
|
||||
className={`flex h-3.5 w-3.5 items-center justify-center rounded border ${
|
||||
allSelected
|
||||
? 'border-zinc-900 bg-zinc-900 dark:border-white dark:bg-white'
|
||||
: 'border-zinc-300 dark:border-zinc-600'
|
||||
}`}
|
||||
>
|
||||
{allSelected && <Check size={9} className="text-white dark:text-zinc-900" strokeWidth={3} />}
|
||||
</div>
|
||||
)}
|
||||
{allSelected ? t('journey.picker.deselectAll') : t('journey.picker.selectAll')} ({selectable.length}
|
||||
{morePagesPending ? '+' : ''})
|
||||
</button>
|
||||
</div>
|
||||
);
|
||||
@@ -572,7 +692,7 @@ export function ProviderPicker({
|
||||
belong to a neighbouring day leaves the grid empty, and a sentinel
|
||||
that only exists next to photos would never ask for the next page
|
||||
(#2336). */}
|
||||
{morePagesPending && <ScrollTrigger onVisible={loadMorePhotos} loading={loadingMore} />}
|
||||
{canLoadMore && <ScrollTrigger onVisible={loadMorePhotos} loading={loadingMore} />}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
@@ -596,24 +716,28 @@ export function ProviderPicker({
|
||||
if (adding) return;
|
||||
setAdding(true);
|
||||
try {
|
||||
const groupMap = new Map<string | undefined, { assetIds: string[]; mediaTypes: string[] }>();
|
||||
for (const [assetId, { passphrase, mediaType }] of selected.entries()) {
|
||||
const g = groupMap.get(passphrase) || { assetIds: [], mediaTypes: [] };
|
||||
g.assetIds.push(assetId);
|
||||
g.mediaTypes.push(mediaType === 'video' ? 'video' : 'image');
|
||||
groupMap.set(passphrase, g);
|
||||
const groupMap = new Map<string | undefined, Array<SelectedAsset & { assetId: string }>>();
|
||||
for (const [assetId, pick] of selected.entries()) {
|
||||
const g = groupMap.get(pick.passphrase) || [];
|
||||
g.push({ ...pick, assetId });
|
||||
groupMap.set(pick.passphrase, g);
|
||||
}
|
||||
const groups = [...groupMap.entries()].map(([passphrase, g]) => ({
|
||||
assetIds: g.assetIds,
|
||||
mediaTypes: g.mediaTypes,
|
||||
passphrase,
|
||||
}));
|
||||
// Oldest first, so an entry numbers its new photos in the order
|
||||
// they were taken rather than the grid's newest-first (#1587).
|
||||
const groups = [...groupMap.entries()].map(([passphrase, picks]) => {
|
||||
const ordered = sortByCaptureTimeAsc(picks);
|
||||
return {
|
||||
assetIds: ordered.map((p) => p.assetId),
|
||||
mediaTypes: ordered.map((p) => (p.mediaType === 'video' ? 'video' : 'image')),
|
||||
passphrase,
|
||||
};
|
||||
});
|
||||
await onAdd(groups, targetEntryId);
|
||||
} finally {
|
||||
setAdding(false);
|
||||
}
|
||||
}}
|
||||
disabled={selected.size === 0 || adding}
|
||||
disabled={addDisabled}
|
||||
className="rounded-lg bg-zinc-900 px-3.5 py-2 text-[13px] font-medium text-white hover:bg-zinc-800 disabled:cursor-not-allowed disabled:opacity-40 dark:bg-white dark:text-zinc-900 dark:hover:bg-zinc-100"
|
||||
>
|
||||
{adding ? (
|
||||
|
||||
Reference in New Issue
Block a user