refactor(ui): one base .btn:disabled rule, dedup the disabled affordance #78
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/btn-disabled-affordance"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Reworked to reduce LOC and repetition rather than add to them. Net −1 line, one fewer CSS rule, and the
opacity: 0.4; cursor: not-allowedaffordance now appears exactly once in the whole codebase (was two places).What it consolidates
Before, the disabled-button affordance lived in three partly-duplicated places:
app.css→.btn.primary:disabled { opacity: 0.4; cursor: not-allowed }(primary only)SessionTerminal.svelte→ a scoped.disconnected-overlay .btn:disabled { opacity: 0.4; cursor: not-allowed }(copy #2, added to work around the gap).btneverywhere else → no disabled affordance at all (the original bug: Reconnect, "Install all remaining" looked clickable while ignoring clicks)After, one base rule covers every button:
The trick that lets
.btn.primary:disabledbe deleted rather than kept: guarding both:hoverrules with:not(:disabled)means a disabled primary matches no hover rule, so the base.btn:disabledwins outright. That also removes the specificity-ordering fragility the earlier revision of this PR had to document with a "don't merge these rules" comment — now there's nothing to trip over.Two consequences, both handled
.disconnected-overlay .btn:disabled(from #73) is now redundant — removed, along with its 5-line comment that argued against going global. The Reconnect button dims via the base rule..install-actionchips carry.btn, so the base dim would fade the green "installed" / accent "installing" status badges to 40%. They already had a.install-action:disabledrule; addingopacity: 1there (one line) opts all of them out uniformly — their colour is the status, not a dead control. Trade-off: an idle row disabled byinstallAllBusyno longer dims either; acceptable, it still showscursor: not-allowed.Verification
Browser-verified against the loaded and compiled CSS (suite is node-only, no DOM), measuring computed styles:
.btn0.4/not-allowed— the fix.btnon hoverrgb(22,22,22)).btnon hoverrgb(10,10,10))0.4— proves deleting.btn.primary:disabledis safe.install-actioninstalling / installedopacity 1, colours intact728 tests pass, lint clean, typecheck 0 errors.
History: opened as an additive fix stacked on #71/#73 (both since merged to main); rebased onto main and reworked into this net-reducing consolidation.
65a4e0dcb3af541f5619fix(ui): base disabled affordance for plain .btnto refactor(ui): one base .btn:disabled rule, dedup the disabled affordance