webstudio-is / webstudio

Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.
https://webstudio.is
GNU Affero General Public License v3.0
5.4k stars 664 forks source link

Warn users when combining min and max width breakpoints #4209

Open johnsicili opened 1 month ago

johnsicili commented 1 month ago

As a user, I should be warned about the impending complexity I'll add to my site when adding a breakpoint with a direction that is different than my existing ones (e.g. selecting min-width when my current is max-width).

Screenshot 2024-10-03 at 9 09 51 AM

I often open users sites and see the base breakpoint in the middle of the default breakpoints and custom breakpoints. I can't even comprehend designing a site this way and assume its by mistake on most if not all sites. Is there a use case for this?

Todo

TrySound commented 1 month ago

Probably not coincidence. The guy told me copy paste from webflow leads to such breakpoints.

kof commented 1 month ago

Shouldn't be, webflow's breakpoints should match ours

TrySound commented 1 month ago

Looks like we add xl in some cases image

TrySound commented 1 month ago

Yep, that's webflow 🤷 image

kof commented 1 month ago

I don't see whats wrong. This is exactly how it works in webflow, large breakpoints are min-width, default once are max-width.

kof commented 1 month ago

We add breakpoints when pasted elements use them.

kof commented 1 month ago

@johnsicili when user copies breakpoints from webflow, they already copy decisions made there, so its not up to us. Webflow doensn't encourage using extended breakpoints, they are off by default. I don't see why we should be warning them.

kof commented 1 month ago

The only problem is when they change breakpoints in webstudio and THEN also copy the once from webflow - then someone will be in a world of pain but that's somewhat difficult to warn.

MAybe when a 5th+ breakpoint is getting added, start warning them every time a new breakpoint is being created?

johnsicili commented 1 month ago

Odd, I've opened a lot of projects and the 1440 was actually to the right of base. But yeah lots with 1440 to the left too and I didn't realize it's from Webflow paste.

I would bypass a warning if pasting (or use this feature https://github.com/webstudio-is/webstudio/issues/3442) but if they manually create one then it seems sensible to warn them. Then again, there are a gazillion things they can do that'll make their life harder and we aren't putting warnings all over.

Those are my thoughts feel free to do what you want with this issue.

kof commented 1 month ago

It must be users changed it from min-width to max width

kof commented 1 month ago

I mean its ok to warn once when first the breakpoint gets created on paste, once its created its not going to warn any more because its not going to be new. When user creates one manually, its actually pointless to warn, they are intentionally doing it

kof commented 1 month ago

At max we can show a hint in the breakpoints editor popover that we don't recommend creating more than X breakpoints beause of xyz, yellow triangle.

So user that wants to create more gets the idea.

johnsicili commented 1 month ago

Yellow triangle sounds good. Also I disagree about not warning them if they manually do it. Users will do anything they can and not all know the implications.

Here's a real site:

Pasted Graphic

kof commented 1 month ago

@johnsicili that screenshot is madness, if someone is doing it they will not be able to use the platform overall. Also we should probably limit the total amount just for someone like this to lets say 10 or something