Skip to content

Bar panel: audio/OSD/battery/weather/night light, cloned-bar Loader props - #12115

Open
chessing234 wants to merge 30 commits into
omacom:quattrofrom
chessing234:fold/bar-panel-audio-osd-battery-weather
Open

chessing234 wants to merge 30 commits into
omacom:quattrofrom
chessing234:fold/bar-panel-audio-osd-battery-weather

Conversation

@chessing234

@chessing234 chessing234 commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Test plan

  • Spot-check each folded PR's test plan still applies

chessing234 and others added 18 commits September 16, 2026 17:58
Headphones returned early, so a muted headset never showed as muted.
An unbound sink (.audio null) reused the muted speaker glyph, so a
Bluetooth output connected after shell start looked silenced.
PwObjectTracker only saw candidateSinks from nodes.values. Keep the
current default sink/source in the set so .audio populates without a
shell restart.
Launch feedback uses duration 0 and relies on an explicit close. If that
close IPC is dropped or loses a race to show, the card stayed forever.
Guarding close on launchOsdOpen meant a close that arrived before show
never cleared the later sticky OSD, and the flag then blocked retries.
Critical notifications ignore the send timeout, so "Time to recharge!"
stayed up after UPower moved to AC. Dismiss it when we leave the
low-discharging state.
Timezone / reported-country changes can flip °C↔°F with no escape hatch
even though shell.json already accepts a unit override.
Persists through the same updateEntryInline path the clock panel uses
for week-start, so the preference survives restarts.
Multi-frame wallpapers (GIF/video) made ImageMagick decode every
frame before the crop and could exhaust system memory.
Frame 0 was dark-topped, so the correct answer was #ffffff — the same value fallback() prints when sampling fails. Without the [0] selector the pipeline emits one triple per frame, "32,32,320,255,00,0,255", which the regex guard rejects, so the script fell back to #ffffff and the assertion passed on unfixed code. Removing [0] and rerunning the suite confirmed it: 4 passed.

Light-topping frame 0 makes the expected result #101010, which fallback() cannot produce. The same mutation now fails with "expected #101010, got #ffffff".

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@chessing234 chessing234 changed the title Bar panel: mute glyph, OSD lifetime, battery clear, weather units, first-frame color Bar panel: mute glyph, OSD, battery stall/clear, weather fog/units, first-frame color Sep 21, 2026
@chessing234

Copy link
Copy Markdown
Contributor Author

bar-test accepts plain properties again, and video-background-test matches the braced magick frame syntax.

@llstrk

llstrk commented Sep 28, 2026

Copy link
Copy Markdown

Automated AI review

Community review: Independent automated community review, unaffiliated with the Omarchy team, intended to help prepare PRs for their review.

Follow-up to the earlier review and the author's reply, checked at head 2e84f094.

Verified: the two failing shell tests are resolved. The two new commits change only those two test files. The product code is unchanged, so the other findings from the earlier review still apply, and each is confirmed again on this head (by probe or mutation, and by unchanged source for the bar initial-properties note). The PR now also conflicts with current quattro in shell/shell.qml, and one new detail changes where the charge-limit findings apply (below).

Earlier finding Status at 2e84f094
Two shell tests fail Resolved
Power bar shows a charging glyph for a held pack until the panel is opened Still present
Panel presents an unheld pending-charge pack as charging Still present, and reachable more widely (next section)
Low-battery dismissal runs on every poll after the first episode Still present (20 of 20 polls after an episode, on AC and on battery)
Lower-impact notes (bar initial properties, omarchy-bar-text-color limits, weather unit normalisation) Still present; source unchanged
Optional test notes (weather cycle copy, audio fixtures, GIF case) Still apply; the same mutations still pass

