Repository navigation
Fix Audio layout and responsive media headers - #8445
Conversation
# Conflicts: # tests/studio/test_desktop_reliability_frontend_contract.py
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7ebc31b0cf
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. Another round soon, please! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
* Read the descender guard's class list wherever it is written Repo tests (CPU) is red on main: test_model_selector_trigger_label_uses_leading_tight fails with "could not find ModelSelectorTrigger model-name span". The component is fine. #8445 gave the trigger label a caller override, so the span went from className="..." to className={cn("...", triggerLabelClassName)}. The class list itself did not change: it still carries truncate with leading-tight and no leading-none, which is exactly what the guard exists to require. What broke is the guard. It matched on the JSX attribute syntax, so wrapping the same string in cn() made it find nothing, and its only reaction to finding nothing was to say so. A guard that goes quiet the moment a label grows an override is not guarding much, since taking an override is a normal thing for a label to do. It now reads the class literals wherever they are written and matches on the token set, so both the attribute form and the cn() argument form are covered. The pre-#8445 literal is still matched, so this is not a narrowing. * Read the sidebar block's class list the same way The account-block check next to it keyed on `<div className="...">` for the same reason and would go quiet the same way the moment that div takes an override, so it now shares the one matcher. Selecting on its four specific tokens is what makes reading every literal safe. Behaviour is unchanged: the same single div matches. --------- Co-authored-by: danielhanchen <[email protected]>
The audio page fix itself landed in unslothai#8445, which rebuilt the header as the same 408px grid rail Images uses and gave the band pointer-events-none relative z-40 with pointer-events-auto on the control groups. What that PR did not do was extend test_media_page_headers_out_stack_the_mac_drag_region to the Audio page, so nothing pinned the opt-in: stripping pointer-events-auto off the audio model selector left the whole suite green. Parametrise the loop over the three media pages and match on the pointer-events-auto opt-in alone rather than on one layout's flex utilities. Audio and Images seat their mode pills in a grid cell, so the old "pointer-events-auto flex ... items-center gap-" pattern skipped them silently. Removing the opt-in from any of the five control groups across Images, Video and Audio now fails the test. The inner per-group assertion this replaces was tautological: the regex already required the literal pointer-events-auto that it went on to assert.
The audio page fix itself landed in #8445, which rebuilt the header as the same 408px grid rail Images uses and gave the band pointer-events-none relative z-40 with pointer-events-auto on the control groups. What that PR did not do was extend test_media_page_headers_out_stack_the_mac_drag_region to the Audio page, so nothing pinned the opt-in: stripping pointer-events-auto off the audio model selector left the whole suite green. Parametrise the loop over the three media pages and match on the pointer-events-auto opt-in alone rather than on one layout's flex utilities. Audio and Images seat their mode pills in a grid cell, so the old "pointer-events-auto flex ... items-center gap-" pattern skipped them silently. Removing the opt-in from any of the five control groups across Images, Video and Audio now fails the test. The inner per-group assertion this replaces was tautological: the regex already required the literal pointer-events-auto that it went on to assert.














What changed
Root cause
Audio laid out its model selector and Create / Train pill independently: the selector participated in normal flow while the pill was absolutely centered across the header. At narrower expanded-sidebar widths, those boxes could visibly intersect.
Images had already avoided a true intersection, but its constrained equal-track fallback reserved too much space for the action region. That caused
Select image modelto truncate even when enough usable header space remained. The updated structure uses a continuous two-region grid, then changes only the action-region tracks at the 50rem container breakpoint.Lead Playwright comparisons
The Before captures use the exact PR base,
origin/mainat6b3868ab1. The After captures use7ebc31b0c. Both sides use the same authenticated browser state, viewport, and sidebar configuration.Images header — expanded sidebar at 800 × 700
Before, the model trigger truncates unnecessarily. After, the full label remains visible while Create / Train and Video retain separate right-side positions.
Audio header overlap — expanded sidebar at 800 × 700
Before, the model selector and Create / Train controls occupy intersecting geometry. After, both participate in the same grid and remain clearly separated.
Validation
python -m pytest tests/studio/test_desktop_reliability_frontend_contract.py -q— 36 passednpm run typecheck— passedgit diff --check— passedThe complete 14-image Playwright matrix is included in the PR discussion.