Skip to content

Apply UI config changes live without requiring a restart#781

Merged
WhiteMagic merged 1 commit into
WhiteMagic:developfrom
SubliminalsTV:feature/live-config-refresh
Jun 24, 2026
Merged

Apply UI config changes live without requiring a restart#781
WhiteMagic merged 1 commit into
WhiteMagic:developfrom
SubliminalsTV:feature/live-config-refresh

Conversation

@SubliminalsTV

Copy link
Copy Markdown
Contributor

Config changes that affect the UI — dark mode being the obvious one — currently only take effect on restart. This emits the existing configChanged signal when a config entry is written and has Main.qml re-apply on it, so toggling dark mode updates the palette immediately.

Per your note on #778, treat this as a starting point rather than a finished design — it's the smallest thing that works. If there's a direction you'd rather Gremlin take for live config, I'm glad to redo it that way; I mostly wanted something concrete to react to.

Scoped to dark mode for now. Action-icon glyphs won't recolor live yet since they're cached — that's a separate follow-up, not in here.

@SubliminalsTV SubliminalsTV force-pushed the feature/live-config-refresh branch from bb1301d to c3c54d0 Compare June 16, 2026 12:49
@SubliminalsTV

Copy link
Copy Markdown
Contributor Author

No rush on this — just flagging it's ready for review whenever you have a window. It's file-disjoint from #780/#783, so there's no ordering dependency between them.

Comment thread gremlin/ui/option.py Outdated
Comment on lines +254 to +256
# Let UI elements that can update live (e.g. the dark-mode palette)
# react immediately rather than only on the next restart.
signal.configChanged.emit()

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Similar to other comment related comments, I'd keep this more general, e.g. "Enable other UI elements to react to configuration changes." That should be clear enough as to why it's emitted without being specific to the one issue it addresses initially. Since there may other places this signal could be used, e.g. i) reordering of actions (currently updates when you change input for example) or ii) input item display mode (currently applies once you change the device tab).

@WhiteMagic

Copy link
Copy Markdown
Owner

No big changes.

Also just as a heads up, in case you're thinking of complex future changes, I've played around with claude design to see what it could come up with as a refined UI style, as I personally don't like dealing with UI but the Universal theme is also kind of annoyingly space hungry, which is why I started to add compact variants. Though at some point it becomes more appropriate to ditch the Universal style entirely and roll a custom one. That was always the idea of going with QML, it forces logic and presentation to be split such that the two can be changed (mostly) independently of each other. So LLMs getting better at UI madness opens that direction.

@WhiteMagic

Copy link
Copy Markdown
Owner

Oh other thing I remembered, the description of the option itself should be updated, to no longer mention that a restart is required.

@SubliminalsTV SubliminalsTV force-pushed the feature/live-config-refresh branch from c3c54d0 to 57c071d Compare June 23, 2026 12:35
@SubliminalsTV

Copy link
Copy Markdown
Contributor Author

Done — dropped "(requires restart)" from the dark-mode option's description now that it applies live, and generalized that comment to your wording since the signal isn't dark-mode-specific.

Re ditching the Universal style for a custom one — agreed that's exactly the payoff of QML's logic/presentation split; happy to help in that direction once you're further along with the compact variants.

Comment thread qml/Main.qml Outdated
Style.isDarkMode = backend.useDarkMode
}
}

@WhiteMagic WhiteMagic Jun 23, 2026

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

There is already a section in Main.qml where Connections are setup, including for the signal target. (around line 436) so this should go there.

Edit: Somehow GitHub didn't post the comment yesterday :-/

@SubliminalsTV SubliminalsTV force-pushed the feature/live-config-refresh branch from 57c071d to 0fbc2eb Compare June 24, 2026 03:32
@SubliminalsTV

Copy link
Copy Markdown
Contributor Author

Moved the onConfigChanged handler into the existing Connections { target: signal } block — no standalone block now. (The option.py comment generalization from your earlier note is already in from the last push.)

@WhiteMagic

Copy link
Copy Markdown
Owner

Re ditching the Universal style for a custom one — agreed that's exactly the payoff of QML's logic/presentation split; happy to help in that direction once you're further along with the compact variants.

I'm unlikely going to add more custom compact variants, what is there fixes some of the main annoyances but replicating and condensing more Universal controls is to me more of a waste of time when it's all going to be replaced by an entirely new style anyhow. I'll have to write up a design doc for how that change might happen at some point.

@WhiteMagic WhiteMagic merged commit 19eccf3 into WhiteMagic:develop Jun 24, 2026
1 check 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.

2 participants