Verified, shell suite: in this review's sandbox, test/shell now fails the same 8 of 245 files as the merge-base (8 of 242). None of the 8 is touched by this PR, and all 8 fail identically on the merge-base (most for sandbox reasons such as a missing omarchy-pkgs checkout). On the earlier head, bar-test.sh and video-background-test.sh were the two extra failures, and both pass now. bar-test.sh still fails if the setSource(url, barInitialProperties(...)) call is removed (through its unchanged loadBar assertion); the rewritten assertion now checks only that Bar.qml declares the three properties. The video-background-test.sh assertion still fails if the [0] frame selector is dropped.

The charge-limit band can come from UPower's preset, not the configured limit

omarchy-battery-status reads the band from upower -i first (charge-start-threshold / charge-end-threshold, lines 65-66) and only falls back to sysfs when those lines are missing (68-69). In UPower's source (1.90.6 and later; 1.90.5 used 60,80), the shipped hwdb assigns CHARGE_LIMIT=75,80 to batteries that expose charge-control threshold attributes. UPower stores those values as the device's threshold properties whether or not its own charge-limit feature is enabled, and upower -i prints them whenever they are above 0. On such hardware the script can print 75-80% whatever the configured limit is.

This PR now uses that band to decide hold versus stall (chargeHoldBand, power/Model.js:86-91). Script and panel-model probe with a stubbed upower printing 75/80, a sysfs charge limit ending at 60%, and a pending-charge pack held at 60%:

Merge-base This head
omarchy-battery-status Holding at 75-80% (wrong band, still a hold) Not charging
Power panel Threshold Charging (glyph, phrases, pulse, "Time to full")

Impact: on hardware where UPower exposes its preset, a pack that reports pending-charge while correctly held by a limit below 75% is reported as "Not charging" by the script and as charging in the panel. The same preset also stops the new below-99% FullyCharged handling from telling a worn pack from a held one. These conclusions come from UPower source and stubbed probes. No live UPower daemon was observed, and how often the preset differs from the configured limit on real machines was not measured.

Suggested change: read the band from the same pack's sysfs charge_control_start_threshold / charge_control_end_threshold first, and use the upower -i values only as a fallback (or only when charge-threshold-enabled is yes).

Merge conflict with current quattro: shell/shell.qml now conflicts in one hunk. Quattro's d3fb028 (#13427) adds property BrightnessKeys brightnessKeys: BrightnessKeys { host: shell } next to the AppLibrary line that this PR changes. Keeping the PR's AppLibrary { shellHost: shell } together with quattro's BrightnessKeys line resolves it. With that resolution, the merged test/shell suite fails the same 14 files as quattro alone. quattro's own video-background-test.sh failure (an unset PREPARED_BACKGROUND_SNAPSHOT under set -u) is not caused by this PR.

Related open PR: #8278 (Celsius/Fahrenheit toggle) also edits weather/Panel.qml, weather/Model.js and weather-test.sh, with a different click behaviour for the degree label: it pins the opposite unit, while this PR cycles three stored values. The two need reconciling if both land.


Review information

Test scope: Source review of head 2e84f094 against the earlier head 181d7f5c, merge-base 2fbac0c8 and current quattro, including a local conflict resolution merged onto quattro. Sandboxed runs of the full test/shell suite on all of them. Node probes of the power, battery and weather models. Targeted mutations and ImageMagick resource checks. UPower threshold behaviour was taken from UPower's source and a stubbed upower. No live Quickshell, UPower or PipeWire session, and panel states were computed from Panel.qml/Model.js formulas rather than rendered.

AI process: Opus 5.5 Medium coordination and synthesis, Opus 5.5 Xhigh technical review and final fact check, GPT 6 Sol Xhigh search for related issues, Opus 5.5 Medium editorial check.

Opt out: To stop receiving these reviews, reply to this comment saying so.

@edgseu

edgseu commented Oct 3, 2026

Copy link
Copy Markdown

@chessing234 I opened chessing234#3 targeting your fold/bar-panel-audio-osd-battery-weather branch to fold #9763 into this meta PR.

