cmux-next Settings: This Workspace's Opacity starts at the legibility floor over a picture

Closed
TE
16d ago
+81-5

Over a picture, the This Workspace Opacity slider had the same dead travel #22378 fixed for All Workspaces. The window never paints a workspace's tint below the legibility floor, so dragging under it changed nothing.

The workspace slider now works like the All Workspaces row:

  • It starts at the floor the app reports (derived_min), rounded up to the 5% steps.
  • Its help text says where it starts and why, using the existing settingsWindow.backdropPicker.opacityFloor string, so no new strings.
  • It is disabled when the floor reaches the 95% cap.
  • Without a picture it keeps its 0–95% range.

The floor is the active window's, which is the window "Change Background…" opened Settings from. The rounding lives in a new components/opacityFloor.ts. HostCards.tsx still has its own copy, because #22033 is open on that file. Folding the two together is a follow-up once #22033 lands.

Changelog

  • cmux NEXT: over a picture, This Workspace's Opacity slider starts where it changes the window, and says why.

Tests

  • webviews/src/pages/settings/workspaceOpacityFloor.test.tsx, committed first and red at 81be67017bc:
    • a floor of 0.62 gives a slider minimum of 0.65 and the text "65%";
    • a floor of 0.97 gives a disabled slider;
    • with no floor the slider runs 0–95%.

Observed / Not run

  • Observed on Huge Blue:
    • The new test fails at the test commit (2 fail) and passes with the fix.
    • bun test src/pages/settings: 192 pass, 2 fail. Both failures are base reds: categories.test.ts (the screenshots.* rows have no category) and strings.test.ts (settings.appearance.density.help is missing from the catalog on base).
    • tsc reports no errors in the changed files.
  • Not run: the native app. This change is web-only, so I didn't take a capture.

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.


Summary by cubic

Fixes the This Workspace Opacity slider so that over a picture its range starts at the legibility floor, matching the All Workspaces row and removing the dead travel below it.

Changes

  • The slider minimum is the app-reported floor (derived_min) rounded up onto the 5% step grid, and it is disabled when the floor reaches the 95% cap.
  • Help text explains where the range starts, reusing the existing opacityFloor string so no new strings are added.
  • Without a picture the slider keeps its full 0–95% range.
  • Extracts the floor rounding into a new opacityFloor.ts helper; the host window's copy stays separate pending an unrelated change to that file.

Tests

  • workspaceOpacityFloor.test.tsx covers a floor of 0.62 (slider min 0.65, "65%" text), a floor of 0.97 (disabled slider), and no floor (0–95% range).