Skip to content

Commit e735676

Browse files
Sbussisoclaude
andcommitted
ui: remove flex:1 from base .btn (was a CSS landmine)
Previous fix scoped the override to .mcp-key-item .btn — works but adds tech debt for every future button in a flex container. Audit showed: - Only ONE place actually wants .btn { flex: 1 }: .camera-controls (Record + Snapshot split-even). - Multiple places are silently HARMED by it: - .modal-actions has justify-content: flex-end which gets defeated (buttons should hug right; were stretching) - .upgrade-actions has justify-content: center, also defeated - .notif-panel-actions had buttons stretching across the panel - .mcp-key-item Revoke button (the one Sb spotted) - Landing pages use .landing-btn (separate class), unaffected. Fix: move flex:1 from base .btn to a scoped .camera-controls .btn rule, drop the per-place override I just added on .mcp-key-item. Net result: modals + upgrade dialogs + notification panel + MCP keys list all improve simultaneously, camera card stays the same. Defensive comment added on the .btn block warning future maintainers not to add flex:1 back without thinking through the bleed. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent af86405 commit e735676

1 file changed

Lines changed: 16 additions & 11 deletions

File tree

frontend/src/index.css

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1087,8 +1087,23 @@ body {
10871087
border-top: 1px solid var(--border-color);
10881088
}
10891089

1090-
.btn {
1090+
/* Camera control buttons (Record + Snapshot) are the one place that
1091+
genuinely wants the buttons to split available space evenly. Kept
1092+
here as a scoped rule rather than as a default on .btn — see the
1093+
.btn block below for the rationale. */
1094+
.camera-controls .btn {
10911095
flex: 1;
1096+
}
1097+
1098+
.btn {
1099+
/* NOTE: do NOT set flex: 1 on .btn by default. It bleeds into
1100+
every flex container that holds a .btn — modals (.modal-actions
1101+
has justify-content: flex-end which gets defeated), notification
1102+
panel (.notif-panel-actions), upgrade dialogs, the MCP API keys
1103+
list (.mcp-key-item) — and forces the button to fill the row
1104+
instead of sitting at content width. The one place that DOES
1105+
want even-split layout is camera-controls; that's handled by
1106+
the scoped rule above. */
10921107
display: flex;
10931108
align-items: center;
10941109
justify-content: center;
@@ -3738,16 +3753,6 @@ body {
37383753
border-radius: 8px;
37393754
}
37403755

3741-
/* Override the base .btn { flex: 1 } so the Revoke button sizes to
3742-
its content instead of stretching across the row. The base flex:1
3743-
is intentional for hero CTA pairs ("Get Started" / "Learn More")
3744-
and similar even-split layouts, but bleeds into every .btn placed
3745-
in a flex container. Scoped override here keeps both use cases
3746-
happy without ripping the global rule out. */
3747-
.mcp-key-item .btn {
3748-
flex: 0 0 auto;
3749-
}
3750-
37513756
.mcp-key-info {
37523757
display: flex;
37533758
flex-direction: column;

0 commit comments

Comments
 (0)