Skip to content

Commit d9a50a1

Browse files
committed
개선: 데이터 센터 직관성·단순성·접근성 다듬기
- 편의성: 조회 클릭 마찰 제거 — 데이터셋 바꾸거나 ID 입력(blur/Enter) 시 자동 조회(같은 ID 유지) - 단순성: 컬럼 칩 기본 접힘(전체 N열) → 고르기로만 펼침. 14~27칩 클러터 제거 - 직관성: 미선택=전체 혼란 → 전체 N열 명시 - 접근성: 키보드 focus-visible 포커스 링 + select/input aria-label - 검증: svelte-check 0에러, 자동조회·접힘/펼침·기본로드 Playwright PASS, 콘솔에러 0
1 parent 94a629d commit d9a50a1

1 file changed

Lines changed: 64 additions & 9 deletions

File tree

‎landing/src/routes/lab/data-center/+page.svelte‎

Lines changed: 64 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,15 @@
6565
let freq = $state('');
6666
let busy = $state('');
6767
let copiedKey = $state('');
68+
let showCols = $state(false); // 컬럼 칩은 기본 접힘(전체) — [고르기]로만 펼침(단순성)
69+
70+
function changeDir(dirStr: string) {
71+
selectDir(dirStr);
72+
if (id.trim()) probe(); // 데이터셋 바꾸면 같은 ID 로 자동 조회(편의성)
73+
}
74+
function idBlur() {
75+
if (id.trim() && dir && probedKey !== `${dir.dir}/${id.trim()}`) probe();
76+
}
6877
6978
const cleanName = (s: string) => s.replace(/[\\/:*?"<>|]+/g, '_').slice(0, 80);
7079
@@ -269,7 +278,7 @@
269278
<div class="ctl">
270279
<label class="fld grow">
271280
<span class="fld-label">데이터</span>
272-
<select value={dir?.dir ?? ''} onchange={(e) => selectDir(e.currentTarget.value)}>
281+
<select value={dir?.dir ?? ''} onchange={(e) => changeDir(e.currentTarget.value)} aria-label="데이터셋 선택">
273282
{#each grouped as g (g.name)}
274283
<optgroup label={g.name}>
275284
{#each g.items as e (e.dir)}<option value={e.dir}>{e.label}</option>{/each}
@@ -279,7 +288,7 @@
279288
</label>
280289
<label class="fld">
281290
<span class="fld-label">{dir?.shardKind === 'company' ? '종목' : '항목'}</span>
282-
<input class="id-input" placeholder={dir ? ID_HINT[dir.shardKind] : ''} bind:value={id} onkeydown={(ev) => ev.key === 'Enter' && probe()} />
291+
<input class="id-input" placeholder={dir ? ID_HINT[dir.shardKind] : ''} bind:value={id} aria-label="종목·항목 ID" onkeydown={(ev) => ev.key === 'Enter' && probe()} onblur={idBlur} />
283292
</label>
284293
<button class="btn" onclick={probe} disabled={!id.trim() || probing}>{probing ? '조회 중…' : '조회'}</button>
285294
{#if dir}
@@ -290,15 +299,23 @@
290299
{#if probeErr}<p class="err">{probeErr}</p>{/if}
291300

292301
{#if probed && allCols.length}
293-
<!-- 컬럼 -->
302+
<!-- 컬럼 (기본 접힘 = 전체) -->
294303
<div class="optline">
295304
<span class="opt-label">컬럼</span>
296-
<div class="cols">
297-
{#each allCols as c (c)}
298-
<label class="chip" class:on={pickedCols.has(c)}>
299-
<input type="checkbox" checked={pickedCols.has(c)} onchange={() => toggleCol(c)} />{c}
300-
</label>
301-
{/each}
305+
<div class="colwrap">
306+
<button class="link-btn" onclick={() => (showCols = !showCols)} aria-expanded={showCols}>
307+
{cols.length === 0 || cols.length === allCols.length ? `전체 ${allCols.length}열` : `${cols.length} / ${allCols.length}열 선택`}
308+
<span class="caret">{showCols ? '▾' : '▸'}</span>
309+
</button>
310+
{#if showCols}
311+
<div class="cols">
312+
{#each allCols as c (c)}
313+
<label class="chip" class:on={pickedCols.has(c)}>
314+
<input type="checkbox" checked={pickedCols.has(c)} onchange={() => toggleCol(c)} />{c}
315+
</label>
316+
{/each}
317+
</div>
318+
{/if}
302319
</div>
303320
</div>
304321
<!-- 범위 -->
@@ -515,6 +532,29 @@
515532
gap: var(--dl-s-2);
516533
align-items: center;
517534
}
535+
.colwrap {
536+
flex: 1;
537+
display: flex;
538+
flex-direction: column;
539+
gap: var(--dl-s-2);
540+
align-items: flex-start;
541+
}
542+
.link-btn {
543+
padding: 0.1rem 0;
544+
background: none;
545+
border: 0;
546+
color: var(--dl-ink);
547+
font-size: 0.85rem;
548+
font-family: inherit;
549+
cursor: pointer;
550+
}
551+
.link-btn:hover {
552+
color: var(--dl-accent);
553+
}
554+
.caret {
555+
color: var(--dl-accent);
556+
font-size: 0.7rem;
557+
}
518558
.range {
519559
row-gap: var(--dl-s-1);
520560
}
@@ -671,4 +711,19 @@
671711
font-family: var(--dl-font-mono);
672712
font-size: 0.86em;
673713
}
714+
715+
/* 접근성 — 키보드 포커스 링 */
716+
.btn:focus-visible,
717+
.chip-ex:focus-visible,
718+
.link-btn:focus-visible,
719+
select:focus-visible,
720+
.id-input:focus-visible,
721+
.num:focus-visible,
722+
.chip:focus-within,
723+
.radio:focus-within,
724+
summary:focus-visible {
725+
outline: 2px solid var(--dl-focus);
726+
outline-offset: 2px;
727+
border-radius: var(--dl-r-sm);
728+
}
674729
</style>

0 commit comments

Comments
 (0)