Console a11y: the sidebar, row menus and dialogs work from the keyboard

A pass against the Web Interface Guidelines. The console could not be driven from the
keyboard at all:

- Every sidebar entry was a <div onclick>, which takes no focus, so a keyboard user could
  not reach a single screen. They are links now (href="#/<id>", aria-current on the
  current one; go() still closes the drawer), and a group heading is a button with
  aria-expanded. Same look: the links keep .nav-item's colour and no underline.
- A dialog is role=dialog + aria-modal, named by its title, starts on its first field,
  makes the page behind it inert (aria-modal alone does not stop Tab) and gives focus back
  to whatever opened it. The command palette does the same, and its input is labelled.
- The ⋯ row menu button is named ("Actions"/"Akcje"); opening it moves focus to its first
  item, Escape or Tab-ing out closes it, and focus returns to the button — so the Edit
  dialog an item opens hands focus back there as well.
- Icon-only buttons (sidebar toggle, request log, search, theme, the log's close) carry an
  aria-label; the EN/PL toggle's label is its localized tooltip.
- The sign-in error is role=alert; a skip link reaches the main content (tabindex=-1);
  prefers-reduced-motion switches transitions off.

New strings have I18N.pl entries (Skip to content, Close, Search). Checked in the demo
build (scripts/build_demo.py) with real key presses; test_smoke.py's frontend tripwires
re-checked by hand, and node --check on the inline script passes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Piotr Chojnacki
2026-11-21 21:52:01 +01:00
co-authored by Claude Opus 5.5
parent ea1e8ea26c
commit f304faf06f
+53 -21
View File
@@ -200,14 +200,14 @@ table.dt .sub{display:block;color:var(--text-muted);font-size:12.5px;font-weight
.brand .nm{font:600 15px/1.1 var(--font-sans);letter-spacing:-0.02em;color:var(--text-heading);}
.brand .nm small{display:block;font:400 11px/1.2 var(--font-sans);color:var(--text-muted);letter-spacing:.02em;}
.nav-group{padding:6px 12px 2px;}
.nav-group .gh{display:flex;align-items:center;gap:8px;padding:14px 12px 8px;font:600 10px/1 var(--font-sans);text-transform:uppercase;letter-spacing:.12em;color:var(--text-muted);cursor:pointer;user-select:none;}
.nav-group .gh{display:flex;align-items:center;gap:8px;width:100%;padding:14px 12px 8px;border:0;background:none;text-align:left;font:600 10px/1 var(--font-sans);text-transform:uppercase;letter-spacing:.12em;color:var(--text-muted);cursor:pointer;user-select:none;}
.nav-group .gh::before{content:"";width:6px;height:6px;border-radius:1px;background:var(--text-primary);flex:none;} /* legalwork's section mark */
.nav-group .gh svg{width:14px;height:14px;margin-left:auto;transition:transform .15s;}
.nav-group.collapsed .gh svg{transform:rotate(-90deg);}
.nav-group.collapsed .nav-item{display:none;}
.nav-item{display:flex;align-items:center;gap:12px;min-height:38px;padding:0 12px;border-radius:var(--at-radius-lg);font:400 14px/1 var(--font-sans);color:var(--text-primary);cursor:pointer;position:relative;margin:2px 0;border:1px solid transparent;}
.nav-item{display:flex;align-items:center;gap:12px;min-height:38px;padding:0 12px;border-radius:var(--at-radius-lg);font:400 14px/1 var(--font-sans);color:var(--text-primary);cursor:pointer;position:relative;margin:2px 0;border:1px solid transparent;text-decoration:none;}
.nav-item svg{width:18px;height:18px;flex:none;color:var(--text-secondary);position:relative;top:1px;} /* nudge 1px down: align-items:center centers boxes, but the line-height:1 text sits optically lower, so icons read as too high */
.nav-item:hover{background:var(--at-hover);}
.nav-item:hover{background:var(--at-hover);text-decoration:none;}
.nav-item.active{background:var(--at-active);color:var(--text-primary);font-weight:500;border-color:transparent;}
.nav-item.active svg{color:var(--text-primary);}
/* nav search + collapse-to-rail (Open Mercato AppShell behaviour) */
@@ -271,6 +271,12 @@ table.dt .sub{display:block;color:var(--text-muted);font-size:12.5px;font-weight
#toast{position:fixed;bottom:20px;left:50%;transform:translateX(-50%);z-index:90;}
.toast{display:flex;align-items:center;gap:8px;background:var(--primary);color:var(--primary-fg);padding:12px 16px;border-radius:var(--at-radius-2xl);box-shadow:var(--shadow-menu);font-size:13px;}
/* ── keyboard: skip link, focus target, reduced motion ── */
.skip{position:fixed;left:12px;top:-60px;z-index:100;padding:8px 14px;border-radius:8px;border:1px solid var(--border);background:var(--surface);color:var(--text-primary);font-size:14px;}
.skip:focus{top:12px;text-decoration:none;}
#content:focus{outline:none;} /* the skip link lands here; the page itself needs no ring */
@media(prefers-reduced-motion:reduce){*,*::before,*::after{transition:none!important;animation:none!important;}}
.nav-scrim{display:none;}
@media(max-width:880px){
.sidebar{position:fixed;left:0;top:0;z-index:50;transform:translateX(-100%);transition:transform .2s ease;will-change:transform;}
@@ -297,7 +303,7 @@ table.dt .sub{display:block;color:var(--text-muted);font-size:12.5px;font-weight
which runs inside restore()). Nothing is lost by waiting: without the script the form cannot
submit anyway. -->
<div id="login" class="hidden">
<button class="iconbtn js-theme" id="btnThemeLogin" title="Theme" style="position:fixed;top:16px;right:16px;background:var(--surface);border:1px solid var(--border-input);box-shadow:var(--shadow-card);color:var(--text-secondary);"></button>
<button class="iconbtn js-theme" id="btnThemeLogin" title="Theme" aria-label="Theme" style="position:fixed;top:16px;right:16px;background:var(--surface);border:1px solid var(--border-input);box-shadow:var(--shadow-card);color:var(--text-secondary);"></button>
<form class="login-card" id="loginForm">
<div class="lhead">
<div class="logo"><svg viewBox="0 0 24 24" width="100%" height="100%" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><path fill="#f76707" d="M19 2h-14a3 3 0 0 0 -3 3v14a3 3 0 0 0 3 3h14a3 3 0 0 0 3 -3v-14a3 3 0 0 0 -3 -3z"/><g fill="none" stroke="#fff4e6" stroke-width="2.6" stroke-linecap="round" stroke-linejoin="round" transform="translate(12 12) scale(0.8) translate(-12 -12)"><path d="M16 17a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"/><path d="M6 7a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"/><path d="M6 18l12 -12"/></g></svg></div>
@@ -308,7 +314,7 @@ table.dt .sub{display:block;color:var(--text-muted);font-size:12.5px;font-weight
<label class="field">Email <input id="email" type="email" value="admin@example.com" autocomplete="username" /></label>
<label class="field">Password <input id="password" type="password" placeholder="bootstrap password" autocomplete="current-password" /></label>
<label class="checkbox" style="margin:4px 0 16px"><input type="checkbox" id="remember" /> Remember me</label>
<div id="loginErr" class="banner err hidden" style="margin-bottom:14px"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0"/> <path d="M12 8v4"/> <path d="M12 16h.01"/></svg><span></span></div>
<div id="loginErr" class="banner err hidden" role="alert" style="margin-bottom:14px"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0"/> <path d="M12 8v4"/> <path d="M12 16h.01"/></svg><span></span></div>
<button class="btn primary" id="btnLogin" type="submit">Sign in</button>
<div class="login-foot"><a href="#" onclick="return false">Forgot password?</a></div>
</form>
@@ -347,6 +353,7 @@ table.dt .sub{display:block;color:var(--text-muted);font-size:12.5px;font-weight
<!-- ───────── App shell ───────── -->
<div id="app" class="hidden">
<a class="skip" href="#content" onclick="event.preventDefault();document.getElementById('content').focus()">Skip to content</a>
<aside class="sidebar" id="sidebar">
<div class="brand"><div class="logo"><svg viewBox="0 0 24 24" width="100%" height="100%" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><path fill="#f76707" d="M19 2h-14a3 3 0 0 0 -3 3v14a3 3 0 0 0 3 3h14a3 3 0 0 0 3 -3v-14a3 3 0 0 0 -3 -3z"/><g fill="none" stroke="#fff4e6" stroke-width="2.6" stroke-linecap="round" stroke-linejoin="round" transform="translate(12 12) scale(0.8) translate(-12 -12)"><path d="M16 17a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"/><path d="M6 7a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"/><path d="M6 18l12 -12"/></g></svg></div><div class="nm">Counsel Scorecard<small>External-counsel scoring</small></div></div>
<div class="navsearch"><input id="navSearch" placeholder="Search…" aria-label="Search navigation" autocomplete="off"></div>
@@ -355,25 +362,25 @@ table.dt .sub{display:block;color:var(--text-muted);font-size:12.5px;font-weight
<div id="navScrim" class="nav-scrim" aria-hidden="true"></div>
<div class="main">
<header class="topbar">
<button class="iconbtn" id="navToggle" title="Toggle sidebar"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 6a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2l0 -12"/> <path d="M9 4l0 16"/></svg></button>
<button class="iconbtn" id="navToggle" title="Toggle sidebar" aria-label="Toggle sidebar"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 6a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2l0 -12"/> <path d="M9 4l0 16"/></svg></button>
<div class="crumb" id="crumb"><span>Dashboard</span></div>
<div class="spacer"></div>
<button class="iconbtn" id="btnLog" title="Request log"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 6l11 0"/> <path d="M9 12l11 0"/> <path d="M9 18l11 0"/> <path d="M5 6l0 .01"/> <path d="M5 12l0 .01"/> <path d="M5 18l0 .01"/></svg></button>
<button class="iconbtn" id="btnPalette" title="Search (Ctrl/⌘K)"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 10a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"/> <path d="M21 21l-6 -6"/></svg></button>
<button class="iconbtn js-theme" id="btnTheme" title="Theme"></button>
<button class="iconbtn" id="btnLog" title="Request log" aria-label="Request log"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 6l11 0"/> <path d="M9 12l11 0"/> <path d="M9 18l11 0"/> <path d="M5 6l0 .01"/> <path d="M5 12l0 .01"/> <path d="M5 18l0 .01"/></svg></button>
<button class="iconbtn" id="btnPalette" title="Search (Ctrl/⌘K)" aria-label="Search (Ctrl/⌘K)"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 10a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"/> <path d="M21 21l-6 -6"/></svg></button>
<button class="iconbtn js-theme" id="btnTheme" title="Theme" aria-label="Theme"></button>
<div class="org"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 21l18 0"/> <path d="M9 8l1 0"/> <path d="M9 12l1 0"/> <path d="M9 16l1 0"/> <path d="M14 8l1 0"/> <path d="M14 12l1 0"/> <path d="M14 16l1 0"/> <path d="M5 21v-16a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v16"/></svg> Counsel Scorecard</div>
<div class="usermenu" id="userMenu">
<span class="avatar" id="userAvatar">?</span>
<span class="muted" id="userEmail" style="font-size:13px"></span>
</div>
</header>
<main class="content" id="content"></main>
<main class="content" id="content" tabindex="-1"></main>
</div>
</div>
<!-- request log slide-over -->
<div id="logPanel" class="slideover hidden">
<div class="sh">Request log <button class="iconbtn" id="logClose"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6l-12 12"/> <path d="M6 6l12 12"/></svg></button></div>
<div class="sh">Request log <button class="iconbtn" id="logClose" title="Close" aria-label="Close"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6l-12 12"/> <path d="M6 6l12 12"/></svg></button></div>
<div class="sb" id="log"></div>
</div>
@@ -487,7 +494,7 @@ function dataTable({title, subtitle, createLabel, createHref, columns, rows, row
const ths = columns.map(c=>`<th class="${c.cls||''}">${esc(c.h)}</th>`).join('') + (rowMenu?'<th class="actions">Actions</th>':'');
const trs = rows.map((r,i)=>{
const tds = columns.map(c=>`<td class="${c.cls||''}">${c.raw?c.f(r):esc(c.f(r)??'')}</td>`).join('');
const menu = rowMenu?`<td class="actions"><button class="iconbtn" onclick='rowMenu(event,${i})'>${svg(ICN.dots)}</button></td>`:'';
const menu = rowMenu?`<td class="actions"><button class="iconbtn" aria-label="Actions" aria-haspopup="true" onclick='rowMenu(event,${i})'>${svg(ICN.dots)}</button></td>`:'';
return `<tr>${tds}${menu}</tr>`;
}).join('');
body = `<div class="dt-scroll"><table class="dt"><thead><tr>${ths}</tr></thead><tbody>${trs}</tbody></table></div>
@@ -599,8 +606,9 @@ function renderNav(){
let items=g.items.filter(it=>!it.admin||isModerator());
if(q) items=items.filter(it=>it.label.toLowerCase().includes(q) || _tr(it.label).toLowerCase().includes(q)); // match English OR the displayed (localized) label, so nav search works in PL too
if(!items.length) return '';
return `<div class="nav-group" data-g="${esc(g.group)}"><div class="gh" onclick="this.parentNode.classList.toggle('collapsed')"><span>${esc(g.group)}</span>${svg('<path d="M6 9l6 6l6 -6"/>',14)}</div>
${items.map(it=>`<div class="nav-item ${it.id===cur?'active':''}" title="${esc(it.label)}" onclick="go('${it.id}')">${svg(it.icon)}<span>${esc(it.label)}</span></div>`).join('')}</div>`;
// Links and a button, not <div onclick>: a div takes no focus, so the whole menu was mouse-only.
return `<div class="nav-group" data-g="${esc(g.group)}"><button type="button" class="gh" aria-expanded="true" onclick="navFold(this)"><span>${esc(g.group)}</span>${svg('<path d="M6 9l6 6l6 -6"/>',14)}</button>
${items.map(it=>`<a class="nav-item ${it.id===cur?'active':''}" href="#/${esc(it.id)}" title="${esc(it.label)}"${it.id===cur?' aria-current="page"':''} onclick="go('${it.id}')">${svg(it.icon)}<span>${esc(it.label)}</span></a>`).join('')}</div>`;
}).join('');
}
function setCrumb(parts){ $('crumb').innerHTML = parts.map((p,i)=> i? `<span class="sep">/</span>${i===parts.length-1?`<b>${esc(p)}</b>`:esc(p)}` : esc(p)).join(' '); fitOrg(); }
@@ -614,6 +622,8 @@ function fitOrg(){ const o=document.querySelector('.topbar .org'); if(!o) return
_orgFitT=setTimeout(()=>{ if(o.scrollWidth > o.clientWidth + 1) o.classList.add('org-hide'); }, 80); } // is unreliable). .org clips (min-width:0) rather than wraps, so hide it when its text is clipped.
function go(id){ location.hash = '#/'+id; if(window.innerWidth<=880) $('sidebar').classList.remove('open'); }
window.go = go;
function navFold(b){ const g=b.parentNode; g.classList.toggle('collapsed'); b.setAttribute('aria-expanded',String(!g.classList.contains('collapsed'))); }
window.navFold = navFold;
window.addEventListener('hashchange', router);
// ═══════════════ views ═══════════════
@@ -1117,12 +1127,22 @@ async function showHistory(){ if(!lastResponseId) return; const box=$('respHisto
window.submitResponse=submitResponse; window.showHistory=showHistory;
// ═══════════════ edit dialogs ═══════════════
// A dialog keeps keyboard focus inside itself (the page behind is inert while it is open — aria-modal
// alone does not stop Tab) and hands focus back to whatever opened it. The opener is taken BEFORE the
// page goes inert, which takes focus away from it; a dialog opened from another keeps the first opener.
let _modalOpener=null;
function rememberOpener(){ const a=document.activeElement; if(!_modalOpener&&a&&a!==document.body&&!$('modalRoot').contains(a)) _modalOpener=a; }
function modal(title,inner,onSave,saveLabel){
$('modalRoot').innerHTML=`<div class="overlay" onclick="if(event.target===this)closeModal()"><div class="card" style="width:440px;max-width:92vw"><div class="card-head"><h2>${esc(title)}</h2></div>
rememberOpener();
$('modalRoot').innerHTML=`<div class="overlay" onclick="if(event.target===this)closeModal()"><div class="card" role="dialog" aria-modal="true" aria-labelledby="modalTitle" style="width:440px;max-width:92vw"><div class="card-head"><h2 id="modalTitle">${esc(title)}</h2></div>
<div class="card-body">${inner}</div><div class="form-foot">${btn('Cancel',{cls:'ghost',onclick:'closeModal()'})}${btn(saveLabel||'Save',{cls:'primary',attrs:'id="modalSave"'})}</div></div></div>`;
$('modalSave').onclick=onSave;
$('app').inert=true;
const first=$('modalRoot').querySelector('input:not([type=hidden]),select,textarea')||$('modalRoot').querySelector('.card button');
if(first) first.focus();
}
function closeModal(){ $('modalRoot').innerHTML=''; } window.closeModal=closeModal;
function closeModal(){ const was=!!$('modalRoot').innerHTML; $('modalRoot').innerHTML=''; $('app').inert=false;
if(was&&_modalOpener&&document.contains(_modalOpener)) _modalOpener.focus(); _modalOpener=null; } window.closeModal=closeModal;
function editFirm(f){ modal('Edit firm',`${field('Name',`<input id="ef_name" value="${esc(f.name)}">`)}${field('Status',`<select id="ef_status">${optionTags(enumVals('firm_status'),f.status)}</select>`,{})}`,
async()=>{ try{ await api('PATCH','/firms/'+f.id,{name:$('ef_name').value.trim(),status:$('ef_status').value}); cache.firms=await api('GET','/firms'); closeModal(); toast('Saved'); router(); }catch(e){ toast(e.message||'Failed'); } }); }
function editMatter(m){ modal('Edit matter',`${field('Status',`<select id="em_status">${optionTags(enumVals('matter_status')||['open','in_progress','closed','cancelled'],m.status)}</select>`)}`,
@@ -1133,20 +1153,31 @@ async function deactivateUser(u){ try{ await api('POST','/users/'+u.id+'/deactiv
// ═══════════════ overflow menu ═══════════════
function openMenu(ev,items){ ev.stopPropagation(); document.querySelectorAll('.menu').forEach(m=>m.remove());
const trigger=ev.currentTarget;
const m=document.createElement('div'); m.className='menu';
m.innerHTML=items.map((it,i)=>`<button class="${it.danger?'danger':''}" data-i="${i}">${esc(it.label)}</button>`).join('');
document.body.appendChild(m); const r=ev.currentTarget.getBoundingClientRect();
document.body.appendChild(m); const r=trigger.getBoundingClientRect();
m.style.top=(r.bottom+4)+'px'; m.style.left=(r.right-m.offsetWidth)+'px';
m.querySelectorAll('button').forEach(b=>b.onclick=()=>{ m.remove(); items[+b.dataset.i].fn(); });
// The keyboard's half: focus moves into the menu, Escape or Tab-ing out closes it, and focus goes
// back to the ⋯ button — so a dialog an item opens hands focus back there too.
let closed=false;
const close=(back)=>{ if(closed) return; closed=true; m.remove(); if(back&&document.contains(trigger)) trigger.focus(); };
m.querySelectorAll('button').forEach(b=>b.onclick=()=>{ close(true); items[+b.dataset.i].fn(); });
m.addEventListener('keydown',(e)=>{ if(e.key==='Escape'){ e.stopPropagation(); close(true); } });
// Deferred: Chrome fires focusout from inside remove() itself, and removing the menu there makes
// the outer remove() throw NotFoundError before focus is handed back.
m.addEventListener('focusout',(e)=>{ if(!m.contains(e.relatedTarget)) setTimeout(()=>close(false),0); });
const firstItem=m.querySelector('button'); if(firstItem) firstItem.focus();
setTimeout(()=>document.addEventListener('click',function h(){ m.remove(); document.removeEventListener('click',h); }),0);
}
window.openMenu=openMenu; window.editFirm=editFirm; window.editMatter=editMatter; window.editUser=editUser; window.deactivateUser=deactivateUser;
const shortId=(id)=>id?String(id).slice(0,8):''; window.shortId=shortId;
// ═══════════════ command palette (global search) ═══════════════
function openPalette(){ $('modalRoot').innerHTML=`<div class="overlay" onclick="if(event.target===this)closeModal()"><div class="palette">
<div class="pinp">${svg('<path d="M3 10a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"/> <path d="M21 21l-6 -6"/>',18)}<input id="pq" placeholder="Search firms, matters, questions, responses…" autocomplete="off"></div>
function openPalette(){ rememberOpener(); $('modalRoot').innerHTML=`<div class="overlay" onclick="if(event.target===this)closeModal()"><div class="palette" role="dialog" aria-modal="true" aria-label="Search">
<div class="pinp">${svg('<path d="M3 10a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"/> <path d="M21 21l-6 -6"/>',18)}<input id="pq" placeholder="Search firms, matters, questions, responses…" aria-label="Search" autocomplete="off"></div>
<div class="presults" id="presults"><div class="empty">Type to search.</div></div></div></div>`;
$('app').inert=true;
const inp=$('pq'); inp.focus(); let t;
inp.oninput=()=>{ clearTimeout(t); t=setTimeout(()=>paletteSearch(inp.value),220); };
}
@@ -1219,6 +1250,7 @@ const I18N = { pl: {
// login
'Sign in':'Zaloguj się','You are signed in, but you do not have access to Counsel.':'Masz zalogowane konto, ale nie masz dostępu do Counsel.','Ask an administrator for access.':'Poproś administratora o dostęp.','Go to the platform':'Przejdź do platformy','Sign in with your workspace credentials':'Zaloguj się danymi logowania do przestrzeni roboczej','Sign in at the hub':'Zaloguj się w centrum','One account for the whole platform':'Jedno konto dla całej platformy','Sign in once at the hub and you arrive here already signed in. There is no separate password for Counsel.':'Zaloguj się raz w centrum, a tutaj trafisz już zalogowany. Counsel nie ma osobnego hasła.',"Accounts come from the hub; the role is Counsel's own.":'Konta pochodzą z centrum; rola jest własna dla Counsel.','Access your workspace':'Wejdź do swojej przestrzeni roboczej','External-counsel scoring':'Ocena kancelarii zewnętrznych','Email':'E-mail','Password':'Hasło','bootstrap password':'hasło robocze','Remember me':'Zapamiętaj mnie','Forgot password?':'Nie pamiętasz hasła?',
// topbar / search
'Skip to content':'Przejdź do treści','Close':'Zamknij','Search':'Szukaj',
'Toggle sidebar':'Przełącz panel boczny','Request log':'Dziennik żądań','Search (Ctrl/⌘K)':'Szukaj (Ctrl/⌘K)','Theme':'Motyw','Search…':'Szukaj…','Search navigation':'Przeszukaj nawigację','Search firms, matters, questions, responses…':'Szukaj kancelarii, spraw, pytań, odpowiedzi…',
// dashboard
'Overview of firms, matters, and review activity.':'Przegląd kancelarii, spraw i aktywności przeglądów.','External counsel on record':'Zarejestrowane kancelarie zewnętrzne','Engagements being evaluated':'Oceniane sprawy','Open review cycles':'Otwarte cykle przeglądu','Accepting evaluations':'Przyjmują oceny','Recent matters':'Ostatnie sprawy','Latest engagements':'Najnowsze sprawy','Status by cycle':'Status według cyklu','Quick actions':'Szybkie akcje','Common tasks':'Częste zadania','New firm':'Nowa kancelaria','New matter':'Nowa sprawa','Evaluate':'Oceń','No matters':'Brak spraw','No cycles':'Brak cykli',
@@ -1294,7 +1326,7 @@ function _locAttrs(el){ if(el.closest('[data-no-i18n]')) return; let st=_attrEN.
function localize(root){ if(!root) return; if(root.nodeType===3){ _locText(root); return; } if(root.nodeType!==1) return;
const w=document.createTreeWalker(root,NodeFilter.SHOW_TEXT,null); const ns=[]; let n; while(n=w.nextNode()) ns.push(n); for(const t of ns) _locText(t);
_locAttrs(root); root.querySelectorAll('['+I18N_ATTRS.join('],[')+']').forEach(_locAttrs); }
function updateLangButtons(){ const tip=LANG==='pl'?'Język: polski — kliknij, aby zmienić':'Language: English — click to switch'; ['btnLang','btnLangLogin'].forEach(id=>{ const el=$(id); if(el){ el.textContent=LANG.toUpperCase(); el.title=tip; } }); }
function updateLangButtons(){ const tip=LANG==='pl'?'Język: polski — kliknij, aby zmienić':'Language: English — click to switch'; ['btnLang','btnLangLogin'].forEach(id=>{ const el=$(id); if(el){ el.textContent=LANG.toUpperCase(); el.title=tip; el.setAttribute('aria-label',tip); } }); }
function setLang(l){ LANG=(l==='pl')?'pl':'en'; try{localStorage.setItem('cs_lang',LANG);}catch{} document.documentElement.lang=LANG; localize(document.body); updateLangButtons(); }
/* True when a field in `root` holds something the user typed or picked, which a re-render would lose. */
function _hasEditedField(root){ return !!root && [...root.querySelectorAll('input,textarea,select')].some(el=>{