Skip to content

Let a click on °C/°F pin metric, imperial, or auto - #8898

Closed
chessing234 wants to merge 3 commits into
omacom:quattrofrom
chessing234:fix/omarchy-weather-unit-override
Closed

chessing234 wants to merge 3 commits into
omacom:quattrofrom
chessing234:fix/omarchy-weather-unit-override

Conversation

@chessing234

@chessing234 chessing234 commented Aug 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Timezone / reported-country changes can flip the weather unit with no UI escape hatch, even though shell.json already accepts a unit override.
  • Clicking the °C/°F label now cycles auto → metric → imperial → auto and persists via updateEntryInline.

Fixes #8690.

Test plan

  • bash test/shell.d/weather-unit-cycle-test.sh
  • Open weather panel, click the unit letter, confirm it pins and survives a shell restart

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.
Copilot AI balanced review requested due to automatic review settings August 29, 2026 06:41

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 a persistent weather-unit selector that cycles between automatic, metric, and imperial modes.

Changes:

  • Adds unit cycling and persistence.
  • Makes the temperature-unit label clickable.
  • Adds cycle tests.

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 3 changed files in this pull request and generated 3 comments.

File Description
shell/plugins/panels/weather/Panel.qml Adds the unit control and persistence.
shell/plugins/panels/weather/Model.js Implements the cycle sequence.
test/shell.d/weather-unit-cycle-test.sh Adds cycle checks.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.



function nextTempUnitOverride(current) {
var unit = String(current || "")
anchors.margins: -Style.space(4)
cursorShape: Qt.PointingHandCursor
enabled: !!root.current
onClicked: root.cycleTempUnit()
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"
@chessing234

Copy link
Copy Markdown
Contributor Author

@dhh @ryanrhughes ready for review

@chessing234

Copy link
Copy Markdown
Contributor Author

folding into #12115 with the other bar panel fixes

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.

Timezone changes weather unit too

2 participants