Skip to content

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

Merged
bbedward merged 10 commits into
duxlabs-dev:masterfrom
shreudi:feat/matugen-smart
Aug 27, 2026
Merged

bbedward merged 10 commits into
duxlabs-dev:masterfrom
shreudi:feat/matugen-smart

Conversation

@shreudi

@shreudi shreudi commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor

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

Comment thread quickshell/translations/en.json Resolved
@shreudi
shreudi force-pushed the feat/matugen-smart branch from 56b4980 to 438f817 Compare August 20, 2026 05:42
@shreudi
shreudi requested a review from bbedward August 20, 2026 05:44
@bbedward

Copy link
Copy Markdown
Member

/claude review

Comment thread quickshell/Common/Theme.qml Resolved
Comment thread quickshell/Common/Theme.qml Resolved
@claude

claude Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

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.

@shreudi

shreudi commented Aug 21, 2026

Copy link
Copy Markdown
Contributor Author

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

@shreudi

shreudi commented Aug 23, 2026

Copy link
Copy Markdown
Contributor Author

/claude review

1 similar comment
@hthienloc

Copy link
Copy Markdown
Member

/claude review

@shreudi

shreudi commented Aug 23, 2026

Copy link
Copy Markdown
Contributor Author

/claude review

Thanks!

Comment thread quickshell/Services/PortalService.qml Resolved
@claude

claude Bot commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

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.

…mes keep portal sync and fix tile labels in control center
@bbedward

Copy link
Copy Markdown
Member

/claude review

@claude

claude Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Claude review

No issues found.

The four findings from the previous rounds are all addressed: canSyncColorScheme() now bails on smart mode (PortalService.qml:94), the smart-mode flip calls SettingsData.updateCosmicThemeMode() (Theme.qml:2086), the new strings carry translator context, and both the portal guard and the control-center tile label are gated on Theme.currentTheme === Theme.dynamic.

Checked: resolveSmartMode ordering inside buildOnce (runs before buildMergedConfig/generateDank16Variants/syncColorScheme, and opts is passed by pointer so Run sees the resolved mode); 4.2 detection and the positional matugenFlags{supportsCOE, isV4, isV42} literals; every runMatugenDryRun call site now sets Mode explicitly, so the -m dark → -m string(opts.Mode) change in execDryRun has no empty-mode caller; SupportsSmart → matugen.status → DMSService.matugenSmartSupported (only fetched on link-up, sendRequest accepts null params); preview --image plumbing and the request-key cache; {{mode}} is an existing matugen keyword (already used in configs/pywalfox.toml), and the extra top-level mode key in dms-colors.json is ignored by the Go ColorsOutput struct and by screenshot/theme.go; no regeneration loop from the SessionData.setLightMode(resolved, true) flip (onLightModeChanged only reloads custom themes) and the outbound gsettings push still happens via PortalService.onIsLightModeChanged; every ThemeAutoService → Theme.setLightMode path is guarded by themeModeAutoEnabled, which the two toggles keep mutually exclusive with matugenSmartMode; PreviewSchemes has no other callers or tests; the new tests do not shell out to matugen. Model: claude-opus-5.

@bbedward
bbedward merged commit 42080db into duxlabs-dev:master Aug 27, 2026
3 checks passed
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