Changes & Enhancements Folded from #9763

  1. Charge-Limit Detection & Metric Sanitization (shell/plugins/panels/power/Model.js):

    • Reconciles fix(power): handle PendingDischarge state and sanitize rate metrics for battery charge limits #9763 with the threshold band checks added here (chargeHoldBand):
      • Maps PendingDischarge and non-charging AC states (state 0 / Unknown) to hold states when fraction >= band.floor.
      • Preserves the requirement that an unconfigured limit (!band) never flags holds for stalled charges or worn batteries reporting full early.
    • Guards changeRate and timeToFull calculations with isFinite() checks, preventing missing driver metrics from coercing to 0 <= 0.2 and falsely triggering threshold detection.
  2. Stepped Dynamic Battery Indicator Glyphs (shell/plugins/panels/power/Model.js):

    • Preserves the 10-step depleting battery icon across states instead of falling back to a static full pack.
    • AC charge limit hold: stepped battery level with superscript plus (U+207A ⁺, e.g. 󰂀⁺).
    • AC fully charged: battery-check (󱟢, U+F17E2).
    • On battery (discharging): stepped battery level paired with profile modifier (󰌪 for power-saver, 󰓅 for performance), while balanced remains the clean stepped battery icon.
    • AC active charging: standard charging series (󰢜–󰂅) takes precedence over profile modifiers.
  3. Panel Layout & State Lifecycle (shell/plugins/panels/power/Panel.qml):

    • Maps UPowerDeviceState.PendingDischarge in upowerStates().
    • Adds hasProfileModifier property to dynamically scale slotSize (1.5x without percentage, 2.5x with percentage) and span openPanelIndicatorWidth across glyph bounds.
    • Passes both root.activeProfile and root.batteryInfo.threshold into Model.batteryIcon().
    • Resolves the threshold startup delay by running root.refresh() on Component.onCompleted and UPower.onOnBatteryChanged (addressing the review note where batteryInfo.threshold remained empty until the panel was opened).
    • Adds a 15-second background poll timer for active power profiles while closed.

Verification

  • test/shell.d/power-test.sh: 52 passed, 0 failed (all 35 existing assertions + 17 added assertions covering PendingDischarge, missing rate sanitization, dynamic glyph modifiers, profile case-insensitivity, and QML wiring).
  • test/shell.d/battery-status-test.sh: 8 passed, 0 failed.
  • test/shell.d/battery-clear-on-ac-test.sh: 13 passed, 0 failed.
  • ./test/cli: 107 passed, 0 failed.

If preferred over the GitHub UI PR, the commit can be pulled directly:

git pull https://github.com/edgseu/omarchy.git fold/bar-panel-audio-osd-battery-weather

@greptile-apps

greptile-apps Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 4/5

[Medium impact] The PR changes several parts of the desktop shell, while its effects stay within shell workflows.

Fix clone loading and the repeated dismissal commands before merging; the latter must also satisfy the repository’s background-work rule.

Findings

  1. P1 Bar clones miss initial properties ▶
  2. P2 Battery dismissal never stops ▶
  3. P2 Nightlight checks run inside stub ▶
  4. P2 Tests skip the real helper ▶
  5. P2 Battery checks split across files. ▶

Summary

This PR updates audio icons, battery states and warning dismissal, weather unit controls, app-launch feedback, and bar loading.

  • Cloned bars receive their host values when the shell creates them.
  • Battery displays show when charging has stopped below a configured limit.
  • Cleared low-battery warnings are dismissed from notifications.
  • The weather panel cycles temperature units and saves the choice.
  • The weather command shows a nighttime icon for fog.
  • Audio bar icons reflect mute and the selected device.
  • App launches open feedback through the shell's OSD service.
  • Tests cover bar text sampling and nightlight threshold toggles.

Reviews (5) · Last reviewed commit: "Reuse the CLI translation when dismissin..." · Reviewed by Greptile

