Skip to content

feat(theme): default bare Transparent to opaque - #323

Merged
thisisgm merged 1 commit into
thisisgm:mainfrom
joebaus:glass-default-opaque
Oct 17, 2026
Merged

thisisgm merged 1 commit into
thisisgm:mainfrom
joebaus:glass-default-opaque

Conversation

@joebaus

@joebaus joebaus commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Problem

A bare launch — no user [flea] key, no theme [flea] key, no mode toggle file — draws translucent. On current systems that state describes nearly every launch:

  • Zero shipped themes carry a shell.toml, let alone a [flea] key — and per Omarchy's theming spec (docs/theming.md), none could do so through any documented mechanism: shell.toml covers shell surfaces only (closed section list, no per-app sections), no template in default/themed/ emits opacity, and window opacity lives in default/hypr/windows.lua, outside themes entirely. Flea's [flea] background-alpha key, which this patch reads, has no meaning in that spec.
  • Nothing on Omarchy 4.0.4 writes window-opaque.lua / window-glassy.lua, so the mode channel is silent and mode sits at "transparent" permanently. (Omarchy's Opaque/Transparent/Glassy mode system, omacom/omarchy#14991, has merged upstream but not shipped — once it does, mode resolves and this fallthrough becomes nearly unreachable, so the change is forward-compatible.)

So translucency is currently opt-out in a configuration space where opting out is impossible. The only escape is hand-writing a [flea] key the user shouldn't need.

Why opaque is the right default

  • It matches the documented contract: README ("Values run from 0 to 1, and the default is 1") and AGENTS.md ("transparent, the theme's value, else 1"). The code drifted from both in 0f844551.
  • With client alpha at 1, the compositor's 0.985/0.96 rule becomes the sole authority — the same relationship every sibling window has.

The explicit paths are untouched and keep full precedence: user [flea] → Opaque mode → theme [flea] → glassy.

What changed

  • ui/Glass.qml: bare-Transparent fallthrough returns 1; removed the now-unused transparentAlpha.
  • ui/js/Material.js: removed transparentFloor(), left with no callers.
  • Flea reads its key through a generic section/key parser (ui/Commons/Color.qml), so unknown theme content is inert and the key is side-effect-free for the shell.
  • Tests: new bare case in glass.sh; bare/socket/reload expectations to 255 in glass-mode.sh; transparent legs to opaque in glass-boot.sh, material-startup.sh, ui-captures-glass.sh; transparent section of theme-contrast.qml now asserts opaque-ink restoration; replay stub in glasspick-case.sh matches; removed the vacuous transparentEdges harness; re-derived the theme-contrast.sh count (45/palette).
  • AGENTS.md: corrected the stale "holds 1 until the look pick" clause.

Verification

glass.sh (incl. new bare), glass-boot.sh, glass-mode.sh (12/12, 37 checks), material-startup.sh, theme-contrast.sh (1084 checks over 24 palettes), staticgates.sh (14/14) — all green. Two environment notes: startup-objects.sh fails identically on the clean tree in this sandbox (pre-existing, unrelated); ui-captures-glass.sh / glasspick-case.sh need a live compositor, so their edits are by inspection.

A side-by-side demo recording (stock vs this branch, same content and compositor rules) follows in the first comment below.

Precedence note

Opaque mode intentionally outranks the theme key: with no user key set, an Opaque-mode launch returns 1 without consulting the theme value. This extends the existing user-over-theme precedence (the user's own [flea] key already wins outright) — an explicit user mode selection should not be second-guessed by a theme default. Glassy mode already defers to the theme key, so this only governs the Opaque + theme-key-present case, which no current install can produce.

Summary by CodeRabbit

  • Window Transparency
    • Transparent mode now keeps the window fully opaque when neither a theme opacity nor a transparency toggle is set, including when the window loses focus.
    • Glassy mode now uses the configured glass opacity when the theme does not specify an opacity.
    • Explicit user and theme opacity settings, along with the opaque and glassy mode behaviors, remain unchanged.

No shipped theme sets an opacity of its own and no toggle file means
transparency was never chosen, so a bare launch draws the theme opaque.
User and theme [flea] background-alpha keep their precedence, and the
opaque and glassy modes are unchanged.

This restores what README ('the default is 1') and AGENTS.md
('transparent, the theme's value, else 1') already specify.
@coderabbitai

coderabbitai Bot commented Oct 16, 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: bed8e8d0-b4d1-46c4-b803-6c16496f5485
📥 Commits

Reviewing files that changed from the base of the PR and between 4c7b27b and 1623293.

📒 Files selected for processing: 12
  • AGENTS.md
  • tests/glass-boot.sh
  • tests/glass-mode.qml
  • tests/glass-mode.sh
  • tests/glass.sh
  • tests/glasspick-case.sh
  • tests/material-startup.sh
  • tests/theme-contrast.qml
  • tests/theme-contrast.sh
  • tests/ui-captures-glass.sh
  • ui/Glass.qml
  • ui/js/Material.js
💤 Files with no reviewable changes: 1
  • ui/js/Material.js

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

Transparent mode now uses an opaque fallback when no user or theme opacity is set. The contrast-based transparent fallback and related edge-mode checks are removed. Tests and documentation reflect the updated fallback.

Changes: Transparency fallback

Layer / File(s) Summary
Update transparency fallback
ui/Glass.qml, ui/js/Material.js, AGENTS.md
Glass.qml now uses alpha 1 as the fallback for modes other than glassy and opaque when no user or theme opacity is configured. The transparentFloor helper is removed. The documented glassy fallback now refers to Glass.glassAlpha.
Update fallback checks
tests/glass-boot.sh, tests/glass-mode.qml, tests/glass-mode.sh, tests/glass.sh, tests/glasspick-case.sh, tests/material-startup.sh, tests/theme-contrast.qml, tests/theme-contrast.sh, tests/ui-captures-glass.sh
Tests now expect opaque alpha for transparent mode without a configured opacity. Edge-mode contrast checks are removed, and the theme contrast check count is reduced.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: thisisgm

Merge Risk: ⚪ Minimal · up to 16232

Unconfigured Transparent mode now uses the opaque fallback, and the supplied test updates align with that behavior. No material merge risk is identified.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 7 files. (4 skipped: 4… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
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: bare Transparent mode now defaults to opaque.
Full details: Docstring Coverage

Explanation

Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 7 files. (4 skipped: 4 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · 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.

@joebaus

joebaus commented Oct 16, 2026

Copy link
Copy Markdown
Contributor Author

The referenced side-by-side demo recording (stock on the left vs this branch on the right, same content and compositor rules):

screenrecording-2026-10-16_12-54-15.mp4

@thisisgm

Copy link
Copy Markdown
Owner

As discussed in DMs, hotfixing for tonight

@thisisgm
thisisgm merged commit db4cdb8 into thisisgm:main Oct 17, 2026
1 check passed
thisisgm added a commit that referenced this pull request Oct 17, 2026
Bump the version, packaging and shelf manifest for the #323 Window
Transparency hotfix and add its one-line notes with @joebaus's credit.
@thisisgm

Copy link
Copy Markdown
Owner

Fixed in 08157d785 (v0.3.12): stock Transparent now leaves Flea at alpha 1 and lets Omarchy's own opacity rule draw it, so it no longer stacks a second transparency, and Window Transparency switches show live. Thanks @joebaus! https://github.com/thisisgm/flea/releases/tag/v0.3.12

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.

2 participants