mirror of
https://github.com/civitai/civitai.git
synced 2026-09-20 22:08:18 +08:00
bf54258e2e
Every image grid in the moderator app (the review queues, image tags, stuck ingestion, bulk image manager, and the user- and post-report panels) now supports Gmail-style shift-click: the clicked card toggles, and every card from the last-clicked one to it takes that same new state. @civitai/ui: - hooks/selection-set.svelte.ts: SelectionSet, a SvelteSet subclass holding the anchor. Being a SvelteSet, the components that already take one need no changes; clear() also drops the anchor, so every existing clear() call site resets it. - components/selection/: SelectionCheckbox, the shared Checkbox wired for shift-click with a function binding (a plain checked= prop latches on bits-ui's own write). It records shiftKey in onclick/onkeydown, which bits-ui runs before its toggle, so Space works as well as a click. Kept outside components/ui/, which shadcn --overwrite regenerates. - The package's first test suite: vitest.config.ts resolves svelte/reactivity with the browser condition under ssr.resolve, so the tests run against the reactive SvelteSet rather than the server build's plain Set. A guard test fails if that ever regresses. Moderator app: - ImageQueueGrid uses SelectionCheckbox for its corner checkbox, restyled to stay visible over images, and passes the on-screen order to both it and the whole-card button. - The six pages that build a grid selection construct a SelectionSet. Docs: the Svelte app standard, the svelte-idiom-review agent and the @civitai/ui README now point at all of components/ (hand-written components live beside ui/, which --overwrite regenerates), and the root vitest config no longer states package-suite counts that went stale. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>