Skip to content

feat(theme): add background-only opacity - #274

Closed
erikrjohansson wants to merge 1 commit into
thisisgm:mainfrom
erikrjohansson:feat/background-alpha
Closed

erikrjohansson wants to merge 1 commit into
thisisgm:mainfrom
erikrjohansson:feat/background-alpha

Conversation

@erikrjohansson

@erikrjohansson erikrjohansson commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Flea has no background opacity setting, so the only way to make it transparent is Hyprland's window opacity. That fades the whole window, text included, which makes it harder to read. This adds a background opacity setting, like terminals have, so the background can be see-through while the text and icons stay solid:

[flea]
background-alpha = 0.34

Set it in a theme's shell.toml, or in ~/.config/omarchy/shell.toml for every theme. It defaults to 1, so nothing changes unless someone sets it.

comparison-clean

The list, sidebar and bars turn see-through. The sidebar and bars sit on top of the list, so at 0.34 they come out about 0.56 opaque. Menus, dialogs, Quick Look's panel and editors stay solid.

The window is only made see-through when the setting is below 1 at launch, so other themes keep today's opaque window. After an opaque launch, switching to a glass theme takes effect when Flea reopens. A window launched on glass follows later changes live.

On glass, the columns view's preview no longer flickers. Nothing changes at 1.

Testing (on 0.3.8)

  • On screen at 0.34: list, columns, grid, dual pane, Quick Look and Settings. With the setting off, the window is pixel-identical to upstream.
  • Startup, 30 paired offscreen launches: the first frame is unchanged (median −0.5 ms).
  • Offscreen checks pass for the setting in the theme file, in the user file, a user value overriding the theme's, invalid values, and a value that rounds to 1. tests/shellload.sh, tools/flea-file-budget and tests/staticgates.sh pass.
  • I couldn't generate the quickshell-missing staticgates profile here. Its Glass.qml rows follow Theme.qml's pattern, so please regenerate them if your CI disagrees.
  • Not run: a dark theme on this build, and native-renderer timing.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added configurable window background opacity, set from 0 (transparent) to 1 (opaque) in theme or user-wide shell settings. The default remains opaque.
    • Background transparency updates live on glass surfaces. If Flea starts opaque, the setting takes effect after reopening the app.
    • Text, menus, dialogs, and Quick Look remain opaque; overlapping background layers stack.

Read an optional [flea] background-alpha from the existing shell settings.
Apply it to the window planes; text, menus and dialogs stay opaque.
Make the window clear at launch only when the value is below 1.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: aec07441-dedc-46cd-9d5b-77f6268ee69c
📥 Commits

Reviewing files that changed from the base of the PR and between abb536e and d2ea039.

⛔ Files ignored due to path filters (1)
  • tests/staticgates-unqualified.tsv is excluded by !**/*.tsv
📒 Files selected for processing (14)
  • AGENTS.md
  • README.md
  • ui/ChromeBar.qml
  • ui/ColumnsArea.qml
  • ui/FilterStrip.qml
  • ui/Glass.qml
  • ui/PanePath.qml
  • ui/SearchStrip.qml
  • ui/Sidebar.qml
  • ui/StatusBar.qml
  • ui/TabBar.qml
  • ui/WindowBody.qml
  • ui/boot/shell.qml
  • ui/qmldir

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

Flea now supports a configurable background alpha. Startup code uses the loaded body’s alpha to set window transparency, and selected UI background planes use the configured alpha. The README and AGENTS.md describe the setting and affected UI elements.

Changes

Configurable glass backgrounds

Layer / File(s) Summary
Resolve alpha and set window transparency
ui/Glass.qml, ui/qmldir, ui/boot/shell.qml, README.md, AGENTS.md
The Glass singleton waits for shell-file reads and exposes alpha-adjusted colors. loadBody() sets the window to transparent when the loaded body’s alpha is below 1. Documentation describes the setting, its default, and startup behavior.
Apply alpha to UI background planes
ui/ChromeBar.qml, ui/ColumnsArea.qml, ui/FilterStrip.qml, ui/PanePath.qml, ui/SearchStrip.qml, ui/Sidebar.qml, ui/StatusBar.qml, ui/TabBar.qml, ui/WindowBody.qml, AGENTS.md
Background and surface elements use Glass colors. PreviewSwap.ground becomes transparent when Glass.planeAlpha is below 1. Documentation identifies affected planes and UI elements that remain opaque.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant ShellJobs as shell-file jobs
  participant Glass
  participant LoadBody as loadBody()
  participant Window
  participant Planes as UI background planes
  ShellJobs-->>Glass: Complete both startup reads
  Glass->>Glass: Set clearWindow from configured alpha
  LoadBody->>Window: Set loaded body source
  LoadBody->>Window: Set transparent when body alpha is below 1
  Glass-->>Planes: Provide alpha-adjusted background colors
Loading

Suggested reviewers: thisisgm

Merge Risk: ⚪ Minimal · up to d2ea0

No actionable merge-blocking issue is established. The glass setting is connected to shell loading, though the reader’s exact value and precedence behavior remains unverified.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding background-only opacity controlled by theme settings.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Pillartheman1

Copy link
Copy Markdown

PLEASE!!!!!

@erikrjohansson

Copy link
Copy Markdown
Contributor Author

Omarchy just merged window transparency modes (Opaque / Transparent / Glassy) in omacom/omarchy#14991. Glassy uses the same idea as this PR (see-through background, solid text, blur behind), but as a user choice rather than a theme setting.

So Flea should probably follow that mode instead of a theme key. Either Flea reads the mode itself, or Omarchy's glass script sets [flea] background-alpha the way it does terminal opacity. Closing this for now. I'll try to remember to come back with a new PR if or once that has shipped.

@thisisgm

Copy link
Copy Markdown
Owner

opacity always faded text with the background; background-only opacity for glass themes landed, reimplemented with credit to this PR (2e6d298, v0.3.10). Thanks @erikrjohansson! https://github.com/thisisgm/flea/releases/tag/v0.3.10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants