Add per-scope sliders to display widget - #6550
Conversation
--shell, --gtk, and --terminals let each of the three linked surfaces be set or reset individually; with no flags the one-knob behavior is unchanged. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The TEXT SIZE header gains a chevron; opening it reveals Shell, GTK apps and Terminals rows, indented behind a hairline gutter, each writing its own scope through the CLI's --shell/--gtk/--terminals flags. The unified slider above still sets all three together. A row is updated from the value we asked for rather than read back: the CLI is authoritative, and the 5s poll corrects the row if a write failed. Status is read when the section opens and on that poll, so external gsettings or terminal config changes show up too. Scopes the status output doesn't describe render as "—" and refuse relative steps, since there is no stop to step from; dragging still works because it picks a stop outright. Parsing and the px/pt reference constants live in Model.js, matching how the audio, network and power panels hand collector output to a root updater. The read is wrapped in `timeout` so a wedged gsettings can't leave the process running and block every later read. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YDpVTvwAv2raoGm25UbR46
Quattro quantizes the GTK text-scaling-factor to whole interface-font points. Stub font-name as Cantarell 11 and expect 1.3636 for a 16px set.
There was a problem hiding this comment.
Pull request overview
Adds independent text-size controls for shell, GTK apps, and terminals while retaining unified scaling.
Changes:
- Adds composable CLI scope flags and validation.
- Adds expandable per-scope sliders with polling.
- Adds CLI tests and status parsing.
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
bin/omarchy-display-text-size |
Implements scoped text-size operations. |
shell/plugins/panels/monitor/Panel.qml |
Adds disclosure UI and scope sliders. |
shell/plugins/panels/monitor/Model.js |
Parses CLI status for scope values. |
test/shell.d/display-text-size-test.sh |
Tests CLI scopes and validation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| textScaleProc.command = command | ||
| if (!textScaleProc.running) textScaleProc.running = true |
There was a problem hiding this comment.
Fixed in b70c21e. Writes issued while the CLI is running are now queued and flushed from onRunningChanged — keyed by scope rather than latest-command-wins, so adjusting a second scope never drops the first's write. A queued unified write clears per-scope entries it supersedes.
| function parseTextSizeStatus(raw) { | ||
| var text = String(raw || "") | ||
| var gtk = text.match(/gtk text-scaling-factor:\s*([0-9.]+)/) | ||
| var term = text.match(/terminal font:\s*([0-9.]+)\s*pt/) |
There was a problem hiding this comment.
Added in cb4b410: parseTextSizeStatus cases in test/shell.d/monitor-test.sh covering normal GTK/terminal conversion (1.25 → 15px, 10.5pt → 14px), n/a terminal output, empty output, and malformed output — the latter three all reporting 0/unavailable, which is what gates relative scope steps.
| // Collapsed: just the slider sentinel at -1, like brightness. Expanded: the | ||
| // three scope rows at 0..2, with the unified slider still at -1. | ||
| if (section === "textsize") return textSizeExpanded ? textScopeKeys.length : 0 |
There was a problem hiding this comment.
Fixed in 8c18303. The upward boundary in moveCursor now uses sectionFirstIndex(focusSection) instead of 0, so Up from the Shell row lands on the unified slider at the -1 sentinel. Sections whose first index is 0 (monitors) behave exactly as before.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RjHgWXDjHETbjaqpBzkjyc
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RjHgWXDjHETbjaqpBzkjyc
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RjHgWXDjHETbjaqpBzkjyc
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 5 changed files in this pull request and generated no new comments.
Suppressed comments (2)
shell/plugins/panels/monitor/Panel.qml:426
- A status read can start before a user changes a scope and finish afterward, at which point this unconditionally replaces the just-written optimistic values with stale data. This is especially plausible for the slow/wedged
gsettingscase that the timeout handles, and the wrong values remain visible until the next five-second poll. Invalidate in-flight reads when a write starts (for example with a generation token), and trigger a fresh read after the write queue drains.
function updateTextScopes(raw) {
var parsed = Model.parseTextSizeStatus(raw)
root.gtkPx = parsed.gtkPx
root.termPx = parsed.termPx
shell/plugins/panels/monitor/Panel.qml:896
- The existing graphical acceptance test only opens and screenshots the collapsed monitor panel (
test/acceptance.d/panels-test.sh:39-48); it never reaches this new expanded state or exercises its keyboard/mouse interactions. Add acceptance coverage that opens the disclosure, navigates the scope rows, verifies isolated updates, and captures the expanded layout so these new QML paths are regression-tested.
visible: root.textSizeExpanded
|
Question on the off-notch read-back called out in the description (14px → 10.5pt → 11pt → 14.7px): would you prefer the Terminals slider operate natively in whole points? Concretely: the Terminals row gets its own stop ladder in pt (7–15pt covers the current 9–20px range) and is labeled The tradeoff is scanability — Shell stays px, Terminals becomes pt, so the rows stop sharing a unit. The alternative is leaving the shared px ladder as-is and accepting the read-back decimals as the honest value. Happy to do either; small change both ways. |
Summary
Supersedes #6362. This PR includes that CLI change and the monitor-panel UI that uses it, so the scope flags and the disclosure sliders land together.
omarchy-display-text-size):--shell,--gtk, and--terminalsset or reset each surface on its own; no flags keeps the existing one-knob behavior. GTK factor quantization from currentquattrois preserved.Why a row can show an off-notch value like 14.7px
The CLI quantizes under the hood: terminal size is stored in whole points (14px → 10.5pt → 11pt) and the GTK factor is quantized to whole interface points. The scope rows display the value read back from the CLI rather than the requested notch, so 11pt reads back as 14.7px. The unified knob has always had this quantization underneath — the per-scope rows just make the on-disk truth visible instead of hiding it.
Screenshot
Display panel with per-scope text size rows expanded:
Test plan
./test/shell.d/display-text-size-test.shpasses