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
4 changes: 4 additions & 0 deletions .Jules/palette.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
## 2026-03-18 - [Add aria-busy to loading buttons]

**Learning:** Components reflecting loading state via `isLoading` or `isSubmitting` often lack the `aria-busy` attribute, which is crucial for informing screen readers about the element's busy state.
**Action:** Add `aria-busy` attributes to button components and standalone buttons showing loading states.
2 changes: 2 additions & 0 deletions src/components/events/EventAnnotations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@
<button
onClick={handleSubmit}
disabled={!newComment.trim() || isSubmitting}
aria-busy={isSubmitting ? 'true' : undefined}
className={cn(
'flex items-center gap-2 rounded-lg px-4 py-2 text-sm font-semibold text-white transition-all',
newComment.trim() && !isSubmitting
Expand Down Expand Up @@ -282,7 +283,7 @@
<div className="flex gap-3">
{/* Avatar */}
{thread.userAvatar ? (
<img

Check warning on line 286 in src/components/events/EventAnnotations.tsx

View workflow job for this annotation

GitHub Actions / Lint & Type Check

Using `<img>` could result in slower LCP and higher bandwidth. Consider using `<Image />` from `next/image` or a custom image loader to automatically optimize images. This may incur additional usage or cost from your provider. See: https://nextjs.org/docs/messages/no-img-element
src={thread.userAvatar}
alt={thread.userName}
className="size-8 rounded-full"
Expand Down Expand Up @@ -361,6 +362,7 @@
<button
onClick={() => handleEdit(thread.id)}
disabled={!editContent.trim() || isSubmitting}
aria-busy={isSubmitting ? 'true' : undefined}
className="rounded-md bg-[#6C63FF] px-3 py-1.5 text-xs font-medium text-white hover:bg-[#5A52E6] transition-colors disabled:opacity-50"
>
Save
Expand Down
3 changes: 2 additions & 1 deletion src/components/ui/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { buttonVariants } from './button-variants'

export interface ButtonProps
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
VariantProps<typeof buttonVariants> {
VariantProps<typeof buttonVariants> {
asChild?: boolean
isLoading?: boolean
}
Expand Down Expand Up @@ -45,6 +45,7 @@ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
className={cn(buttonVariants({ variant, size, className }))}
ref={ref}
disabled={isLoading || props.disabled}
aria-busy={isLoading ? 'true' : undefined}
onClick={handleClick}
{...props}
>
Expand Down
Loading