Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create vertical layout option #11

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

mhkeller
Copy link

@mhkeller mhkeller commented Apr 8, 2023

#9 Creates an option in settings to have a vertical layout, similar to Dark Sky

Here's a first go at it. Needs more mobile testing and check if the math is right aligning the times alongside the vertical bar and that the temperatures are scaled correctly.

Let me know what you think.

Screen Shot 2023-04-08 at 1 15 10 AM

@mhkeller
Copy link
Author

mhkeller commented Apr 8, 2023

I'm playing around with some details for aligning the weather timestamps to the vertical bar. In Dark Sky, it appears that the timestamp falls near the middle of that bar. So hours 8am and 10am are labeled and rain starts at 9am the blue bar will start halfway between 8am and 10am. Setting a height of 100 / 12 sets the label a little differently. I'm trying to get it to align center without throwing off the first label... Work in progress...

@mhkeller
Copy link
Author

mhkeller commented Apr 8, 2023

@vsergeev I think it's ready for you to take a look. Let me know what you think:
Screen Shot 2023-04-08 at 4 35 34 PM

@vsergeev
Copy link
Owner

@mhkeller thanks, this looks like a good start. I have a couple of feedback items:

  • I think it would look better at 80% width and centered
  • The temperature pills aren't centered with the line for me
  • I'd like to avoid any fixed pixel heights on containers (e.g. height: 525px for the container in HourlyDetails)
  • Commit 9679c95 appears to remove text colors and drop shadows, which breaks the formatting on the horizontal view. (Why were these deleted?)
  • No need to commit the production bundle -- I can do that on an actual release with a version number change

The commits can also be squashed down into two commits, one that adds the layout setting (first commit), and one that adds the vertical layout.

@mhkeller
Copy link
Author

Woops on 9679c95. I'll revert that and work on the other items. For the height, what would you prefer, something like 80vh / 90vh / 100vh?

I noticed that there is no sunrise / sunset information for the current day anymore because that is only in the expandable component. I'll add those elements to the text information at the top.

@vsergeev
Copy link
Owner

Yeah, I think a relative view height would be good in place of the fixed height.

@mhkeller mhkeller force-pushed the vertical-layout branch 2 times, most recently from b715171 to 899cf36 Compare April 15, 2023 04:24
@mhkeller
Copy link
Author

mhkeller commented Apr 15, 2023

Some updates:

The temperature pills aren't centered with the line for me

This should be fixed.

I'd like to avoid any fixed pixel heights on containers (e.g. height: 525px for the container in HourlyDetails)

Fixed. Removing the height seemed to work fine.

Commit 9679c95 appears to remove text colors and drop shadows, which breaks the formatting on the horizontal view. (Why were these deleted?)

Fixed

No need to commit the production bundle -- I can do that on an actual release with a version number change

Fixed

The commits can also be squashed down into two commits, one that adds the layout setting (first commit), and one that adds the vertical layout.

Fixed

I think it would look better at 80% width and centered

This is the only thing that didn't work out well.The width becomes too narrow for there to be much variation on the temperature scale. Here's a screenshot.
IMG_2964

Separately:

I added the sunrise and sunset times back and I standardized their look between the two components.

@mhkeller
Copy link
Author

I increased the padding in some places for better tap accessibility and lightened up the temperature range so it's more easily scannable to the eye.

@mhkeller
Copy link
Author

One other thing that's missing from today's view is when it's raining, it should display the Precipitation and Amount fields.

Copy link
Owner

@vsergeev vsergeev left a comment

Choose a reason for hiding this comment

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

This PR introduces unrelated changes and breaks the default color scheme and formatting. I think it's headed in the right direction overall, but I have to emphasize that the PR should have absolutely no impact on the rest of the app or to the existing horizontal layout. It also shouldn't try to incorporate new features that are outside the scope of the PR ("Create vertical layout option").

High level feedback:

  • Adding precipitation and sunrise/sunset information to the top details should be a separate discussion and possibly PR. In it's current form, I'm not willing to add those fields because they're poorly formatted on desktop with two line rows that impair the readability of the other fields, and it's an open question whether these fields here add to the app or compromise its simplicity.
  • For the width, we can use a media query to be 100% in mobile and 75% on desktop, so it's easy to read the vertical layout on both (without excessive left-right eye scanning on desktop).
  • The temperature pills are vertically aligned with the lines, but I think it would look better if the hour and description on the left were vertically aligned with the lines too.
  • Please compare the effect of your branch with the current deployment in both mobile and desktop. There are some regressions -- I've attached two screenshots as examples:

Original:
before

This Branch:
after

@@ -4,7 +4,7 @@
"version": "1.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"dev": "vite --host",
Copy link
Owner

Choose a reason for hiding this comment

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

This doesn't belong in this commit or PR.

Copy link
Author

Choose a reason for hiding this comment

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

This is just to help test and can be removed before the final merge


