Skip to content

Fix Audio layout and responsive media headers - #8445

Merged
Imagineer99 merged 5 commits into
unslothai:mainfrom
Imagineer99:fix/audio-page-layout
Aug 13, 2026
Merged

Imagineer99 merged 5 commits into
unslothai:mainfrom
Imagineer99:fix/audio-page-layout

Conversation

@Imagineer99

@Imagineer99 Imagineer99 commented Aug 11, 2026 •

Copy link
Copy Markdown
Member

What changed

  • Bring Audio's page rail, spacing, preview gutter, advanced controls, and in-flow Generate footer in line with the Images experience.
  • Replace Audio's independently positioned model selector and Create / Train overlay with one responsive, in-flow header grid.
  • Preserve the full model-selector label for longer by shrinking the model rail only under real width pressure.
  • Keep Images' Video action right-aligned while allowing the Create / Train group to use the available constrained-width space.
  • Give constrained Audio headers a consistent 12px right inset because Audio has no Video action to balance the header.
  • Increase dark-mode account-menu separation with the agreed subtle 5% border treatment.
  • Extend frontend layout contracts for Audio, Images, model-selector sizing, footer structure, and responsive header behavior.

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 model to 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/main at 6b3868ab1. The After captures use 7ebc31b0c. 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.

Before — truncated model trigger After — full trigger and stable action spacing
Before: Images model trigger truncates at 800 by 700 After: Images model trigger remains complete at 800 by 700

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.

Before — overlapping header controls After — in-flow, right-aligned controls
Before: Audio model selector overlaps Create and Train After: Audio header controls remain separated

Validation

  • python -m pytest tests/studio/test_desktop_reliability_frontend_contract.py -q — 36 passed
  • npm run typecheck — passed
  • git diff --check — passed
  • Seven matched Playwright A/B scenarios across Images, Audio, expanded/collapsed sidebars, 600–1600px widths, and the dark account popup

The complete 14-image Playwright matrix is included in the PR discussion.

@Imagineer99

Copy link
Copy Markdown
Member Author

Comprehensive Playwright A/B refresh

Seven matched comparisons (14 screenshots total). Before is exact origin/main at 6b3868ab1; After is 7ebc31b0c. Each pair uses the same viewport and sidebar state.

1. Images — wide, expanded sidebar (1600 × 800)

Desktop regression coverage for the complete Images surface: full model selector, centered page-mode controls, Video action, form, in-flow Generate footer, and gallery.

Before After
Before: Images wide expanded After: Images wide expanded

2. Images — constrained, expanded sidebar (800 × 700)

The key Images regression: the baseline truncates Select image model; the updated grid preserves the full label and keeps Create / Train separate from Video.

Before After
Before: Images constrained expanded After: Images constrained expanded

3. Images — tight, collapsed sidebar (600 × 700)

Smallest tested header. The full selector label now survives while Create / Train, Video, and the viewport edge retain predictable gaps.

Before After
Before: Images tight collapsed After: Images tight collapsed

4. Audio — wide, expanded sidebar (1600 × 800)

Full desktop Audio coverage, including the wider form rail, advanced controls, preview gutter, and dedicated Generate footer.

Before After
Before: Audio wide expanded After: Audio wide expanded

5. Audio — constrained, expanded sidebar (1000 × 700)

Shows the responsive Audio form width, in-flow footer, advanced controls, and right-edge action alignment under moderate width pressure.

Before After
Before: Audio constrained expanded After: Audio constrained expanded

6. Audio — overlap regression, expanded sidebar (800 × 700)

The strongest Audio reproduction: the baseline model selector intersects Create / Train; the updated header keeps both regions fully separated with a 12px right inset.

Before After
Before: Audio header overlap After: Audio header overlap resolved

7. Dark account popup (1000 × 700)

The final pair shows the subtle 5% border treatment. It improves separation from the sidebar without making the popup look like a dramatically different component.

Before After
Before: dark account popup After: dark account popup with subtle border

@Imagineer99
Imagineer99 marked this pull request as ready for review August 11, 2026 17:15
# Conflicts:
#	tests/studio/test_desktop_reliability_frontend_contract.py

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

@Imagineer99

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: 75e1b10701

ℹ️ 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".

@Imagineer99
Imagineer99 merged commit 4b38ab1 into unslothai:main Aug 13, 2026
29 of 41 checks passed
danielhanchen added a commit that referenced this pull request Aug 14, 2026
* 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]>
danielhanchen pushed a commit to NilayYadav/unsloth that referenced this pull request Aug 14, 2026
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.
danielhanchen pushed a commit that referenced this pull request Aug 14, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant