Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions frontend/src/v2/__tests__/V2PodsSidebar.scale.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,15 @@ describe('V2PodsSidebar — direction C', () => {
expect(screen.getByPlaceholderText('Pod name')).toBeInTheDocument();
});

test('Create stays disabled until the pod has a name', () => {
renderSidebar(fleet);
fireEvent.click(screen.getByRole('button', { name: 'New pod' }));
const submit = document.querySelector<HTMLButtonElement>('.v2-pods__create-submit');
expect(submit).toBeDisabled();
fireEvent.change(screen.getByPlaceholderText('Pod name'), { target: { value: 'Launch' } });
expect(submit).toBeEnabled();
});

test('the page variant renders the phone list with a Pods title', () => {
renderSidebar(fleet, null, { variant: 'page' });
expect(screen.getByRole('heading', { level: 1, name: 'Pods' })).toBeInTheDocument();
Expand Down
17 changes: 17 additions & 0 deletions frontend/src/v2/__tests__/v2-layout-invariants.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,23 @@ describe('v2 layout invariants (CSS rule presence)', () => {
expect(v2).not.toContain('.v2-pods__search-kbd::before');
});

test('pod create actions beat the button reset and keep phone-sized targets', () => {
const shared = selectorRuleBody(v2, '.v2-root button.v2-pods__create-cancel,');
const cancel = ruleBody(v2, '.v2-root button.v2-pods__create-cancel');
const submit = lastRuleBody(v2, '.v2-root button.v2-pods__create-submit');
const disabled = ruleBody(v2, '.v2-root button.v2-pods__create-submit:disabled');
const phone = blockContaining(v2, '@media (max-width: 760px)', '.v2-root button.v2-pods__create-cancel,');

expect(shared).toContain('padding: 6px 9px');
expect(shared).toContain('font-size: 12px');
expect(cancel).toContain('color: var(--v2-text-tertiary)');
expect(submit).toContain('background: var(--v2-ink)');
expect(submit).toContain('color: #fff');
expect(disabled).toContain('background: var(--v2-border-strong)');
expect(phone).not.toBe('');
expect(ruleBody(v2, '.v2-root button.v2-pods__create-submit', { within: phone })).toContain('min-height: 40px');
});

test('the selected pod keeps the sidebar’s one cobalt block treatment', () => {
const selected = selectorRuleBody(v2, '.v2-root button.v2-pods__row--selected');
expect(selected).toContain('background: var(--v2-accent)');
Expand Down
1 change: 0 additions & 1 deletion frontend/src/v2/__tests__/v2-type-floors.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ const ALLOWLIST: string[] = [
'.v2-mention-item__sub', // 11.0px — no-mono-family
'.v2-modal__error', // 11.0px — no-mono-family
'.v2-modal__hint--muted', // 11.0px — no-mono-family
'.v2-pods__create-cancel, .v2-pods__create-submit', // 11.0px — no-mono-family
'.v2-pods__create-error', // 11.0px — no-mono-family
'.v2-pods__discover-meta', // 11.0px — no-mono-family
'.v2-pods__item-icon', // 11.0px — no-mono-family
Expand Down
19 changes: 13 additions & 6 deletions frontend/src/v2/v2.css
Original file line number Diff line number Diff line change
Expand Up @@ -1051,28 +1051,35 @@ body.modern-ui.v2-canvas {
gap: 8px;
}

.v2-pods__create-cancel,
.v2-pods__create-submit {
.v2-root button.v2-pods__create-cancel,
.v2-root button.v2-pods__create-submit {
padding: 6px 9px;
border-radius: var(--v2-radius-sm);
font-size: 11px;
font-size: 12px;
font-weight: 700;
}

.v2-pods__create-cancel {
.v2-root button.v2-pods__create-cancel {
color: var(--v2-text-tertiary);
}

.v2-pods__create-submit {
.v2-root button.v2-pods__create-submit {
background: var(--v2-ink);
color: #fff;
}

.v2-pods__create-submit:disabled {
.v2-root button.v2-pods__create-submit:disabled {
background: var(--v2-border-strong);
cursor: not-allowed;
}

@media (max-width: 760px) {
.v2-root button.v2-pods__create-cancel,
.v2-root button.v2-pods__create-submit {
min-height: 40px;
}
}

.v2-pods__filters {
/* Fourth mechanism for this row (Sam's ruling 2026-08-23): every chip the
SAME size, at least as roomy as the widest label. Content-sized chips
Expand Down
Loading