Skip to content
Open
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
13 changes: 13 additions & 0 deletions app/app/create/batch/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ export default function BatchCreatePage() {
const [completedCount, setCompletedCount] = useState(0)
const [queuedCount, setQueuedCount] = useState(0)
const [executionErrors, setExecutionErrors] = useState<string[]>([])
const [liveStatus, setLiveStatus] = useState('')
const selectedTokenInfo = TOKENS.find((t) => t.address === selectedToken) ??
TOKENS[0] ?? { address: '', symbol: 'XLM', decimals: 7 }

Expand Down Expand Up @@ -190,6 +191,11 @@ export default function BatchCreatePage() {
setExecutionErrors([])
setCompletedCount(0)
setQueuedCount(validRows.length)
// Issue #686: announce progress for screen-reader/keyboard-only users.
// `createStreamsBatch` submits every row as a single on-chain
// transaction (not one call per row), so there's no real per-row
// progress to announce — we report the start and the final outcome.
setLiveStatus(`Creating ${validRows.length} stream${validRows.length === 1 ? '' : 's'}…`)

const failures: string[] = []

Expand All @@ -213,8 +219,10 @@ export default function BatchCreatePage() {

if (failures.length > 0) {
setExecutionErrors(failures)
setLiveStatus(`Batch failed: ${failures[0]}`)
toast.error('Batch create failed.')
} else {
setLiveStatus(`${validRows.length} of ${validRows.length} streams created successfully.`)
toast.success('Batch create completed', {
description: `${validRows.length} streams created successfully.`,
})
Expand Down Expand Up @@ -381,6 +389,11 @@ export default function BatchCreatePage() {
</div>
)}

{/* Issue #686: screen-reader-only live region announcing batch progress */}
<div role="status" aria-live="polite" className="sr-only">
{liveStatus}
</div>

<div className="rounded-2xl border border-border bg-card p-5">
<div className="space-y-4">
<div className="flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between">
Expand Down
Loading