|
71 | 71 | <p class="text-muted-color text-sm mb-4">{{ 'artemisApp.exerciseVariantGeneration.wizard.select.intro' | artemisTranslate }}</p> |
72 | 72 |
|
73 | 73 | <div class="option-cards mb-6"> |
74 | | - <div class="option-card" [class.option-card--selected]="changeDifficulty()" (click)="toggleDifficulty()" data-testid="variant-option-difficulty"> |
| 74 | + <button |
| 75 | + type="button" |
| 76 | + class="option-card" |
| 77 | + [class.option-card--selected]="changeDifficulty()" |
| 78 | + [attr.aria-pressed]="changeDifficulty()" |
| 79 | + (click)="toggleDifficulty()" |
| 80 | + data-testid="variant-option-difficulty" |
| 81 | + > |
75 | 82 | @if (changeDifficulty()) { |
76 | 83 | <span class="option-card__check"><fa-icon [icon]="faCheck" /></span> |
77 | 84 | } |
78 | | - <div class="option-card__icon"><fa-icon [icon]="faGaugeHigh" /></div> |
79 | | - <h6>{{ 'artemisApp.exerciseVariantGeneration.wizard.select.difficulty' | artemisTranslate }}</h6> |
80 | | - <p>{{ 'artemisApp.exerciseVariantGeneration.wizard.select.difficultyHint' | artemisTranslate }}</p> |
| 85 | + <span class="option-card__icon"><fa-icon [icon]="faGaugeHigh" /></span> |
| 86 | + <span class="option-card__title">{{ 'artemisApp.exerciseVariantGeneration.wizard.select.difficulty' | artemisTranslate }}</span> |
| 87 | + <span class="option-card__hint">{{ 'artemisApp.exerciseVariantGeneration.wizard.select.difficultyHint' | artemisTranslate }}</span> |
81 | 88 | <span class="option-card__cta"> |
82 | 89 | @if (changeDifficulty()) { |
83 | 90 | {{ 'artemisApp.exerciseVariantGeneration.wizard.selected' | artemisTranslate }} |
84 | 91 | } |
85 | 92 | </span> |
86 | | - </div> |
87 | | - <div class="option-card" [class.option-card--selected]="changeDomain()" (click)="toggleDomain()"> |
| 93 | + </button> |
| 94 | + <button type="button" class="option-card" [class.option-card--selected]="changeDomain()" [attr.aria-pressed]="changeDomain()" (click)="toggleDomain()"> |
88 | 95 | @if (changeDomain()) { |
89 | 96 | <span class="option-card__check"><fa-icon [icon]="faCheck" /></span> |
90 | 97 | } |
91 | | - <div class="option-card__icon"><fa-icon [icon]="faEarthAmericas" /></div> |
92 | | - <h6>{{ 'artemisApp.exerciseVariantGeneration.wizard.select.domain' | artemisTranslate }}</h6> |
93 | | - <p>{{ 'artemisApp.exerciseVariantGeneration.wizard.select.domainHint' | artemisTranslate }}</p> |
| 98 | + <span class="option-card__icon"><fa-icon [icon]="faEarthAmericas" /></span> |
| 99 | + <span class="option-card__title">{{ 'artemisApp.exerciseVariantGeneration.wizard.select.domain' | artemisTranslate }}</span> |
| 100 | + <span class="option-card__hint">{{ 'artemisApp.exerciseVariantGeneration.wizard.select.domainHint' | artemisTranslate }}</span> |
94 | 101 | <span class="option-card__cta"> |
95 | 102 | @if (changeDomain()) { |
96 | 103 | {{ 'artemisApp.exerciseVariantGeneration.wizard.selected' | artemisTranslate }} |
97 | 104 | } |
98 | 105 | </span> |
99 | | - </div> |
100 | | - <div class="option-card" [class.option-card--selected]="changeNarrative()" (click)="toggleNarrative()" data-testid="variant-option-narrative"> |
| 106 | + </button> |
| 107 | + <button |
| 108 | + type="button" |
| 109 | + class="option-card" |
| 110 | + [class.option-card--selected]="changeNarrative()" |
| 111 | + [attr.aria-pressed]="changeNarrative()" |
| 112 | + (click)="toggleNarrative()" |
| 113 | + data-testid="variant-option-narrative" |
| 114 | + > |
101 | 115 | @if (changeNarrative()) { |
102 | 116 | <span class="option-card__check"><fa-icon [icon]="faCheck" /></span> |
103 | 117 | } |
104 | | - <div class="option-card__icon"><fa-icon [icon]="faBookOpen" /></div> |
105 | | - <h6>{{ 'artemisApp.exerciseVariantGeneration.wizard.select.narrative' | artemisTranslate }}</h6> |
106 | | - <p>{{ 'artemisApp.exerciseVariantGeneration.wizard.select.narrativeHint' | artemisTranslate }}</p> |
| 118 | + <span class="option-card__icon"><fa-icon [icon]="faBookOpen" /></span> |
| 119 | + <span class="option-card__title">{{ 'artemisApp.exerciseVariantGeneration.wizard.select.narrative' | artemisTranslate }}</span> |
| 120 | + <span class="option-card__hint">{{ 'artemisApp.exerciseVariantGeneration.wizard.select.narrativeHint' | artemisTranslate }}</span> |
107 | 121 | <span class="option-card__cta"> |
108 | 122 | @if (changeNarrative()) { |
109 | 123 | {{ 'artemisApp.exerciseVariantGeneration.wizard.selected' | artemisTranslate }} |
110 | 124 | } |
111 | 125 | </span> |
112 | | - </div> |
113 | | - <div class="option-card" [class.option-card--selected]="changeCustom()" (click)="toggleCustom()"> |
| 126 | + </button> |
| 127 | + <button type="button" class="option-card" [class.option-card--selected]="changeCustom()" [attr.aria-pressed]="changeCustom()" (click)="toggleCustom()"> |
114 | 128 | @if (changeCustom()) { |
115 | 129 | <span class="option-card__check"><fa-icon [icon]="faCheck" /></span> |
116 | 130 | } |
117 | | - <div class="option-card__icon"><fa-icon [icon]="faPenToSquare" /></div> |
118 | | - <h6>{{ 'artemisApp.exerciseVariantGeneration.wizard.select.custom' | artemisTranslate }}</h6> |
119 | | - <p>{{ 'artemisApp.exerciseVariantGeneration.wizard.select.customHint' | artemisTranslate }}</p> |
| 131 | + <span class="option-card__icon"><fa-icon [icon]="faPenToSquare" /></span> |
| 132 | + <span class="option-card__title">{{ 'artemisApp.exerciseVariantGeneration.wizard.select.custom' | artemisTranslate }}</span> |
| 133 | + <span class="option-card__hint">{{ 'artemisApp.exerciseVariantGeneration.wizard.select.customHint' | artemisTranslate }}</span> |
120 | 134 | <span class="option-card__cta"> |
121 | 135 | @if (changeCustom()) { |
122 | 136 | {{ 'artemisApp.exerciseVariantGeneration.wizard.selected' | artemisTranslate }} |
123 | 137 | } |
124 | 138 | </span> |
125 | | - </div> |
| 139 | + </button> |
126 | 140 | </div> |
127 | 141 |
|
128 | 142 | <div class="flex justify-end mt-8"> |
@@ -397,10 +411,16 @@ <h6 class="font-semibold mb-6">{{ 'artemisApp.exerciseVariantGeneration.wizard.g |
397 | 411 | field, oldest first (latest at the bottom) — earlier attempt errors stay |
398 | 412 | inspectable after a later attempt succeeded. --> |
399 | 413 | @if (hasAnyDetail(outputs)) { |
400 | | - <a class="block cursor-pointer text-sm no-underline" (click)="toggleStepOutput(phase)" data-testid="variant-wizard-step-output-toggle"> |
| 414 | + <button |
| 415 | + type="button" |
| 416 | + class="block w-full cursor-pointer border-0 bg-transparent p-0 text-start no-underline text-sm" |
| 417 | + [attr.aria-expanded]="!!expandedPhases()[phase]" |
| 418 | + (click)="toggleStepOutput(phase)" |
| 419 | + data-testid="variant-wizard-step-output-toggle" |
| 420 | + > |
401 | 421 | <fa-icon [icon]="expandedPhases()[phase] ? faChevronDown : faChevronRight" class="mr-1" /> |
402 | 422 | {{ outputs[outputs.length - 1].summary }} |
403 | | - </a> |
| 423 | + </button> |
404 | 424 | @if (expandedPhases()[phase]) { |
405 | 425 | @for (stepOutput of outputs; track $index) { |
406 | 426 | @if (stepOutput.detail) { |
@@ -496,10 +516,16 @@ <h6 class="font-semibold mb-6">{{ 'artemisApp.exerciseVariantGeneration.wizard.g |
496 | 516 | <div class="min-w-0"> |
497 | 517 | <div class="font-semibold">{{ 'artemisApp.exerciseVariantGeneration.wizard.draftWithWarnings' | artemisTranslate }}</div> |
498 | 518 | @if (warnings().length > 0) { |
499 | | - <a class="block cursor-pointer text-sm no-underline" (click)="toggleWarnings()" data-testid="variant-wizard-warnings-toggle"> |
| 519 | + <button |
| 520 | + type="button" |
| 521 | + class="block w-full cursor-pointer border-0 bg-transparent p-0 text-start no-underline text-sm" |
| 522 | + [attr.aria-expanded]="warningsExpanded()" |
| 523 | + (click)="toggleWarnings()" |
| 524 | + data-testid="variant-wizard-warnings-toggle" |
| 525 | + > |
500 | 526 | <fa-icon [icon]="warningsExpanded() ? faChevronDown : faChevronRight" class="mr-1" /> |
501 | 527 | {{ 'artemisApp.exerciseVariantGeneration.wizard.warningDetails' | artemisTranslate: { count: warnings().length } }} |
502 | | - </a> |
| 528 | + </button> |
503 | 529 | @if (warningsExpanded()) { |
504 | 530 | @for (warning of warnings(); track warning) { |
505 | 531 | <pre class="step-output-detail" data-testid="variant-wizard-warning-detail">{{ warning }}</pre> |
@@ -568,10 +594,16 @@ <h6 class="font-semibold mb-6">{{ 'artemisApp.exerciseVariantGeneration.wizard.g |
568 | 594 | <!-- Collapsed: the latest message's summary. Expanded: the phase's FULL history, each |
569 | 595 | message in its own scrollable code field, latest at the bottom. --> |
570 | 596 | @if (hasAnyDetail(entry.outputs)) { |
571 | | - <a class="block cursor-pointer no-underline" (click)="toggleStepOutput(entry.phase)" data-testid="variant-wizard-summary-toggle"> |
| 597 | + <button |
| 598 | + type="button" |
| 599 | + class="block w-full cursor-pointer border-0 bg-transparent p-0 text-start no-underline" |
| 600 | + [attr.aria-expanded]="!!expandedPhases()[entry.phase]" |
| 601 | + (click)="toggleStepOutput(entry.phase)" |
| 602 | + data-testid="variant-wizard-summary-toggle" |
| 603 | + > |
572 | 604 | <fa-icon [icon]="expandedPhases()[entry.phase] ? faChevronDown : faChevronRight" class="mr-1" /> |
573 | 605 | {{ entry.outputs[entry.outputs.length - 1].summary }} |
574 | | - </a> |
| 606 | + </button> |
575 | 607 | @if (expandedPhases()[entry.phase]) { |
576 | 608 | @for (stepOutput of entry.outputs; track $index) { |
577 | 609 | @if (stepOutput.detail) { |
|
0 commit comments