()
| 655 | } |
| 656 | |
| 657 | function render() { |
| 658 | for (const name of sections) { |
| 659 | const active = state.pass === name; |
| 660 | $('tab-' + name).setAttribute('aria-selected', String(active)); |
| 661 | $('tab-' + name).tabIndex = active ? 0 : -1; |
| 662 | $('panel-' + name).hidden = !active; |
| 663 | } |
| 664 | const summary = state.pass === 'summary'; |
| 665 | $('workspace').dataset.summary = String(summary); |
| 666 | $('review-toolbar').hidden = summary; |
| 667 | $('file-navigation').hidden = summary; |
| 668 | $('card-inspector').hidden = summary; |
| 669 | if (summary) return; |
| 670 | $('region-filter').parentElement.hidden = state.pass !== 'slop'; |
| 671 | $('search-title').textContent = state.pass === 'conformance' ? 'Find an intent or criterion' : 'Find a file or region'; |
| 672 | $('search').placeholder = state.pass === 'conformance' ? 'Intent title, ID, criterion or F-number' : state.pass === 'risk' ? 'Caller, callee, file or F-number' : 'Path, function, metric, audit or F-number'; |
| 673 | $('file-navigation').setAttribute('aria-label',state.pass==='conformance'?'View intents and acceptance criteria':'Files and source regions'); |
| 674 | $('file-drawer-label').textContent=state.pass==='conformance'?'Choose an intent or criterion':'Choose a file or region'; |
| 675 | renderNavigation(); |
| 676 | if (state.pass === 'slop') renderSlop(); |
| 677 | else if (state.pass === 'conformance') renderCriteria(); |
| 678 | else renderRisk(); |
| 679 | } |
| 680 | const mobileFiles = matchMedia('(max-width:700px)'); |
| 681 | function closeMobileFiles() { if (mobileFiles.matches) $('file-drawer').open = false; } |
| 682 | function resizeNavigation() { $('file-drawer').open = !mobileFiles.matches; } |
no test coverage detected