Skip to content

Fix weather widget details not showing until manually toggled - #2335

Merged
lissy93 merged 2 commits into
lissy93:masterfrom
jamalkamaladdin:fix/903-weather-hide-details
Sep 5, 2026
Merged

lissy93 merged 2 commits into
lissy93:masterfrom
jamalkamaladdin:fix/903-weather-hide-details

Conversation

@jamalkamaladdin

Copy link
Copy Markdown
Contributor

Fixes #903

Root cause

Weather.vue initialized showDetails as a hardcoded false, completely
independent of the hideDetails option. The options.hideDetails value was
only used to decide whether to build the weatherDetails array
(processData, line 89), not whether to display it. As a result, even when
hideDetails: false was set (or left at its documented default), the
details section stayed hidden until the user manually clicked the
"show more" toggle button — which is what issue #903 reports.

Per docs/widgets.md: "If set to true, the additional details (wind,
humidity, pressure, etc) will not be shown. Defaults to false" — i.e. by
default, details are supposed to be visible without any interaction.

Fix

Initialize showDetails from !this.options.hideDetails instead of a
hardcoded false. This is a one-line change:

  • hideDetails unset or false (the documented default) -> details show
    immediately, matching the docs.
  • hideDetails: true -> weatherDetails is never populated (unchanged
    existing behavior), so nothing renders regardless.
  • The manual show/hide toggle button still works exactly as before in both
    cases.

Testing

Added tests/components/widgets/weather.test.js covering:

  • details show immediately when hideDetails is unset
  • details show immediately when hideDetails: false
  • details never show when hideDetails: true
  • the toggle button still hides/shows details on click

Confirmed the new tests fail against the old code (3 of 4 fail) and pass
after the fix. Full existing suite (vitest run) and eslint remain green.

@netlify

netlify Bot commented Sep 5, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for dashy-dev ready!

Name Link
🔨 Latest commit 69a76e6
🔍 Latest deploy log https://app.netlify.com/projects/dashy-dev/deploys/6a9c6b4e872fa3000810caae
😎 Deploy Preview https://deploy-preview-2335--dashy-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

showDetails was hardcoded to false regardless of the hideDetails
option, so details only appeared after manually clicking the toggle
button. Initialize showDetails from !options.hideDetails so details
show immediately whenever hideDetails is false (its documented
default), matching docs/widgets.md. hideDetails: true keeps hiding
them as before.

Fixes lissy93#903
@jamalkamaladdin
jamalkamaladdin force-pushed the fix/903-weather-hide-details branch from ec8b1b5 to e30b5e9 Compare September 5, 2026 15:23

@lissy93 lissy93 left a comment

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.

Thanks @jamalkamaladdin
Mostly LGTM, except I don't think that we need 63 lines of tests for a 1-line easy change.

description: null,
temp: null,
showDetails: false,
showDetails: !this.options.hideDetails,

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.

👍

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.

I don't think we need these tests, they seem too rigid to be useful, and are only going to break in unhelpful ways next time we update the widget.

@jamalkamaladdin

jamalkamaladdin commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor Author

Done

@lissy93
lissy93 merged commit a2dcb8a into lissy93:master Sep 5, 2026
16 checks 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.

Weather widget hide-details not working

2 participants