Skip to content

feat(weather): enable CSS ordering for forecast and hourly columns - #4118

Merged
khassel merged 6 commits into
MagicMirrorOrg:developfrom
MannXo:fix/4117-weather-forecast-column-order
Sep 12, 2026
Merged

khassel merged 6 commits into
MagicMirrorOrg:developfrom
MannXo:fix/4117-weather-forecast-column-order

Conversation

@MannXo

@MannXo MannXo commented Apr 21, 2026

Copy link
Copy Markdown

The daily forecast previously displayed its columns in a fixed order that did not match the order requested in the issue.

This PR makes the forecast column order configurable through CSS custom properties. The default order is now:

condition, min temp (low), max temp (high), UV Index, precipitation amount, precipitation probability

The hourly forecast is updated to use the same approach, with its own configurable column order.

Fixes #4117

forecast before

Ekrankopio de 2026-09-12 23-48-38 image

forecast after

Ekrankopio de 2026-09-12 23-47-47 image

hourly before

Ekrankopio de 2026-09-12 23-49-12

hourly after

Ekrankopio de 2026-09-12 23-49-28

Note: The PR was updated based on reviews, and the PR text was updated accordingly.

@KristjanESPERANTO

Copy link
Copy Markdown
Collaborator

Thanks for the PR! Can you attach a before and after screenshot?

@rejas

rejas commented Apr 22, 2026

Copy link
Copy Markdown
Collaborator

I am not sure if changing the order is a good idea. Our users are used to how this is ordered now, changing it might confuse some...

But I am willing to see the change in screenshots, before making up my mind finally...

@KristjanESPERANTO

Copy link
Copy Markdown
Collaborator

@MannXo Did you noticed the request for screenshots? 🙂

@MannXo

MannXo commented May 4, 2026

Copy link
Copy Markdown
Author

@KristjanESPERANTO thank you for the reminder.
the before after screenshots are attached.
after
before

@KristjanESPERANTO

Copy link
Copy Markdown
Collaborator

@MannXo Thanks for the screenshots 🙂 Please mark which is which. I think the first is the "after" one, right?

@MannXo

MannXo commented May 5, 2026

Copy link
Copy Markdown
Author

@KristjanESPERANTO indeed.
First one is the "after" and second one is "before"

@KristjanESPERANTO
KristjanESPERANTO requested a review from rejas May 6, 2026 07:18
@KristjanESPERANTO

Copy link
Copy Markdown
Collaborator

@rejas What do you think?

@rejas

rejas commented May 19, 2026

Copy link
Copy Markdown
Collaborator

Sorry for my late answer... Thanks fro your PR. I could see something like this merged, IF we could make the order configurable. So that people could arrange them to their likings. Maybe using a flex order css property would be the solution (so people could change that order via custom css)
@MannXo are you comfortable trying something like this out? Or how good are your css skills?

@KristjanESPERANTO

Copy link
Copy Markdown
Collaborator

@MannXo Did you noticed the last comment? 🙂

@MannXo

MannXo commented Jun 10, 2026

Copy link
Copy Markdown
Author

@KristjanESPERANTO I feel I can do that. shall I create an issue for it first? or shall I just revert my commits on this branch and implement the flex?

@KristjanESPERANTO

Copy link
Copy Markdown
Collaborator

I think it would be best to do it in this PR here. When we merge, we'll squash all the commits into one, so you don't have to worry too much about keeping the Git history clean 🙂

@MannXo

MannXo commented Jun 14, 2026

Copy link
Copy Markdown
Author

@rejas @KristjanESPERANTO
I updated this PR to make the forecast column order configurable via CSS.

The forecast table now has a weather-forecast class, and each forecast cell has a default order value backed by CSS variables, so users can override the visual order from custom.css without changing the module template.
I also added an e2e assertion for the CSS order hooks.

example:

.weather .weather-forecast {
  --weather-forecast-min-temp-order: 4;
  --weather-forecast-max-temp-order: 3;
}

@KristjanESPERANTO

KristjanESPERANTO commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the updated approach 👏

Two concerns though:

  1. display: flex on <tr>
    order is only defined for flex/grid items, so applying flex to a table row to make it work feels a bit hacky. Since the table has no <th> headers anyway, a <div>-based flex layout might be the cleaner path forward.

  2. Order-dependent padding
    min-temp loses padding-left, max-temp gains it. That works for the new default, but breaks as soon as someone actually swaps the order via the CSS variables. Padding should be independent of position.

What do you think?

@KristjanESPERANTO

Copy link
Copy Markdown
Collaborator

@MannXo Did you noticed my comment? 🙂

@KristjanESPERANTO KristjanESPERANTO self-assigned this Sep 12, 2026
@KristjanESPERANTO
KristjanESPERANTO force-pushed the fix/4117-weather-forecast-column-order branch from 1e4c168 to 4c0a3a5 Compare September 12, 2026 21:42
@KristjanESPERANTO

Copy link
Copy Markdown
Collaborator

Okay, I decided to take this on myself since there hasn’t been any response from @MannXo so far.

Migrating the forecast layout to CSS Grid was a bit tricky, but I think the result is now clean and stable. For consistency, I adapted the hourly view as well.

I added screenshots into the PR text.

While checking the current view, I noticed that an incorrect <td> element was being used, so I replaced it with a proper <div>. That is a bit out of scope, but too small for a separate PR.

@KristjanESPERANTO KristjanESPERANTO changed the title fix(weather): reorder daily forecast columns feat(weather): enable CSS ordering for forecast and hourly columns Sep 12, 2026
@khassel
khassel merged commit 3314eaf into MagicMirrorOrg:develop Sep 12, 2026
13 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.

4 participants