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
3 changes: 3 additions & 0 deletions .Jules/palette.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## 2025-02-12 - Added ARIA labels to icon-only buttons
**Learning:** Found several icon-only buttons (`<Plus />`, `<X />`) used for managing state input tags in the `ArrivalChipBar.tsx` component that lacked `aria-label`s. This is a common pattern to watch out for.
**Action:** When finding inline controls that look like tags or chips, verify that any interactive, icon-only buttons within them have clear, descriptive `aria-label`s.
3 changes: 3 additions & 0 deletions vessel/src/components/chat/ArrivalChipBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@
<button
type="button"
disabled={disabled}
aria-label="Remove custom state"
onClick={handleRemoveCustom}
className="text-emerald-400 hover:text-emerald-200 focus-visible:outline-none"
title="Remove custom state"
Expand All @@ -241,49 +242,51 @@
<X size={10} />
</button>
</div>
) : isTypingCustom ? (
<div className="flex items-center gap-1.5">
<input
autoFocus
type="text"
disabled={disabled}
placeholder="type state..."
value={customInputVal}
onChange={(e) => setCustomInputVal(e.target.value.slice(0, 100))}
onKeyDown={handleCustomKeyDown}
onBlur={handleCustomSubmit}
className="rounded-md border border-white/[0.1] bg-black/40 px-2 py-0.5 font-mono text-[10px] text-slate-200 focus:border-emerald-500/50 focus:outline-none focus:ring-1 focus:ring-emerald-500/30"
/>
<button
type="button"
aria-label="Add custom state"
onClick={handleCustomSubmit}
className="text-slate-400 hover:text-slate-200"
>
<Plus size={12} />
</button>
<button
type="button"
aria-label="Cancel custom state"
onClick={() => setIsTypingCustom(false)}
className="text-slate-500 hover:text-slate-400"
>
<X size={10} />
</button>
</div>
) : (
<button
type="button"
disabled={disabled || totalSelectedCount >= 3}
onClick={() => setIsTypingCustom(true)}
className={cn(
'rounded-full border border-dashed border-white/[0.12] bg-transparent px-2.5 py-1 font-mono text-[10px] text-slate-500 transition-colors',
totalSelectedCount >= 3
? 'cursor-not-allowed opacity-40'
: 'hover:border-slate-400 hover:text-slate-300',
)}
>
+ I&apos;ll type it
</button>
)}

Check warning on line 289 in vessel/src/components/chat/ArrivalChipBar.tsx

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Extract this nested ternary operation into an independent statement.

See more on https://sonarcloud.io/project/issues?id=DHCross_Shipyard&issues=AZ8QldTdxUhlGni3YF7s&open=AZ8QldTdxUhlGni3YF7s&pullRequest=884
</div>

<button
Expand Down
Loading