Gallery auto-select probe: no-op navigation discards the selection; quiet store clears it
Los mantenedores suelen responder en 2 días
@lstein ya está trabajando en esto.
Desde el 24/8/2026.
Evaluación
Este issue todavía no se ha evaluado.
Descripción
The gallery's auto-select probe (app/store/middleware/listenerMiddleware/listeners/boardIdSelected.ts) exists to give the viewer something to show after a board or view change. It has three defects that are independent of each other but share a root: it treats every boardIdSelected / galleryViewChanged as a real navigation, and it depends on a condition() wait that can expire without ever being evaluated.
All of these reproduce on main. I found them while reviewing #9520 and attempted a fix there; every attempt introduced a worse regression, so I pulled it out into this issue rather than keep iterating inside an unrelated PR.
1. Navigation that changes nothing throws away your selection
NoBoardBoard dispatches boardIdSelected({ boardId: 'none' }) whether or not that board is already selected, and GalleryPanel's Images/Assets tabs dispatch galleryViewChanged on every click. GalleryBoard and VirtualBoardItem both guard against this; those two don't.
The probe re-runs and selects item_names[0] unconditionally.
- Open Uncategorized, scroll down, click an older image.
- Click Uncategorized in the boards list (the board you are already on), or the Images tab while it is already showing.
- The selection jumps to the newest item.
With a generation running it also moves the displayed item, which the viewer reads as a change worth revealing, so the progress overlay lifts for a couple of seconds.
2. A quiet store turns a board switch into a cleared selection
condition(predicate, 5000) only re-evaluates its predicate when an action is dispatched — never on its own timer. So when listGalleryItemNames is already fulfilled for the new args and nothing else dispatches, the probe never wakes, the 5 s deadline expires, and the give-up branch dispatches an empty selection.
- Visit a board so its item-name list is cached.
- Go elsewhere, then come back to it.
- Don't touch anything for five seconds.
- The selection is cleared and the viewer drops to its empty state.
Ambient traffic usually masks this — a socket event or a query landing is enough to wake it — which is why it is intermittent rather than constant.
3. Uploading to the board and view you are already on selects nothing
imageUploaded / videoUploaded dispatch boardIdSelected({ boardId }) then galleryViewChanged('assets'). When both already match the current state, the second cancels the first's probe (cancelActiveListeners() runs before the effect decides it has nothing to do), and neither selects the upload.
Why the obvious fixes don't work
Recording these because each looked right and each broke something:
- Guarding the click handlers (adding the
selectedBoardId !== …checkGalleryBoardhas) swallows the click that is the only way to recover when the selection is empty — reachable after deleting the last item, aftershowVirtualBoardsChanged(false)(which resets the board and clears the selection without dispatchingboardIdSelectedat all), and after defect 2 above. - Skipping when the displayed item is already in the fetched list breaks real board switches: a virtual date board's query args drop
board_idand filter oncreated_datealone, so its list is a superset of every board's items for that day. Switching from a real board to a date board then looks like a no-op and strands the viewer on the previous board's item, with a cross-board multi-selection surviving the switch. - Short-circuiting the wait when the list is already cached (
selectQuery(getState()).isSuccess || await condition(...)) removes the only await, so the effect completes synchronously inside the dispatch that started it. Its write then lands betweenmarkNextSelectionAutoSwitched()and the auto-switch's ownimageSelected, consuming the marker — so the auto-switch registers as a user pick and flashes the finished image over the next generation. Today an unrelated cache invalidation happens to mask it. - Skipping when the selection is merely non-empty leaves the selection stale: a search term (and any other arg change) narrows the list without starting a probe, so the selection can be non-empty and absent from what the grid shows, and the click that would fix it gets swallowed.
A fix probably wants to decide "did this navigation change anything?" from the pre-action state and keep a way to recover when the current selection isn't in the list on screen, while leaving the query wait's timing alone. Defect 2 is worth fixing on its own first, since several of the above interact with it.
- Lenguaje dominante
- TypeScript
- Estrellas
- 28.8k
- Forks
- 3.1k
- Merge medio
- 3 d 10 h
- PR fusionados (30 d)
- 175
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Sin guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de invoke-ai/InvokeAI
-
[bug]: upload_image resize_to is documented as a stringified tuple, but only a JSON object with width and height is acceptedPosiblemente ocupada @GuilhermeAAV la tomó hace 1 día. Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
invoke-ai/InvokeAI#10047 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 2 días
-
[bug]: Anima kohya LoRAs: layers outside the DiT blocks are not appliedPosiblemente ocupada @guishiw la tomó hoy. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
invoke-ai/InvokeAI#10028 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
[bug]: FLUX.1 diffusers-format LoRAs with text-encoder layers fail to loadPosiblemente ocupada @chiliec la tomó hace 1 día. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
invoke-ai/InvokeAI#10024 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
[bug]: FLUX final-layer modulation LoRA layer is not converted (FLUX.1 diffusers: load fails, FLUX.2 BFL: layer skipped)Posiblemente ocupada @Pfannkuchensack la tomó hoy. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
invoke-ai/InvokeAI#10022 · 2 comentarios ·
Los mantenedores suelen responder en 2 días
-
[enhancement]: Bump PyPatchMatch to latestPosiblemente ocupada @dunkeroni la tomó hace 13 días. Abiertoenhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
invoke-ai/InvokeAI#9826 · 2 reacciones · 1 asignado ·
Los mantenedores suelen responder en 2 días
Todos los issues de invoke-ai/InvokeAI
Issues similares
-
[Bug]: Pen taps on sidebar rows start a drag and lose their clickPosiblemente ocupada @makhnatkin la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
b310-digital/teammapper#1515 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 79/100
puckeditor/puck#1884 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
outline/outline#14378 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
nicobailon/pi-web-access#642 ·
Los mantenedores suelen responder en 1 día