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
4 changes: 4 additions & 0 deletions .jules/palette.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,7 @@
## 2026-07-30 - Add window.confirm for destructive actions
**Learning:** Destructive actions like deleting groups and edge relationships previously occurred immediately without user confirmation.
**Action:** Always wrap delete operations with window.confirm() dialogs and ensure corresponding tests successfully mock window.confirm.

## 2024-09-04 - Accessible disabled button hints
**Learning:** Using the native HTML `disabled` attribute on a button removes it from the document's tab order. This makes it impossible for screen reader and keyboard-only users to focus the button and hear any associated `aria-describedby` hints explaining why the button is disabled (such as access control warnings).
**Action:** To create a fully accessible disabled button with an explanatory hint, use `aria-disabled={true}`, visually style it as disabled (e.g., `opacity: 0.5, cursor: "not-allowed"`), and manually block its action via `onClick={(e) => e.preventDefault()}`.
6 changes: 5 additions & 1 deletion frontend/src/components/modals/ExportModal.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,12 @@ describe('ExportModal', () => {

expect(screen.getByText('์ ‘๊ทผ ๊ถŒํ•œ ๊ด€๋ฆฌ๋Š” ํ”„๋กœ์ ํŠธ ๊ถŒํ•œ ์„ค์ •์—์„œ ์ฒ˜๋ฆฌํ•ฉ๋‹ˆ๋‹ค.')).toBeInTheDocument();
const accessManagementButton = screen.getByRole('button', { name: '์ ‘๊ทผ ๊ด€๋ฆฌ' });
expect(accessManagementButton).toBeDisabled();
expect(accessManagementButton).toHaveAttribute('aria-disabled', 'true');
expect(accessManagementButton).toHaveAttribute('aria-describedby', 'share-export-access-hint');
expect(accessManagementButton).not.toHaveAttribute('title');

// Verify it is still keyboard-focusable
accessManagementButton.focus();
expect(accessManagementButton).toHaveFocus();
});
});
3 changes: 2 additions & 1 deletion frontend/src/components/modals/ExportModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,8 @@ export function ExportModal({
)}
<button
type="button"
disabled
aria-disabled={true}
onClick={(e) => e.preventDefault()}
aria-describedby="share-export-access-hint"
className="exportModal__disabledHintButton"
>
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,8 @@ button:disabled {
}

.exportModal__disabledHintButton {
opacity: 0.9;
opacity: 0.5;
cursor: not-allowed;
}

.exportModal__hint {
Expand Down
Loading