fix(463): bound the schedules "Active schedule" selector so it stops overlapping the header #465
@@ -170,6 +170,16 @@ describe('SchedulesScreen — load', () => {
|
||||
expect(screen.getByLabelText('Schedule lineup')).toBeTruthy();
|
||||
});
|
||||
|
||||
it('renders the "Active schedule" selector non-full-width so it cannot overflow the header (#463)', async () => {
|
||||
await renderReady();
|
||||
const select = screen.getByLabelText('Active schedule');
|
||||
const field = select.closest('.ctv-field');
|
||||
expect(field).not.toBeNull();
|
||||
// fullWidth={false} => the wrapper must NOT carry .ctv-field-full (width:100%), which was what
|
||||
// stretched the selector across the flex header and overlapped the title + action buttons.
|
||||
expect(field?.classList.contains('ctv-field-full')).toBe(false);
|
||||
});
|
||||
|
||||
it('fetches filler presets per kind (5 kinds)', async () => {
|
||||
const handle = await renderReady();
|
||||
const kinds = handle.requests.filter((r) => r.url.startsWith('/api/v1/filler-presets')).map((r) => r.url);
|
||||
|
||||
@@ -481,6 +481,11 @@ export function SchedulesScreen() {
|
||||
label="Active schedule"
|
||||
size="sm"
|
||||
disabled={saving}
|
||||
// fullWidth (the Select default) applies width:100%, which in this flex header made the
|
||||
// selector demand the whole row and overlap the title block + action buttons (#463). Size it
|
||||
// to content, bounded so a long schedule name can't re-widen it past the header.
|
||||
fullWidth={false}
|
||||
style={{ maxWidth: 260, minWidth: 150 }}
|
||||
value={`${activeSchedule.id}`}
|
||||
onChange={(e) => guardedSwitch(Number(e.target.value))}
|
||||
options={schedules.map((s) => ({ value: `${s.id}`, label: s.name ?? `Schedule ${s.id}` }))}
|
||||
|
||||
Reference in New Issue
Block a user