Skip to content

Commit 408fe37

Browse files
authored
Merge pull request #107 from Team-StackUp/feature/a11y-improvements
feat(ui): 접근성 개선 — 차트 레이블·체크박스 연결·포커스 복귀
2 parents b7f0508 + 01e6346 commit 408fe37

3 files changed

Lines changed: 32 additions & 4 deletions

File tree

frontend/src/features/history/ui/ScoreTrend.tsx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,21 @@ export function ScoreTrend({ stats }: { stats: UserStats }) {
1818
return (
1919
<section className="flex flex-col gap-3 rounded-2xl border border-border bg-surface-raised p-5 shadow-sm">
2020
<span className="text-caption text-fg-muted">종합 점수 추이 (최근 {points.length}회)</span>
21-
<div className="flex h-32 items-end gap-2">
21+
<div
22+
className="flex h-32 items-end gap-2"
23+
role="img"
24+
aria-label={`종합 점수 추이, 최근 ${points.length}회: ${points
25+
.map((r) => `${Math.round(Math.max(0, Math.min(100, r.overall as number)))}점`)
26+
.join(', ')}`}
27+
>
2228
{points.map((r) => {
2329
const score = Math.max(0, Math.min(100, r.overall as number))
2430
return (
25-
<div key={r.sessionId} className="flex flex-1 flex-col items-center gap-1">
31+
<div
32+
key={r.sessionId}
33+
className="flex flex-1 flex-col items-center gap-1"
34+
aria-hidden
35+
>
2636
<div className="flex w-full flex-1 items-end">
2737
<div
2838
className="w-full rounded-t bg-primary"

frontend/src/features/interview/ui/live/AnswerComposer.tsx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useEffect, useState } from 'react'
1+
import { useEffect, useRef, useState } from 'react'
22
import type { KeyboardEvent } from 'react'
33
import { TextArea } from '@/shared/ui/TextArea'
44
import { Button } from '@/shared/ui/Button'
@@ -62,6 +62,17 @@ export function AnswerComposer({
6262
void start()
6363
}
6464

65+
// 녹음/업로드 전용 바에서 입력 바로 돌아오면 키보드 사용자를 위해 답변창에 포커스를 돌려준다.
66+
const textareaRef = useRef<HTMLTextAreaElement>(null)
67+
const busy = recording || voiceUploading
68+
const prevBusy = useRef(false)
69+
useEffect(() => {
70+
if (prevBusy.current && !busy && !disabled) {
71+
textareaRef.current?.focus()
72+
}
73+
prevBusy.current = busy
74+
}, [busy, disabled])
75+
6576
const submit = () => {
6677
const trimmed = value.trim()
6778
if (!trimmed || disabled || submitLocked) return
@@ -120,6 +131,7 @@ export function AnswerComposer({
120131
<div className="flex flex-col gap-1 border-t border-border bg-surface-raised px-4 py-3">
121132
<div className="flex items-end gap-2">
122133
<TextArea
134+
ref={textareaRef}
123135
value={value}
124136
onChange={setValue}
125137
onKeyDown={onKeyDown}

frontend/src/features/interview/ui/setup/ContextDocumentPicker.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,15 @@ export function ContextDocumentPicker({
2121
{documents.map((doc) => (
2222
<label
2323
key={doc.id}
24+
htmlFor={`ctx-doc-${doc.id}`}
2425
className="flex cursor-pointer items-center gap-2 rounded-md border border-border bg-surface-raised px-3 py-2"
2526
>
26-
<input type="checkbox" checked={selected.includes(doc.id)} onChange={() => onToggle(doc.id)} />
27+
<input
28+
id={`ctx-doc-${doc.id}`}
29+
type="checkbox"
30+
checked={selected.includes(doc.id)}
31+
onChange={() => onToggle(doc.id)}
32+
/>
2733
<span className="text-button text-fg">{doc.label}</span>
2834
<span className="text-caption text-fg-muted">{doc.sourceType}</span>
2935
</label>

0 commit comments

Comments
 (0)