Skip to content
Merged
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
27 changes: 27 additions & 0 deletions .react-doctor/false-positives.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ storage access elsewhere.
`ad-order-status` is a false positive while each select's ID matches its adjacent
`FieldLabel.htmlFor`. The shared FieldLabel renders a native label. The advertising
admin and order tests exercise these controls using their accessible labels.
Their role-based queries must also find the visible selects as `combobox` with
the names `Tier`, `Status` and `Status`. Each select must have exactly one native
label whose `control` resolves to that select. The tests check that the same
accessible names remain after changing the campaign tier/status or order filter,
and that the selected values update. This does not exempt custom labels that
fail to forward `htmlFor` or selects with missing or duplicate IDs.

## Member project form drafts

Expand Down Expand Up @@ -64,3 +70,24 @@ with no browser reconciliation or row-local state. Commit-message lines likewise
belong to an immutable commit keyed by commit identity. These predicates do not
exempt editable, reorderable, filterable or stateful lists. The interactive
catalogue pagination and GitHub statistics now use semantic keys.

## Admin editor client-side submission

`react-doctor/no-prevent-default` on the collection, create-project and
edit-project forms is intentional while they own the client-side submission
lifecycle. Collection submission flushes the BlockNote editor, validates the
current selection and content, sends the expected revision, and preserves edits
on conflict. Project submission flushes deferred Markdown before TanStack Form
validation and mutation; upload errors restore or clear temporary image keys
without losing the other fields. The edit form also uses explicit review actions
to choose the next status before submission.

`admin-collection-editor.test.tsx`, `admin-project-review-form.test.tsx`,
`github-readme-import.test.tsx` and `github-metadata-prefill.test.tsx` exercise
validation, same-task editor flushing, explicit save, conflicts and retained
drafts. The canonical rule recipe specifically retains `onSubmit` with
`preventDefault` for deliberate client-side validation, uploads and SPA flows.
Moving the call to another handler or replacing it with a client-only action
would hide the diagnostic without adding progressive enhancement. Review again
if these forms gain a native/server-action submission contract. This note does
not exempt unrelated forms or anchor click handlers.
10 changes: 8 additions & 2 deletions apps/web/src/components/action-confirmation.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ReactNode } from 'react'
import type { ComponentProps, ReactNode } from 'react'

import { Alert, AlertDescription } from '@altstack/ui/components/alert'
import {
Expand All @@ -24,6 +24,7 @@ export function ActionConfirmation({
disabled = false,
confirmLabel = 'Confirm',
cancelLabel = 'Cancel',
confirmVariant,
}: {
open: boolean
title: string
Expand All @@ -36,6 +37,7 @@ export function ActionConfirmation({
disabled?: boolean
confirmLabel?: string
cancelLabel?: string
confirmVariant?: ComponentProps<typeof AlertDialogAction>['variant']
}) {
return (
<AlertDialog
Expand All @@ -59,7 +61,11 @@ export function ActionConfirmation({
<AlertDialogCancel disabled={pending}>
{cancelLabel}
</AlertDialogCancel>
<AlertDialogAction disabled={pending || disabled} onClick={onConfirm}>
<AlertDialogAction
variant={confirmVariant}
disabled={pending || disabled}
onClick={onConfirm}
>
{pending ? 'Saving…' : confirmLabel}
</AlertDialogAction>
</AlertDialogFooter>
Expand Down
13 changes: 13 additions & 0 deletions apps/web/src/components/table-column-headings.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { TableHead, TableHeader, TableRow } from '@altstack/ui/components/table'

export function TableColumnHeadings({ headings }: { headings: Array<string> }) {
return (
<TableHeader>
<TableRow>
{headings.map((heading) => (
<TableHead key={heading}>{heading}</TableHead>
))}
</TableRow>
</TableHeader>
)
}
Loading
Loading