fix: 3+4단계 — 반응형/에러분기/a11y/Synology URL
- DocumentCard: window.innerWidth → matchMedia (반응형 정확) - documents/[id]: 로딩 상태 3분기 (loading/not_found/network) - documents/[id]: Synology URL 하드코딩 → edit_url fallback - DocumentCard: aria-label 추가 - Toast: aria-live 이미 적용 (1단계) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -35,9 +35,14 @@
|
||||
|
||||
let domainColor = $derived(DOMAIN_COLORS[doc.ai_domain] || 'var(--border)');
|
||||
|
||||
// 반응형: CSS media query matchMedia 사용
|
||||
let isDesktop = $state(typeof window !== 'undefined' ? window.matchMedia('(min-width: 1024px)').matches : true);
|
||||
if (typeof window !== 'undefined') {
|
||||
window.matchMedia('(min-width: 1024px)').addEventListener('change', (e) => isDesktop = e.matches);
|
||||
}
|
||||
|
||||
function handleClick() {
|
||||
// 모바일에서는 항상 detail 페이지로 이동
|
||||
if (window.innerWidth < 1024) {
|
||||
if (!isDesktop) {
|
||||
goto(`/documents/${doc.id}`);
|
||||
return;
|
||||
}
|
||||
@@ -51,6 +56,7 @@
|
||||
|
||||
<button
|
||||
onclick={handleClick}
|
||||
aria-label={doc.title || '문서 선택'}
|
||||
class="flex items-stretch bg-[var(--surface)] border rounded-lg hover:border-[var(--accent)] transition-colors group w-full text-left overflow-hidden
|
||||
{selected ? 'border-[var(--accent)] bg-[var(--accent)]/5' : 'border-[var(--border)]'}"
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user