diff --git a/.jules/palette.md b/.jules/palette.md new file mode 100644 index 00000000..530948af --- /dev/null +++ b/.jules/palette.md @@ -0,0 +1,3 @@ +## 2024-05-25 - Accessibility for textual icon buttons +**Learning:** Textual icons (like `>`) used in icon-only buttons can be read confusingly by screen readers (e.g. "greater than"). It is necessary to hide them with `aria-hidden="true"` while providing a descriptive `aria-label` on the parent ` diff --git a/src/components/discussion/composer/DiscussionHeader.tsx b/src/components/discussion/composer/DiscussionHeader.tsx index 5a7815f7..98a9a1ba 100644 --- a/src/components/discussion/composer/DiscussionHeader.tsx +++ b/src/components/discussion/composer/DiscussionHeader.tsx @@ -1,7 +1,7 @@ -import type { AgentTeamProfile } from '../../../lib/agent-profile'; -import type { Project, RequestItem } from './types'; -import TeamAvatar from '../../agents/TeamAvatar'; -import { truncateText } from './types'; +import type { AgentTeamProfile } from "../../../lib/agent-profile"; +import type { Project, RequestItem } from "./types"; +import TeamAvatar from "../../agents/TeamAvatar"; +import { truncateText } from "./types"; interface Props { selectedTeamProfile?: AgentTeamProfile; @@ -15,28 +15,40 @@ interface Props { onEmptyMemberClick?: () => void; onOpenProfile?: () => void; policyBadge?: { - mode: 'off' | 'warn' | 'enforce'; - state: 'idle' | 'compliant' | 'non_compliant'; + mode: "off" | "warn" | "enforce"; + state: "idle" | "compliant" | "non_compliant"; }; } export default function DiscussionHeader({ - selectedTeamProfile, selectedAgentId, selectedProject, selectedRequest, - setHeaderMenuOpen, headerMenuOpen, copyToClipboard, onEmptyMemberClick, onOpenProfile, policyBadge + selectedTeamProfile, + selectedAgentId, + selectedProject, + selectedRequest, + setHeaderMenuOpen, + headerMenuOpen, + copyToClipboard, + onEmptyMemberClick, + onOpenProfile, + policyBadge, }: Props) { const badgeClass = - policyBadge?.state === 'compliant' - ? 'border-emerald-200 bg-emerald-50 text-emerald-700' - : policyBadge?.state === 'non_compliant' - ? 'border-rose-200 bg-rose-50 text-rose-700' - : 'border-amber-200 bg-amber-50 text-amber-700'; + policyBadge?.state === "compliant" + ? "border-emerald-200 bg-emerald-50 text-emerald-700" + : policyBadge?.state === "non_compliant" + ? "border-rose-200 bg-rose-50 text-rose-700" + : "border-amber-200 bg-amber-50 text-amber-700"; return (
{selectedTeamProfile ? ( ) : (