Skip to content

feat(theme): add support for matugen smart mode and type - #3109

Open
haikalllp wants to merge 9 commits into
AvengeMedia:masterfrom
haikalllp:feat/matugen-smart
Open

feat(theme): add support for matugen smart mode and type#3109
haikalllp wants to merge 9 commits into
AvengeMedia:masterfrom
haikalllp:feat/matugen-smart

Conversation

@haikalllp

@haikalllp haikalllp commented Aug 19, 2026

Copy link
Copy Markdown

Description

Adds support for matugen --mode smart and --type scheme-smart.
Btw, manual theme toggle still wins, and automatically disable the smart mode. There is no UI gating atm, because I thought the log is sufficient, and Matugen 4.2.0 is latest cargo release anyways.

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that changes existing behavior)
  • Refactor / internal cleanup
  • Documentation
  • Other

Related issues

none

Screenshots / video

showcase.mp4

Checklist

  • My code follows the conventions in CONTRIBUTING.md
  • I have tested my changes locally
  • New user-facing strings are wrapped in I18n.tr() with translator context, reusing existing terms where possible
  • Go changes: ran make fmt, added/updated tests, make test passes, and go mod tidy is clean
  • QML changes: ran make lint-qml with no new warnings
  • I have opened a corresponding pull request in dlx-docs to document any new behaviors: https://github.com/AvengeMedia/DankLinux-Docs

Comment thread quickshell/translations/settings_search_index.json
Comment thread quickshell/translations/en.json Outdated
Comment thread quickshell/Modules/Settings/ThemeColorsTab.qml Outdated
@haikalllp
haikalllp requested a review from bbedward August 20, 2026 05:44
@bbedward

Copy link
Copy Markdown
Collaborator

/claude review

Comment thread quickshell/Common/Theme.qml
Comment thread quickshell/Common/Theme.qml
Comment thread quickshell/Modules/ControlCenter/Components/DragDropGrid.qml Outdated
@claude

claude Bot commented Aug 20, 2026

Copy link
Copy Markdown

Claude review

Feature looks sound overall; three issues, one of which will disable the new setting on its own.

  • Theme.setLightMode() clears matugenSmartMode on every call, including the portal-driven one from PortalService.colorSchemeSettleTimer (syncModeWithPortal defaults on) — quickshell/Common/Theme.qml:1175
  • Smart-mode flips call SessionData.setLightMode() directly and skip SettingsData.updateCosmicThemeMode(), so COSMIC stays stale — quickshell/Common/Theme.qml:2085
  • New Auto (Light Mode) / Auto (Dark Mode) / Auto From Wallpaper strings lack translator context and add terms that already exist in en.json — quickshell/Modules/ControlCenter/Components/DragDropGrid.qml:750

Checked: matugen smart mode/scheme resolution and version gating in Go, queue/handler wiring, preview --image plumbing, and the QML settings/control-center/Theme paths. Model: claude-opus-5.

@haikalllp

Copy link
Copy Markdown
Author

Do I fix these issues @bbedward ? They seem valid to me..

@haikalllp

Copy link
Copy Markdown
Author

/claude review

1 similar comment
@hthienloc

Copy link
Copy Markdown
Member

/claude review

@haikalllp

Copy link
Copy Markdown
Author

/claude review

Thanks!

return false;
if (typeof SessionData !== "undefined" && SessionData.themeModeAutoEnabled)
return false;
if (SettingsData.matugenSmartMode)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

matugenSmartMode is checked as if it were always in effect, but it only does anything on the dynamic theme — setDesiredTheme only sends mode: "smart" when kind === "image" && !stockColors (Theme.qml:1507), and every stock/custom theme goes down the stockColors path.

So: enable "Auto From Wallpaper" on the dynamic theme, then switch to a stock theme. The setting stays true, nothing resolves the mode from the wallpaper any more, and this early return silently kills portal color-scheme sync. The user can't turn it back on either — the toggle is enabled: Theme.currentTheme === Theme.dynamic (ThemeColorsTab.qml:1331), so it's greyed out on a stock theme. Same for visible: matugenSmartCapable: if matugen is uninstalled or downgraded below 4.2 the row disappears entirely and the flag is stuck on.

Gating on "smart mode is actually driving the mode" fixes both, and the same guard is needed at DragDropGrid.qml:749, which otherwise labels the tile "Auto (Dark Mode)" on a stock theme where nothing is automatic.

Suggested change
if (SettingsData.matugenSmartMode)
if (SettingsData.matugenSmartMode && typeof Theme !== "undefined" && Theme.currentTheme === Theme.dynamic)

@claude

claude Bot commented Aug 23, 2026

Copy link
Copy Markdown

Claude review

One finding this round; the three from the previous review are addressed.

  • matugenSmartMode is treated as always-in-effect, but it only drives the mode on the dynamic theme — switching to a stock theme leaves the flag stuck on (toggle is greyed out), silently disabling portal color-scheme sync and mislabeling the control-center tile, quickshell/Services/PortalService.qml:94

Checked: smart mode/scheme resolution and 4.2 version gating in Go, SupportsSmart plumbing through matugen.status to DMSService, preview --image path, {{mode}} in dank.json and its consumers, the wallpaper-sync-skip loop guard in SessionData.setLightMode, portal/cosmic/ThemeAutoService interactions, and translator context on the new strings. Model: claude-opus-5.

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