()
| 9 | import { A11ySettingsOverlay } from './Settings' |
| 10 | |
| 11 | export function Shell() { |
| 12 | const styles = createStyles() |
| 13 | |
| 14 | // ally context |
| 15 | const { filteredIssues, allyResult, config, setConfig, triggerAllyScan } = |
| 16 | createAllyContext() |
| 17 | |
| 18 | // ui state |
| 19 | const selectedIssueSignal = createSignal<string>('') |
| 20 | const [displaySettings, setDisplaySettings] = createSignal<boolean>(false) |
| 21 | |
| 22 | const handleExport = (format: 'json' | 'csv') => { |
| 23 | if (allyResult.audit) return |
| 24 | // Keep export logic in runtime via event -> overlay? export is still a direct helper. |
| 25 | // We keep this import local to avoid pulling export code into the runtime module. |
| 26 | |
| 27 | void import('../utils/export-audit.uitls').then((m) => |
| 28 | m.exportAuditResults(allyResult.audit!, { format }), |
| 29 | ) |
| 30 | } |
| 31 | |
| 32 | const showOverlayState = createMemo(() => config.showOverlays) |
| 33 | |
| 34 | return ( |
| 35 | <MainPanel class={styles().root} withPadding={false}> |
| 36 | <Header class={styles().header}> |
| 37 | <div class={styles().headerTitleRow}> |
| 38 | <h2 class={styles().headerTitle}>Accessibility Audit</h2> |
| 39 | |
| 40 | <Show when={allyResult.state === 'done' && filteredIssues()}> |
| 41 | <span class={styles().headerSub}> |
| 42 | {`${filteredIssues().length} issue${filteredIssues().length !== 1 ? 's' : ''}`} |
| 43 | </span> |
| 44 | </Show> |
| 45 | </div> |
| 46 | |
| 47 | <div class={styles().headerActions}> |
| 48 | <Button |
| 49 | variant="primary" |
| 50 | onClick={triggerAllyScan} |
| 51 | disabled={allyResult.state === 'scanning'} |
| 52 | > |
| 53 | {allyResult.state === 'scanning' ? 'Scanning...' : 'Run Audit'} |
| 54 | </Button> |
| 55 | |
| 56 | <Show |
| 57 | when={ |
| 58 | allyResult.state === 'done' && |
| 59 | allyResult.audit && |
| 60 | allyResult.audit.issues.length > 0 |
| 61 | } |
| 62 | > |
| 63 | <div class={styles().buttonRow}> |
| 64 | <Button |
| 65 | variant="secondary" |
| 66 | outline |
| 67 | onClick={() => handleExport('json')} |
| 68 | > |
nothing calls this directly
no test coverage detected