-
Notifications
You must be signed in to change notification settings - Fork 1
π¨ Palette: [UX κ°μ ] λΉνμ±νλ λ‘λ© λ²νΌμ aria-busy μμ± μΆκ° #1219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
seonghobae
merged 9 commits into
develop
from
ux-improvement-disabled-buttons-13634237694443312021
Aug 4, 2026
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
5dab65a
π¨ Palette: [UX κ°μ ] λΉνμ±νλ λ‘λ© λ²νΌμ aria-busy μμ± μΆκ°
seonghobae fba4437
chore(ci): dispatch stable current-head review evidence
seonghobae 640e853
chore(ci): remove repo-local review evidence dispatcher
seonghobae 15f79be
test(accessibility): cover busy state for project confirmation
seonghobae 82ef7a9
chore(scope): restore shared Palette learnings
seonghobae 807967e
merge(develop): refresh project loading accessibility branch
seonghobae 4e2eb7f
Merge branch 'develop' into ux-improvement-disabled-buttons-136342376β¦
opencode-agent[bot] d93a985
merge(develop): refresh project confirmation accessibility branch
seonghobae 53ca2af
test(accessibility): assert confirmation disabled lifecycle
seonghobae File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
134 changes: 134 additions & 0 deletions
134
frontend/src/components/ProjectsLayout.accessibility.test.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,134 @@ | ||
| /* @vitest-environment jsdom */ | ||
| import React, { act } from "react"; | ||
| import { createRoot, type Root } from "react-dom/client"; | ||
| import { afterEach, describe, expect, it, vi } from "vitest"; | ||
|
|
||
| const apiClientMock = vi.hoisted(() => ({ | ||
| get: vi.fn(), | ||
| post: vi.fn(), | ||
| getServerSessionClaims: vi.fn(), | ||
| })); | ||
|
|
||
| vi.mock("@/lib/api-client", () => ({ apiClient: apiClientMock })); | ||
|
|
||
| vi.mock("lucide-react", () => ({ | ||
| CalendarDays: () => <svg aria-hidden="true" />, | ||
| CheckCircle2: () => <svg aria-hidden="true" />, | ||
| Clock: () => <svg aria-hidden="true" />, | ||
| FileText: () => <svg aria-hidden="true" />, | ||
| FolderOpen: () => <svg aria-hidden="true" />, | ||
| GitBranch: () => <svg aria-hidden="true" />, | ||
| ListChecks: () => <svg aria-hidden="true" />, | ||
| Network: () => <svg aria-hidden="true" />, | ||
| Search: () => <svg aria-hidden="true" />, | ||
| User: () => <svg aria-hidden="true" />, | ||
| })); | ||
|
|
||
| import { ProjectsLayout } from "./ProjectsLayout"; | ||
|
|
||
| const candidate = { | ||
| candidate_uid: "project_candidate:alpha", | ||
| project_uid: "project_candidate:alpha", | ||
| title: "Project: Alpha Checkout", | ||
| status_code: "needs_review", | ||
| score: 0.87, | ||
| object_count: 1, | ||
| requirement_count: 1, | ||
| issue_count: 0, | ||
| milestone_count: 0, | ||
| deliverable_count: 0, | ||
| participant_count: 0, | ||
| source_segment_count: 1, | ||
| representative_object_uids: [], | ||
| citation_bundle: [], | ||
| updated_at: "2026-08-03T00:00:00Z", | ||
| }; | ||
|
|
||
| async function flushAsyncWork() { | ||
| await act(async () => { | ||
| await Promise.resolve(); | ||
| await Promise.resolve(); | ||
| }); | ||
| } | ||
|
|
||
| describe("ProjectsLayout accessibility", () => { | ||
| let root: Root | null = null; | ||
| let container: HTMLDivElement | null = null; | ||
|
|
||
| afterEach(() => { | ||
| if (root) act(() => root?.unmount()); | ||
| root = null; | ||
| container?.remove(); | ||
| container = null; | ||
| vi.clearAllMocks(); | ||
| }); | ||
|
|
||
| it("announces candidate confirmation as busy while the request is pending", async () => { | ||
| let resolveConfirmation: ((value: typeof candidate) => void) | undefined; | ||
| const pendingConfirmation = new Promise<typeof candidate>((resolve) => { | ||
| resolveConfirmation = resolve; | ||
| }); | ||
|
|
||
| apiClientMock.get.mockImplementation((path: string) => { | ||
| if (path === "/api/webdav/folders") return Promise.resolve([]); | ||
| if (path === "/api/tasks") return Promise.resolve([]); | ||
| if (path === "/api/projects/candidates") { | ||
| return Promise.resolve({ candidates: [candidate] }); | ||
| } | ||
| if (path === "/api/projects/project_candidate%3Aalpha/traceability") { | ||
| return Promise.resolve({ | ||
| project_uid: candidate.project_uid, | ||
| candidate, | ||
| objects: [], | ||
| edges: [], | ||
| }); | ||
| } | ||
| return Promise.reject(new Error(`Unexpected GET path: ${path}`)); | ||
| }); | ||
| apiClientMock.getServerSessionClaims.mockResolvedValue({ | ||
| userId: "alice", | ||
| organizationId: "org-acme", | ||
| workspaceId: "workspace-org-acme", | ||
| }); | ||
| apiClientMock.post.mockReturnValue(pendingConfirmation); | ||
|
|
||
| container = document.createElement("div"); | ||
| document.body.appendChild(container); | ||
| root = createRoot(container); | ||
|
|
||
| await act(async () => { | ||
| root?.render(<ProjectsLayout />); | ||
| }); | ||
| await flushAsyncWork(); | ||
| await flushAsyncWork(); | ||
|
|
||
| const confirmButton = Array.from(container.querySelectorAll("button")).find( | ||
| (button) => button.textContent?.includes("νλ‘μ νΈ ν보 νμ "), | ||
| ); | ||
| expect(confirmButton).toBeDefined(); | ||
| expect(confirmButton?.disabled).toBe(false); | ||
| expect(confirmButton?.getAttribute("aria-busy")).toBe("false"); | ||
|
|
||
| await act(async () => { | ||
| confirmButton?.click(); | ||
| await Promise.resolve(); | ||
| }); | ||
|
|
||
| expect(confirmButton?.disabled).toBe(true); | ||
| expect(confirmButton?.getAttribute("aria-busy")).toBe("true"); | ||
| expect(confirmButton?.textContent).toContain("νμ μ μ₯ μ€"); | ||
| expect(apiClientMock.post).toHaveBeenCalledWith( | ||
| "/api/projects/candidates/project_candidate%3Aalpha/confirm", | ||
| {}, | ||
| ); | ||
|
|
||
| await act(async () => { | ||
| resolveConfirmation?.({ ...candidate, status_code: "confirmed" }); | ||
| await pendingConfirmation; | ||
| }); | ||
|
|
||
| expect(confirmButton?.disabled).toBe(true); | ||
| expect(confirmButton?.getAttribute("aria-busy")).toBe("false"); | ||
| expect(confirmButton?.textContent).toContain("νλ‘μ νΈ ν보 νμ λ¨"); | ||
| }); | ||
| }); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.