Commit 92b7f03
[torchci] Fix missing background on "AI: related" HUD grid badge (#8175)
## Summary
On the HUD commit×job grid, the small `ai` advisor badge overlaid on the
failure icon renders with **no background** for the `related` verdict
(it shows as bare text instead of the red pill the other verdicts get).
## Root cause
The grid badge builds its CSS class **dynamically** in
`[[...page]].tsx`:
```tsx
className={`${styles.advisorBadge} ${
styles[`advisorVerdict_${advisorVerdict.verdict}` as keyof typeof styles] ?? ""
}`}
```
`hud.module.css` defines `.advisorVerdict_revert`, `_not_related`,
`_garbage`, and `_unsure` — but the recent **revert → related** verdict
migration renamed the verdict without adding a matching
`.advisorVerdict_related` class. So `related` verdicts fall through the
`?? ""` fallback and get no background.
The other three render paths (`AutorevertCell.tsx`,
`AdvisorSection.tsx`, `AiAdvisorIndicator.tsx`) were all updated for the
migration to treat `related == revert`; only this CSS map was missed.
## Fix
Add `.advisorVerdict_related` sharing the same red styling as
`.advisorVerdict_revert`. `revert` is kept for any legacy/in-flight
verdicts still using the old value.
```css
.advisorVerdict_revert,
.advisorVerdict_related {
background: #d32f2f;
color: #fff;
}
```
## Test plan
- CSS-only change; `yarn prettier --check components/hud.module.css`
passes.
- Verified the dynamic class `advisorVerdict_related` now resolves to a
defined rule, matching how
`AutorevertCell`/`AdvisorSection`/`AiAdvisorIndicator` already map
`related → revert` (red).
Co-authored-by: Ivan <izaitsevfb@meta.com>1 parent 2380ca3 commit 92b7f03
1 file changed
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
243 | 243 | | |
244 | 244 | | |
245 | 245 | | |
246 | | - | |
| 246 | + | |
| 247 | + | |
247 | 248 | | |
248 | 249 | | |
249 | 250 | | |
| |||
0 commit comments