feat(desktop): add fade-edge mask utilities#3735
Conversation
Add composable `.fade-edge-{t,r,b,l}` utility classes that fade out one
or more edges of an element via a linear-gradient mask. Useful for
indicating horizontal/vertical scroll affordance.
Lives in `apps/desktop/src/renderer/styles/fade-edge.css` (single
import in `globals.css`) so the file can be promoted to `packages/ui`
once a second consumer needs it.
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughA new CSS utility file providing edge-fade masks was added and imported into the global stylesheet. It defines four composable classes (.fade-edge-t/.fade-edge-r/.fade-edge-b/.fade-edge-l) that apply directional mask gradients configurable via CSS custom properties. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@apps/desktop/src/renderer/styles/fade-edge.css`:
- Line 23: Add a blank line immediately before the mask-image declaration to
satisfy the Stylelint rule declaration-empty-line-before; locate the mask-image
property in fade-edge.css (the mask-image: declaration) and insert a single
empty line above it so the declaration is separated from the previous block or
comment.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: f9c359fd-2210-41c0-b6df-0545c1b0ba1d
📒 Files selected for processing (2)
apps/desktop/src/renderer/globals.cssapps/desktop/src/renderer/styles/fade-edge.css
Greptile SummaryAdds composable Confidence Score: 5/5Safe to merge — CSS-only addition with no consumers yet; no runtime risk. All findings are P2 or lower. The gradient math is correct for every combination of the four classes, the No files require special attention.
|
| Filename | Overview |
|---|---|
| apps/desktop/src/renderer/styles/fade-edge.css | New utility file adding composable .fade-edge-{t,r,b,l} CSS mask classes using two-gradient intersection technique; logic is correct for single and combined edges |
| apps/desktop/src/renderer/globals.css | Adds a single @import "./styles/fade-edge.css" line; import placement is correct (after Tailwind imports, within the utilities layer cascade order) |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["Element with fade-edge-* class"] --> B["Shared rule sets defaults\n--fade-edge-size: 1.5rem\nAll four size vars reset to 0px\nmask-image with 2 gradients\nmask-composite: intersect"]
B --> D["fade-edge-t sets --fade-edge-t-size"]
B --> E["fade-edge-r sets --fade-edge-r-size"]
B --> F["fade-edge-b sets --fade-edge-b-size"]
B --> G["fade-edge-l sets --fade-edge-l-size"]
D --> H["Vertical gradient\ntransparent to black at t-size\nblack to transparent at 100%-b-size"]
E --> I["Horizontal gradient\ntransparent to black at l-size\nblack to transparent at 100%-r-size"]
F --> H
G --> I
H --> J["mask-composite intersect\nPixels opaque in BOTH gradients only"]
I --> J
J --> K["Final faded edges rendered"]
Reviews (1): Last reviewed commit: "feat(desktop): add fade-edge mask utilit..." | Re-trigger Greptile
🧹 Preview Cleanup CompleteThe following preview resources have been cleaned up:
Thank you for your contribution! 🎉 |
PR1〜PR5 (#435 #436 #437 #438 #440) で 13 commits 全件 cherry-pick + 手動 conflict 解消で取り込み済み。 本コミットは git 履歴上 behind=0 とするための ours マージ記録。 取り込み済み 13 commits: - 1f55c62 Fix host service restart adoption (superset-sh#3732) - 0fe65d2 test(desktop): remove host-service-coordinator test (superset-sh#3734) - 3012b5a Add optimistic Electric collection updates (superset-sh#3722) - c272a51 fix(desktop): drop branch row from v2 sidebar workspace item (superset-sh#3733) - c2f3fdc feat(desktop): add fade-edge mask utilities (superset-sh#3735) - 682d07c fix v2 terminal osc links (superset-sh#3736) - 7c0d22b feat(ports): surface remote host-service ports in the sidebar (superset-sh#3676) - 6a3be2d [codex] Stabilize v2 terminal resize (superset-sh#3739) - 8928ac6 [codex] Improve v2 pane header responsiveness (superset-sh#3737) - 5fe3d22 refactor(desktop): tidy v2 terminal session dropdown (superset-sh#3743) - 66c23d6 Fix automation timezone scheduling (superset-sh#3738) - 16e270c [codex] Add terminal session titles (superset-sh#3740) - 583fa5d fix(desktop): refit v2 terminal after font settle (superset-sh#3742)
Summary
Adds composable
.fade-edge-{t,r,b,l}utility classes that fade out one or more edges of an element via a linear-gradient mask. Useful for indicating scroll affordance on horizontally / vertically overflowing containers.class=\"fade-edge-r fade-edge-b\"fades both edges.[--fade-edge-size:2rem].apps/desktop/src/renderer/styles/fade-edge.cssand is imported once fromglobals.css. The file header documents the promotion path: when a second consumer outsideapps/desktopneeds it, move topackages/ui/src/styles/fade-edge.cssand update imports.No consumers in this PR — a follow-up PR (the v2 sidebar ports work) is the first consumer.
Test plan
class=\"fade-edge-r\"to a horizontally scrolling element and verify the right edge fades outfade-edge-r fade-edge-b) and verify both fadeSummary by cubic
Adds composable edge-fade utilities
.fade-edge-{t,r,b,l}that use a linear-gradient mask to fade edges and hint overflow scrolling. Included once in the desktop renderer viaglobals.css; first consumer will follow.fade-edge-r fade-edge-b).--fade-edge-size(default 1.5rem).apps/desktop/src/renderer/styles/fade-edge.css, imported fromapps/desktop/src/renderer/globals.css(promote topackages/uiwhen shared).Written for commit 84934a2. Summary will update on new commits.
Summary by CodeRabbit