{#if precipitation.precipitation_probability !== undefined && precipitation.precipitation_amount !== undefined}
<div>
<span class="text-sm md:text-base font-semibold">Precipitation:</span> <span class="text-sm md:text-base">{precipitation.precipitation_probability}%</span>
Copy link
Owner

Choose a reason for hiding this comment

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

These line indents need to be normalized. You can run npm run format to format automatically.

@@ -19,7 +19,7 @@
<div class="text-right min-w-fit" style="min-width: {margin_left === 0 ? 'min-content' : `${margin_left}%`};">
<Temperature value={low} />
</div>
<div class="bg-gray-800 dark:bg-gray-400 my-0.5 mx-1.5 rounded-xl" style="width: {100 - margin_right - margin_left}%;" />
<div class="bg-gray-400 dark:bg-gray-400 my-0.5 mx-1.5 rounded-xl" style="width: {100 - margin_right - margin_left}%;" />
Copy link
Owner

Choose a reason for hiding this comment

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

This change affects the default color scheme...

Copy link
Author

Choose a reason for hiding this comment

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

I'll put this in a separate PR

@@ -74,6 +74,15 @@ export interface ProviderFactory {
fromParams(params: object, location?: Location): Provider | null;
}

export interface SunTimes {
Copy link
Owner

Choose a reason for hiding this comment

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

Types here should be limited to the boundary between the backend provider and the frontend, not auxiliary types for components. I think those components are simple enough that they aren't really necessary, anyway.

@mhkeller
Copy link
Author

Sure thing. I incorporated some accessibility and duplicate content fixes that I encountered but can create new issues for those. I can explain the reasoning for them in those issues and would be in favor of including them since there is some duplicate information that would adversely affect the UX for the vertical layout.

@mhkeller
Copy link
Author

The temperature pills are vertically aligned with the lines, but I think it would look better if the hour and description on the left were vertically aligned with the lines too.

Can you explain what you mean by this? Do you mean the horizontal line looks like it's not at the centerline of the text? Maybe you can send a screenshot of what you're seeing so I can make sure the fix is getting at the right thing.

@vsergeev
Copy link
Owner

The temperature pills are vertically aligned with the lines, but I think it would look better if the hour and description on the left were vertically aligned with the lines too.

Can you explain what you mean by this? Do you mean the horizontal line looks like it's not at the centerline of the text? Maybe you can send a screenshot of what you're seeing so I can make sure the fix is getting at the right thing.

I think so. Sure, here is a screenshot:

alignment

@mhkeller
Copy link
Author

Got it. Yea that looks different from mine. What browser and OS are you using so I can try to replicate?

@vsergeev
Copy link
Owner

Got it. Yea that looks different from mine. What browser and OS are you using so I can try to replicate?

I'm using Firefox 111 on Linux. I see it in Google Chrome 111 too.

@vsergeev
Copy link
Owner

I've added a View tab to the Settings on master, which will be a better place for a layout option like this.

@vsergeev vsergeev force-pushed the master branch 2 times, most recently from 6ba04fc to 91e8eef Compare June 28, 2023 06:57
@msft-jeelpatel
Copy link

msft-jeelpatel commented Jan 14, 2024

The temperature pills are vertically aligned with the lines, but I think it would look better if the hour and description on the left were vertically aligned with the lines too.

Can you explain what you mean by this? Do you mean the horizontal line looks like it's not at the centerline of the text? Maybe you can send a screenshot of what you're seeing so I can make sure the fix is getting at the right thing.

I think so. Sure, here is a screenshot:

alignment

Hi @mhkeller. Were you able to address this?

@mhkeller
Copy link
Author

@msft-jeelpatel, I didn't have the bandwidth to test this out since it was fine on my machine and I don't a Linux to test on. I won't have the time to finish this PR but if someone wants to pick it up, feel free to! I'll close this and if someone wants to resurrect it, then by all means they should

@mhkeller mhkeller closed this Jan 14, 2024
@mhkeller mhkeller reopened this Jan 23, 2024
@mhkeller
Copy link
Author

Reopening if other ppl want to work on it

@patel-jeel92
Copy link

Reopening if other ppl want to work on it

I wish I knew how to fix some of the layout issues :/.

For example, the "Now" starts at the very top of the weather bar
image

Compared to DarkSky it looked like there was equal padding at the top and bottom. Currently, since the "Now" starts at the very top margin of the weather bar, there is quite a lot of unused space at the bottom

image

Other than that, I can try taking this forward

@vsergeev
Copy link
Owner

@patel-jeel92 I can help with some of the formatting issues to get this PR to the finish line.

@patel-jeel92
Copy link

Hi @vsergeev I have started a new PR #21 to add the vertical layout. The reason i chose to add a new PR is because i have forked the repo and created a new branch off of it. Plus this had a bunch on conflicts and i found it easier to start over.

Huge thanks to @mhkeller for starting the initial work!

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