Comment thread shell/shell.qml Resolved
Comment thread shell/plugins/panels/weather/Panel.qml Resolved
Comment thread shell/plugins/panels/power/Model.js Resolved
@jandrusk

Copy link
Copy Markdown

Big fold — thanks. Night-light and cloned-bar pieces overlap newer open work (#14530/#14038, #14502/#13794/#13578).

Could this be rebased and/or split so the still-unique bits aren't blocked by those? Test plan checkboxes still open too.

Comment thread shell/shell.qml
}
// Clones of the built-in bar know these properties. Independently
// authored bars may have a different property contract.
var metadata = manifest && manifest.metadata

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.

P1 Bar clones miss initial properties

loadBar reads manifest.metadata.clonedFrom, but omarchy-plugin-clone writes manifest.omarchy.clonedFrom. Real bar clones therefore skip barInitialProperties and receive no properties at construction. A clone that requires those properties still fails to load and falls back to the built-in bar—the case this helper is meant to fix. Read the clone marker from manifest.omarchy.

Suggested change
var metadata = manifest && manifest.metadata
var metadata = manifest && manifest.omarchy

Comment on lines +126 to +130
toggle_from() {
printf '%s\n' "$1" >"$STATE"
nightlight_cli >/dev/null
cat "$STATE"
}

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.

P2 Nightlight checks run inside stub

The new temperature checks are inside the heredoc that writes the fake sleep command, not in the test itself. When that command runs, it lacks the test’s functions and variables, so these checks cannot enforce their assertions. The test can pass without checking the added temperature cases. Move the block below the closing SH delimiter.

Comment on lines +14 to +24
# Pure bash cycle checks mirroring Model.nextTempUnitOverride
next_for() {
case "$1" in
metric) echo imperial ;;
imperial) echo "" ;;
*) echo metric ;;
esac
}
[[ $(next_for "") == "metric" ]] || fail "auto cycles to metric"
[[ $(next_for metric) == "imperial" ]] || fail "metric cycles to imperial"
[[ $(next_for imperial) == "" ]] || fail "imperial cycles back to auto"

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.

P2 Tests skip the real helper

These checks test a Bash copy of the temperature cycle rather than Model.nextTempUnitOverride, so breaking the real helper leaves them green. This violates AGENTS.md: “Don't restate the implementation” and “Don't test your own stub.” The source-string checks here, in audio-test.sh, and in plugin-clone-test.sh follow the same pattern elsewhere.

Call the real helper from the existing weather suite and test behavior instead. This repository requirement must be satisfied before merging.

File Used: AGENTS.md (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Comment on lines +4 to +7
run_node_test <<'JS'
const fs = require('fs')
const vm = require('vm')
const qml = fs.readFileSync(path.join(root, 'shell/plugins/services/battery/Service.qml'), 'utf8')

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.

P2 Battery checks split across files. battery-clear-on-ac-test.sh adds a separate suite even though battery-test.sh already tests low-battery warnings and recovery. AGENTS.md requires: “Extend the area's existing test file … rather than adding a new *-test.sh.” Move these cases into the existing battery suite to keep related checks together.

File Used: AGENTS.md (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Comment on lines +52 to +54
// Dismissal can precede notification insertion or time out silently. Keep
// retrying on the existing poll until a new low-battery episode starts.
if (root.lowBatteryClearPending) clearLowBatteryWarning()

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.

P2 Battery dismissal never stops. After a low-battery warning is cleared on AC, lowBatteryClearPending stays true until another low-battery episode. Every 30-second poll therefore starts another dismissal command, even after the warning has expired or been dismissed successfully.

AGENTS.md requires long-running code to react to events rather than poll when possible. Clear the pending flag after success, and bound retries for a delayed notification instead of retrying throughout the charging session.

File Used: AGENTS.md (source)

@omarchybot omarchybot added enhancement New feature or request and removed enhancement New feature or request labels Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants