The minimalistic document archiving platform.
feat(client): add batch document selection and operations (#1082)
Corentin Thomassete8d19af79b97
diff --git a/.changeset/eleven-sides-look.md b/.changeset/eleven-sides-look.mdnew file mode 100644index 00000000..3a0e27d4--- /dev/null+++ b/.changeset/eleven-sides-look.md@@ -0,0 +1,5 @@+---+"@papra/app": patch+---++Added batch selection in the document page, allowing to select multiple documents (or all matching the current search) and either manage tags or delete them in one go.diff --git a/.changeset/loose-roses-tickle.md b/.changeset/loose-roses-tickle.mdnew file mode 100644index 00000000..a811c3a9--- /dev/null+++ b/.changeset/loose-roses-tickle.md@@ -0,0 +1,5 @@+---+"@papra/app": patch+---++Added a batch document tag management API endpoint.diff --git a/.changeset/strong-cooks-see.md b/.changeset/strong-cooks-see.mdindex bcca2826..adcb8cbe 100644--- a/.changeset/strong-cooks-see.md+++ b/.changeset/strong-cooks-see.md@@ -3,4 +3,4 @@"@papra/app": patch----Add batch document trash endpoint+Add batch document trash API endpoint.diff --git a/apps/papra-client/src/locales/en.dictionary.ts b/apps/papra-client/src/locales/en.dictionary.tsindex e0352973..d7b1e170 100644--- a/apps/papra-client/src/locales/en.dictionary.ts+++ b/apps/papra-client/src/locales/en.dictionary.ts@@ -331,6 +331,29 @@ export const translations = {'documents.list.search.total-count-with-query': '{{ count }} {{ count, =1:document, documents }} matching this query','documents.list.search.total-count-no-query': '{{ count }} {{ count, =1:document, documents }} in total',+ 'documents.list.batch.selected-count': '{{ count }} {{ count, =1:document, documents }} selected',+ 'documents.list.batch.clear': 'Clear selection',+ 'documents.list.batch.tag-action': 'Tag',+ 'documents.list.batch.trash-action': 'Trash',+ 'documents.list.batch.error': 'The batch operation failed. Please try again.',+ 'documents.list.batch.select-all-matching': 'Select all {{ count }} matching this search',+ 'documents.list.batch.select-all': 'Select all {{ count }} {{ count, =1:document, documents }}',+ 'documents.list.batch.all-matching-selected': 'All {{ count }} {{ count, =1:document, documents }} matching this search selected',+ 'documents.list.batch.all-selected': 'All {{ count }} {{ count, =1:document, documents }} selected',+ 'documents.list.batch.trash.confirm.title': 'Move to trash',+ 'documents.list.batch.trash.confirm.description': 'Move {{ count }} {{ count, =1:document, documents }} to trash? You can restore them later from the trash.',+ 'documents.list.batch.trash.confirm.label': 'Move to trash',+ 'documents.list.batch.trash.confirm.cancel': 'Cancel',+ 'documents.list.batch.trash.success': '{{ count }} {{ count, =1:document, documents }} moved to trash',+ 'documents.list.batch.tags.dialog.title': 'Update tags',+ 'documents.list.batch.tags.dialog.description': 'Add or remove tags on {{ count }} selected {{ count, =1:document, documents }}.',+ 'documents.list.batch.tags.dialog.add-label': 'Tags to add',+ 'documents.list.batch.tags.dialog.remove-label': 'Tags to remove',+ 'documents.list.batch.tags.dialog.overlap-error': 'A tag cannot be both added and removed in the same operation.',+ 'documents.list.batch.tags.dialog.submit': 'Apply',+ 'documents.list.batch.tags.dialog.cancel': 'Cancel',+ 'documents.list.batch.tags.success': 'Tags updated on {{ count }} {{ count, =1:document, documents }}',+'documents.tabs.info': 'Info','documents.tabs.content': 'Content','documents.tabs.activity': 'Activity',diff --git a/apps/papra-client/src/modules/documents/components/documents-batch-tag-dialog.component.tsx b/apps/papra-client/src/modules/documents/components/documents-batch-tag-dialog.component.tsxnew file mode 100644index 00000000..35267638--- /dev/null+++ b/apps/papra-client/src/modules/documents/components/documents-batch-tag-dialog.component.tsx@@ -0,0 +1,91 @@+import type { Component } from 'solid-js';+import { createEffect, createSignal, on, Show } from 'solid-js';+import { useI18n } from '@/modules/i18n/i18n.provider';+import { DocumentTagPicker } from '@/modules/tags/components/tag-picker.component';+import { Button } from '@/modules/ui/components/button';+import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle } from '@/modules/ui/components/dialog';++export const DocumentsBatchTagDialog: Component<{+ open: boolean;+ onOpenChange: (open: boolean) => void;+ organizationId: string;+ selectionCount: number;+ isPending?: boolean;+ onSubmit: (args: { addTagIds: string[]; removeTagIds: string[] }) => void;+}> = (props) => {+ const { t } = useI18n();+ const [getAddTagIds, setAddTagIds] = createSignal<string[]>([]);+ const [getRemoveTagIds, setRemoveTagIds] = createSignal<string[]>([]);++ const overlap = () => {+ const removeSet = new Set(getRemoveTagIds());+ return getAddTagIds().some(id => removeSet.has(id));+ };++ const canSubmit = () => !overlap() && (getAddTagIds().length > 0 || getRemoveTagIds().length > 0);++ function handleSubmit() {+ if (!canSubmit()) {+ return;+ }+ props.onSubmit({ addTagIds: getAddTagIds(), removeTagIds: getRemoveTagIds() });+ }++ createEffect(on(+ () => props.open,+ () => {+ setAddTagIds([]);+ setRemoveTagIds([]);+ },+ ));++ return (+ <Dialog open={props.open} onOpenChange={props.onOpenChange}>+ <DialogContent class="sm:max-w-[480px]">+ <DialogHeader>+ <DialogTitle>{t('documents.list.batch.tags.dialog.title')}</DialogTitle>+ <DialogDescription>+ {t('documents.list.batch.tags.dialog.description', { count: props.selectionCount })}+ </DialogDescription>+ </DialogHeader>++ <Show when={props.open}>+ <div class="flex flex-col gap-4">+ <div class="flex flex-col gap-2">+ <label class="text-sm font-medium">{t('documents.list.batch.tags.dialog.add-label')}</label>+ <DocumentTagPicker+ organizationId={props.organizationId}+ tagIds={[]}+ onTagsChange={({ tags }) => setAddTagIds(tags.map(tag => tag.id))}+ />+ </div>++ <div class="flex flex-col gap-2">+ <label class="text-sm font-medium">{t('documents.list.batch.tags.dialog.remove-label')}</label>+ <DocumentTagPicker+ organizationId={props.organizationId}+ tagIds={[]}+ onTagsChange={({ tags }) => setRemoveTagIds(tags.map(tag => tag.id))}+ />+ </div>++ <Show when={overlap()}>+ <p class="text-sm text-red-500">{t('documents.list.batch.tags.dialog.overlap-error')}</p>+ </Show>+ </div>+ </Show>++ <DialogFooter>+ <div class="flex gap-2 justify-end flex-col-reverse sm:flex-row">+ <Button variant="secondary" onClick={() => props.onOpenChange(false)} disabled={props.isPending}>+ {t('documents.list.batch.tags.dialog.cancel')}+ </Button>+ <Button onClick={handleSubmit} disabled={!canSubmit() || props.isPending} isLoading={props.isPending}>+ {t('documents.list.batch.tags.dialog.submit')}+ </Button>+ </div>+ </DialogFooter>+ </DialogContent>+ </Dialog>+ );+};diff --git a/apps/papra-client/src/modules/documents/components/documents-list.component.tsx b/apps/papra-client/src/modules/documents/components/documents-list.component.tsxindex 77451eda..379821b3 100644--- a/apps/papra-client/src/modules/documents/components/documents-list.component.tsx+++ b/apps/papra-client/src/modules/documents/components/documents-list.component.tsx@@ -1,4 +1,4 @@-import type { ColumnDef } from '@tanstack/solid-table';+import type { ColumnDef, RowSelectionState } from '@tanstack/solid-table';import type { Accessor, Component, Setter } from 'solid-js';import type { Document } from '../documents.types';import type { Pagination } from '@/modules/shared/pagination/pagination.types';@@ -17,11 +17,37 @@ import { useI18n } from '@/modules/i18n/i18n.provider';import { cn } from '@/modules/shared/style/cn';import { DocumentTagsList } from '@/modules/tags/components/tag-list.component';import { Button } from '@/modules/ui/components/button';+import { Checkbox, CheckboxControl } from '@/modules/ui/components/checkbox';import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/modules/ui/components/select';import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@/modules/ui/components/table';import { getDocumentIcon, getDocumentNameExtension, getDocumentNameWithoutExtension } from '../document.models';import { DocumentManagementDropdown } from './document-management-dropdown.component';+const selectionColumn: ColumnDef<Document> = {+ id: 'select',+ header: props => (+ <Checkbox+ checked={props.table.getIsAllPageRowsSelected()}+ indeterminate={props.table.getIsSomePageRowsSelected() && !props.table.getIsAllPageRowsSelected()}+ onChange={value => props.table.toggleAllPageRowsSelected(value)}+ aria-label="Select all rows on this page"+ >+ <CheckboxControl />+ </Checkbox>+ ),+ cell: props => (+ <Checkbox+ checked={props.row.getIsSelected()}+ onChange={value => props.row.toggleSelected(value)}+ aria-label="Select row"+ >+ <CheckboxControl />+ </Checkbox>+ ),+ enableSorting: false,+ enableHiding: false,+};+export const createdAtColumn: ColumnDef<Document> = {header: () => {const { t } = useI18n();@@ -78,13 +104,18 @@ export const DocumentsPaginatedList: Component<{setPagination?: Setter<Pagination>;extraColumns?: ColumnDef<Document>[];showPagination?: boolean;+ enableBatchSelection?: boolean;+ getRowSelection?: Accessor<RowSelectionState>;+ setRowSelection?: Setter<RowSelectionState>;}> = (props) => {const { t } = useI18n();const table = createSolidTable({get data() {return props.documents ?? [];},+ getRowId: row => row.id,columns: [+ ...(props.enableBatchSelection ? [selectionColumn] : []),{header: () => t('documents.list.table.headers.file-name'),id: 'fileName',@@ -129,10 +160,15 @@ export const DocumentsPaginatedList: Component<{getCoreRowModel: getCoreRowModel(),getPaginationRowModel: getPaginationRowModel(),onPaginationChange: props.setPagination,+ onRowSelectionChange: props.setRowSelection,+ enableRowSelection: props.enableBatchSelection ?? false,state: {get pagination() {return props.getPagination?.();},+ get rowSelection() {+ return props.getRowSelection?.() ?? {};+ },},manualPagination: true,});diff --git a/apps/papra-client/src/modules/documents/documents-batch.services.ts b/apps/papra-client/src/modules/documents/documents-batch.services.tsnew file mode 100644index 00000000..5994b196--- /dev/null+++ b/apps/papra-client/src/modules/documents/documents-batch.services.ts@@ -0,0 +1,37 @@+import { apiClient } from '../shared/http/api-client';++export type BatchTargetFilter+ = | { documentIds: string[] }+ | { query: string };++export async function batchTrashDocuments({+ organizationId,+ filter,+}: {+ organizationId: string;+ filter: BatchTargetFilter;+}) {+ await apiClient({+ method: 'POST',+ path: `/api/organizations/${organizationId}/documents/batch/trash`,+ body: { filter },+ });+}++export async function batchUpdateDocumentTags({+ organizationId,+ filter,+ addTagIds,+ removeTagIds,+}: {+ organizationId: string;+ filter: BatchTargetFilter;+ addTagIds?: string[];+ removeTagIds?: string[];+}) {+ await apiClient({+ method: 'POST',+ path: `/api/organizations/${organizationId}/documents/batch/tags`,+ body: { filter, addTagIds, removeTagIds },+ });+}diff --git a/apps/papra-client/src/modules/documents/pages/documents.page.tsx b/apps/papra-client/src/modules/documents/pages/documents.page.tsxindex 695a51a2..2b7707f7 100644--- a/apps/papra-client/src/modules/documents/pages/documents.page.tsx+++ b/apps/papra-client/src/modules/documents/pages/documents.page.tsx@@ -1,24 +1,35 @@+import type { RowSelectionState } from '@tanstack/solid-table';import type { Component } from 'solid-js';+import type { BatchTargetFilter } from '../documents-batch.services';import { useParams } from '@solidjs/router';-import { keepPreviousData, useQuery } from '@tanstack/solid-query';-import { Show, Suspense } from 'solid-js';+import { keepPreviousData, useMutation, useQuery } from '@tanstack/solid-query';+import { createEffect, createMemo, createSignal, on, Show, Suspense } from 'solid-js';import { useI18n } from '@/modules/i18n/i18n.provider';+import { useConfirmModal } from '@/modules/shared/confirm';import { createParamSynchronizedPagination } from '@/modules/shared/pagination/query-synchronized-pagination';+import { queryClient } from '@/modules/shared/query/query-client';import { createParamSynchronizedSignal } from '@/modules/shared/signals/params';import { cn } from '@/modules/shared/style/cn';import { useDebounce } from '@/modules/shared/utils/timing';import { Button } from '@/modules/ui/components/button';+import { createToast } from '@/modules/ui/components/sonner';import { TextField, TextFieldRoot } from '@/modules/ui/components/textfield';import { DocumentUploadArea } from '../components/document-upload-area.component';+import { DocumentsBatchTagDialog } from '../components/documents-batch-tag-dialog.component';import { createdAtColumn, DocumentsPaginatedList, standardActionsColumn, tagsColumn } from '../components/documents-list.component';+import { batchTrashDocuments, batchUpdateDocumentTags } from '../documents-batch.services';import { fetchOrganizationDocuments } from '../documents.services';export const DocumentsPage: Component = () => {const params = useParams();const { t } = useI18n();+ const { confirm } = useConfirmModal();const [getSearchQuery, setSearchQuery] = createParamSynchronizedSignal<string>({ paramKey: 'query', defaultValue: '' });const debouncedSearchQuery = useDebounce(getSearchQuery, 300);const [getPagination, setPagination] = createParamSynchronizedPagination();+ const [getRowSelection, setRowSelection] = createSignal<RowSelectionState>({});+ const [getSelectAllMatchingQuery, setSelectAllMatchingQuery] = createSignal(false);+ const [getTagDialogOpen, setTagDialogOpen] = createSignal(false);const documentsQuery = useQuery(() => ({queryKey: ['organizations', params.organizationId, 'documents', getPagination(), debouncedSearchQuery()],@@ -30,6 +41,138 @@ export const DocumentsPage: Component = () => {placeholderData: keepPreviousData,}));+ const getSelectedIds = createMemo(() => {+ const selection = getRowSelection();+ return Object.keys(selection).filter(id => selection[id]);+ });++ const getEffectiveCount = () => {+ if (getSelectAllMatchingQuery()) {+ return documentsQuery.data?.documentsCount ?? 0;+ }+ return getSelectedIds().length;+ };++ const isAllPageSelected = createMemo(() => {+ const docs = documentsQuery.data?.documents ?? [];+ if (docs.length === 0) {+ return false;+ }+ const selection = getRowSelection();+ return docs.every(doc => selection[doc.id]);+ });++ const hasMoreThanPage = createMemo(() => {+ const total = documentsQuery.data?.documentsCount ?? 0;+ const shown = documentsQuery.data?.documents.length ?? 0;+ return total > shown;+ });++ const canPromoteToAllMatching = () => isAllPageSelected() && hasMoreThanPage() && !getSelectAllMatchingQuery();++ function clearSelection() {+ setRowSelection({});+ setSelectAllMatchingQuery(false);+ }++ createEffect(on(debouncedSearchQuery, () => {+ clearSelection();+ }, { defer: true }));++ createEffect(on(() => getPagination(), () => {+ setSelectAllMatchingQuery(false);+ }, { defer: true }));++ function getBatchFilter(): BatchTargetFilter | undefined {+ if (getSelectAllMatchingQuery()) {+ return { query: debouncedSearchQuery() };+ }+ const ids = getSelectedIds();+ if (ids.length === 0) {+ return undefined;+ }+ return { documentIds: ids };+ }++ function invalidateDocuments() {+ queryClient.invalidateQueries({ queryKey: ['organizations', params.organizationId, 'documents'] });+ }++ const trashMutation = useMutation(() => ({+ mutationFn: async () => {+ const filter = getBatchFilter();+ if (!filter) {+ return;+ }+ await batchTrashDocuments({ organizationId: params.organizationId, filter });+ },+ onSuccess: () => {+ const count = getEffectiveCount();+ invalidateDocuments();+ clearSelection();+ createToast({+ message: t('documents.list.batch.trash.success', { count }),+ type: 'success',+ });+ },+ onError: () => {+ createToast({+ message: t('documents.list.batch.error'),+ type: 'error',+ });+ },+ }));++ const tagMutation = useMutation(() => ({+ mutationFn: async ({ addTagIds, removeTagIds }: { addTagIds: string[]; removeTagIds: string[] }) => {+ const filter = getBatchFilter();+ if (!filter) {+ return;+ }+ await batchUpdateDocumentTags({+ organizationId: params.organizationId,+ filter,+ addTagIds,+ removeTagIds,+ });+ },+ onSuccess: () => {+ const count = getEffectiveCount();+ invalidateDocuments();+ clearSelection();+ createToast({+ message: t('documents.list.batch.tags.success', { count }),+ type: 'success',+ });+ },+ onError: () => {+ createToast({+ message: t('documents.list.batch.error'),+ type: 'error',+ });+ },+ }));++ const showToolbar = () => getSelectedIds().length > 0 || getSelectAllMatchingQuery();++ async function handleBatchTrash() {+ const isConfirmed = await confirm({+ title: t('documents.list.batch.trash.confirm.title'),+ message: t('documents.list.batch.trash.confirm.description', { count: getEffectiveCount() }),+ confirmButton: {+ text: t('documents.list.batch.trash.confirm.label'),+ variant: 'destructive',+ },+ cancelButton: {+ text: t('documents.list.batch.trash.confirm.cancel'),+ },+ });+ if (!isConfirmed) {+ return;+ }+ trashMutation.mutate();+ }+return (<div class="p-6 mt-4 pb-32 max-w-5xl mx-auto"><Suspense>@@ -83,12 +226,87 @@ export const DocumentsPage: Component = () => {</Show></div>- <div class="mb-4 text-sm text-muted-foreground mt-2 ml-2">++ <div class="mb-4 mt-2 ml-2 min-h-8 flex items-center"><Show- when={debouncedSearchQuery().length > 0}- fallback={t('documents.list.search.total-count-no-query', { count: documentsQuery.data?.documentsCount ?? 0 })}+ when={showToolbar()}+ fallback={(+ <span class="text-sm text-muted-foreground">+ <Show+ when={debouncedSearchQuery().length > 0}+ fallback={t('documents.list.search.total-count-no-query', { count: documentsQuery.data?.documentsCount ?? 0 })}+ >+ {t('documents.list.search.total-count-with-query', { count: documentsQuery.data?.documentsCount ?? 0 })}+ </Show>+ </span>+ )}>- {t('documents.list.search.total-count-with-query', { count: documentsQuery.data?.documentsCount ?? 0 })}+ <div class="flex flex-wrap items-center gap-x-2 gap-y-1 text-sm flex-1">+ <span class="font-medium">+ <Show+ when={getSelectAllMatchingQuery()}+ fallback={t('documents.list.batch.selected-count', { count: getEffectiveCount() })}+ >+ <Show+ when={debouncedSearchQuery().length > 0}+ fallback={t('documents.list.batch.all-selected', { count: getEffectiveCount() })}+ >+ {t('documents.list.batch.all-matching-selected', { count: getEffectiveCount() })}+ </Show>+ </Show>+ </span>++ <Show when={canPromoteToAllMatching()}>+ <Button+ variant="link"+ size="sm"+ class="h-auto p-0"+ onClick={() => setSelectAllMatchingQuery(true)}+ >+ <Show+ when={debouncedSearchQuery().length > 0}+ fallback={t('documents.list.batch.select-all', { count: documentsQuery.data?.documentsCount ?? 0 })}+ >+ {t('documents.list.batch.select-all-matching', { count: documentsQuery.data?.documentsCount ?? 0 })}+ </Show>+ </Button>+ </Show>++ <div class="flex items-center gap-2 ml-auto">+ <Button+ variant="outline"+ size="sm"+ onClick={() => setTagDialogOpen(true)}+ disabled={tagMutation.isPending || trashMutation.isPending}+ >+ <div class="i-tabler-tag size-4 mr-2" />+ {t('documents.list.batch.tag-action')}+ </Button>++ <Button+ variant="outline"+ size="sm"+ onClick={handleBatchTrash}+ isLoading={trashMutation.isPending}+ disabled={tagMutation.isPending}+ class="text-red-500 hover:text-red-600"+ >+ <div class="i-tabler-trash size-4 mr-2" />+ {t('documents.list.batch.trash-action')}+ </Button>++ <Button+ variant="ghost"+ size="icon"+ class="size-8"+ onClick={clearSelection}+ disabled={tagMutation.isPending || trashMutation.isPending}+ aria-label={t('documents.list.batch.clear')}+ >+ <div class="i-tabler-x size-4" />+ </Button>+ </div>+ </div></Show></div>@@ -103,12 +321,27 @@ export const DocumentsPage: Component = () => {documentsCount={documentsQuery.data?.documentsCount ?? 0}getPagination={getPagination}setPagination={setPagination}+ enableBatchSelection+ getRowSelection={getRowSelection}+ setRowSelection={setRowSelection}extraColumns={[tagsColumn,createdAtColumn,standardActionsColumn,]}/>++ <DocumentsBatchTagDialog+ open={getTagDialogOpen()}+ onOpenChange={setTagDialogOpen}+ organizationId={params.organizationId}+ selectionCount={getEffectiveCount()}+ isPending={tagMutation.isPending}+ onSubmit={({ addTagIds, removeTagIds }) => {+ setTagDialogOpen(false);+ tagMutation.mutate({ addTagIds, removeTagIds });+ }}+ /></>)}</Suspense>diff --git a/apps/papra-client/src/modules/ui/components/checkbox.tsx b/apps/papra-client/src/modules/ui/components/checkbox.tsxindex 8c31b774..058fe242 100644--- a/apps/papra-client/src/modules/ui/components/checkbox.tsx+++ b/apps/papra-client/src/modules/ui/components/checkbox.tsx@@ -23,27 +23,14 @@ export function CheckboxControl<T extends ValidComponent = 'div'>(props: Polymor<CheckboxPrimitive.Input class="[&:focus-visible+div]:(outline-none ring-1.5 ring-ring ring-offset-2 ring-offset-background)" {...local.inputProps} /><CheckboxPrimitive.Controlclass={cn(- 'h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:(outline-none ring-1.5 ring-ring) data-[disabled]:(cursor-not-allowed opacity-50) data-[checked]:(bg-primary text-primary-foreground) transition-shadow',+ 'h-4 w-4 shrink-0 rounded-sm border focus-visible:(outline-none ring-1.5 ring-ring) data-[disabled]:(cursor-not-allowed opacity-50) data-[checked]:(bg-primary text-primary-foreground border-primary) data-[indeterminate]:(text-primary border-primary)',local.class,)}{...rest as any}>- <CheckboxPrimitive.Indicator class="flex items-center justify-center text-current">- <svg- xmlns="http://www.w3.org/2000/svg"- viewBox="0 0 24 24"- class="h-4 w-4"- >- <path- fill="none"- stroke="currentColor"- stroke-linecap="round"- stroke-linejoin="round"- stroke-width="2"- d="m5 12l5 5L20 7"- />- <title>Checkbox</title>- </svg>+ <CheckboxPrimitive.Indicator class="flex items-center justify-center text-current group">+ <span class="i-tabler-check hidden group-data-[checked]:block" />+ <span class="i-tabler-minus hidden group-data-[indeterminate]:block" /></CheckboxPrimitive.Indicator></CheckboxPrimitive.Control></>diff --git a/apps/papra-client/src/modules/ui/components/table.tsx b/apps/papra-client/src/modules/ui/components/table.tsxindex fc9effd7..f7bcca90 100644--- a/apps/papra-client/src/modules/ui/components/table.tsx+++ b/apps/papra-client/src/modules/ui/components/table.tsx@@ -46,7 +46,7 @@ export function TableRow(props: ComponentProps<'tr'>) {return (<trclass={cn(- 'border-b transition-colors data-[state=selected]:bg-muted',+ 'border-b transition-colors data-[state=selected]:bg-muted/30',local.class,)}{...rest}