Skip to content

Add per-scope sliders to display widget - #6550

Open
jzetterman wants to merge 6 commits into
basecamp:quattrofrom
jzetterman:text-size-scope-sliders-simple
Open

Add per-scope sliders to display widget#6550
jzetterman wants to merge 6 commits into
basecamp:quattrofrom
jzetterman:text-size-scope-sliders-simple

Conversation

@jzetterman

@jzetterman jzetterman commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

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.

  • CLI (omarchy-display-text-size): --shell, --gtk, and --terminals set or reset each surface on its own; no flags keeps the existing one-knob behavior. GTK factor quantization from current quattro is preserved.
  • Monitor panel: TEXT SIZE gains a disclosure chevron. Expanded rows for Shell, GTK apps, and Terminals write through the new flags. The unified slider above still sets all three together.
  • Status / polling: rows update from the written value (CLI is authoritative); open-time status and a 5s poll pick up external gsettings/terminal changes. Undescribed scopes show "—" and refuse relative steps.
  • Tests: shell coverage for the scope flags and quantized GTK factor.

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:

Per-scope text size sliders in the Display panel

Test plan

  • ./test/shell.d/display-text-size-test.sh passes
  • Unified TEXT SIZE slider still sets shell + GTK + terminals together
  • Expand disclosure; each scope slider only changes that surface
  • External gsettings / terminal config change is reflected after open or within the poll window
  • Scopes with no status still show "—" and block relative steps; absolute drag still works
  • Visual check: indentation, hairline gutter, no clipping when expanded (see screenshot)

John Zetterman and others added 3 commits August 4, 2026 21:54
--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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment thread shell/plugins/panels/monitor/Panel.qml Outdated
Comment on lines 368 to 369
textScaleProc.command = command
if (!textScaleProc.running) textScaleProc.running = true

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

Comment on lines +121 to +124
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/)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

Comment on lines +94 to +96
// 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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

John Zetterman and others added 3 commits August 4, 2026 22:17
Copilot AI review requested due to automatic review settings August 5, 2026 02:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 gsettings case 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

@jzetterman

Copy link
Copy Markdown
Contributor Author

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 11pt instead of 14.7px. Terminal configs already store whole points, and every whole point in that range round-trips exactly through the CLI's px conversion, so the CLI doesn't change and the unified px slider keeps setting all three surfaces as it does now.

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.

@jzetterman jzetterman changed the title Add per-scope text size sliders behind a disclosure Add per-scope sliders to display widget Aug 11, 2026
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