Skip to content
Closed
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
Expand Up @@ -54,3 +54,6 @@
## 2024-07-13 - [Table Node Accessibility]
**Learning:** Adding `aria-hidden="true"` inside `abbr` elements with `aria-label` prevents screen readers from redundantly announcing short abbreviations like "PK" or "NN" along with their full label.
**Action:** When creating short, domain-specific abbreviations with tooltips, use `aria-label` on the wrapper and hide the visual text from screen readers using `aria-hidden="true"` to create a cleaner auditory experience.
## 2026-07-27 - [Descriptive ARIA labels for modal buttons]
**Learning:** Adding dynamic, contextual `aria-label` attributes to generic buttons (like Save, Cancel, Delete) inside modals significantly improves screen reader navigation and clarity, ensuring users understand exactly what action they are taking.
**Action:** Always provide contextual `aria-label`s for generic action buttons in dialogs using dynamic data like node or edge names.
Comment on lines +57 to +59
4 changes: 3 additions & 1 deletion frontend/src/components/modals/EditEdgeModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,16 @@ export function EditEdgeModal({
type="button"
onClick={onRelDelete}
style={{ color: "#b91c1c", borderColor: "#fca5a5" }}
aria-label={`๊ด€๊ณ„ ์‚ญ์ œ (${editingEdge.source}์—์„œ ${editingEdge.target})`}
>
์‚ญ์ œ
</button>
<div className="row">
<button type="button" onClick={onRelCancel}>์ทจ์†Œ</button>
<button type="button" onClick={onRelCancel} aria-label="๊ด€๊ณ„ ํŽธ์ง‘ ์ทจ์†Œ">์ทจ์†Œ</button>
<button
type="submit"
style={{ background: "#034ea2", color: "#fff" }}
aria-label={`๊ด€๊ณ„ ์ €์žฅ (${editingEdge.source}์—์„œ ${editingEdge.target})`}
>
์ €์žฅ
</button>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/modals/EditTableModal.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ describe('EditTableModal', () => {
render(<EditTableModal {...defaultProps} editingNode={editingNode as any} setNodes={setNodesMock} onEditTableCancel={onEditTableCancelMock} />);

const user = userEvent.setup();
await user.click(screen.getByRole('button', { name: '๋ณต์ œ' }));
await user.click(screen.getByRole('button', { name: 'test_table ํ…Œ์ด๋ธ” ๋ณต์ œ' }));

expect(setNodesMock).toHaveBeenCalled();
expect(onEditTableCancelMock).toHaveBeenCalled();
Expand Down
5 changes: 4 additions & 1 deletion frontend/src/components/modals/EditTableModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ export function EditTableModal({
type="button"
onClick={onDeleteTable}
style={{ color: "#b91c1c", borderColor: "#fca5a5" }}
aria-label={`${editingNode.data.title} ํ…Œ์ด๋ธ” ์‚ญ์ œ`}
>
ํ…Œ์ด๋ธ” ์‚ญ์ œ
</button>
Expand Down Expand Up @@ -218,16 +219,18 @@ export function EditTableModal({
onEditTableCancel();
}}
style={{ color: "#034ea2", borderColor: "#93c5fd" }}
aria-label={`${editingNode.data.title} ํ…Œ์ด๋ธ” ๋ณต์ œ`}
>
๋ณต์ œ
</button>
</div>
<div className="row">
<button type="button" onClick={onEditTableCancel}>์ทจ์†Œ</button>
<button type="button" onClick={onEditTableCancel} aria-label="ํ…Œ์ด๋ธ” ํŽธ์ง‘ ์ทจ์†Œ">์ทจ์†Œ</button>
<button
type="submit"
form="editTableForm"
style={{ background: "#034ea2", color: "#fff" }}
aria-label={`${editingNode.data.title} ํ…Œ์ด๋ธ” ์ €์žฅ`}
>
Comment on lines +228 to 234
์ €์žฅ
</button>
Expand Down
12 changes: 6 additions & 6 deletions frontend/src/components/modals/ModalCoverage.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,9 @@ describe('modal behavior coverage', () => {
fireEvent.change(screen.getByLabelText('์ œ์•ฝ์กฐ๊ฑด ์ด๋ฆ„ (Label)'), {
target: { value: 'fk_changed' },
})
fireEvent.click(screen.getByRole('button', { name: '์‚ญ์ œ' }))
fireEvent.click(screen.getByRole('button', { name: '์ทจ์†Œ' }))
fireEvent.click(screen.getByRole('button', { name: '์ €์žฅ' }))
fireEvent.click(screen.getByRole('button', { name: '๊ด€๊ณ„ ์‚ญ์ œ (a์—์„œ b)' }))
fireEvent.click(screen.getByRole('button', { name: '๊ด€๊ณ„ ํŽธ์ง‘ ์ทจ์†Œ' }))
fireEvent.click(screen.getByRole('button', { name: '๊ด€๊ณ„ ์ €์žฅ (a์—์„œ b)' }))
expect(setRelLabel).toHaveBeenCalledWith('fk_changed')
expect(onDelete).toHaveBeenCalledOnce()
expect(onCancel).toHaveBeenCalledOnce()
Expand Down Expand Up @@ -181,8 +181,8 @@ describe('modal behavior coverage', () => {
expect(deleteEditing(tableNode)?.data.columns).toHaveLength(1)

fireEvent.submit(document.getElementById('editTableForm')!)
fireEvent.click(screen.getByRole('button', { name: 'ํ…Œ์ด๋ธ” ์‚ญ์ œ' }))
fireEvent.click(screen.getByRole('button', { name: '๋ณต์ œ' }))
fireEvent.click(screen.getByRole('button', { name: 'public.users ํ…Œ์ด๋ธ” ์‚ญ์ œ' }))
fireEvent.click(screen.getByRole('button', { name: 'public.users ํ…Œ์ด๋ธ” ๋ณต์ œ' }))
const duplicate = setNodes.mock.calls[2]?.[0] as (nodes: Node<TableNodeData>[]) => Node<TableNodeData>[]
const duplicated = duplicate([tableNode])[1]!
expect(duplicated).toMatchObject({
Expand All @@ -191,7 +191,7 @@ describe('modal behavior coverage', () => {
data: { title: 'public.users_copy' },
})
expect(duplicated.data.columns).not.toBe(tableNode.data.columns)
fireEvent.click(screen.getByRole('button', { name: '์ทจ์†Œ' }))
fireEvent.click(screen.getByRole('button', { name: 'ํ…Œ์ด๋ธ” ํŽธ์ง‘ ์ทจ์†Œ' }))
fireEvent.click(screen.getByRole('button', { name: '๋‹ซ๊ธฐ' }))
expect(onSubmit).toHaveBeenCalledOnce()
expect(onDeleteTable).toHaveBeenCalledOnce()
Expand Down
Loading