News for hackers. Stuff that matters.
Re:You don't need a modal window by usrbinbash on Wednesday May 24, 2023 @08:54AM (#36057330)
> This will worsen the UX more often than not. Guaranteed.

The article states very clearly the use cases for which modals make sense:

    Modal windows can be used for views that don't constitute a "resource" or correspond to a domain entity:
    
    - Alerts
    - Confirmation dialogs
    - Forms for creating/updating entities
As soon as something is a resource, that is, an article to read, a picture to watch, a diagram to open, a sound to play, in short anything for which it makes sense that it should be reachable via an URI, a modal is the wrong choice.
Re:You don't need a modal window by horsawlarway on Wednesday May 24, 2023 @09:37AM (#36057854)
> As soon as something is a resource, that is, an article to read, a picture to watch, a diagram to open, a sound to play, in short anything for which it makes sense that it should be reachable via an URI, a modal is the wrong choice.

These feel incredibly unrelated to me. Why does that matter at all for the display choice? A modal is getting used because it's a view into another section of the application that doesn't lose the current location of the user.

Further - users (and I mean normal paying users, not HN commentators) rarely ever give a shit about URLs. It's just not important to most people what the string of characters is.

So...

Anywhere you've got multiple steps to complete, or an adjacent resource that might be related and viewed/edited in the context of the parent resource.

Or a form is being filled in and a user wants to enable extras, which requires filling in a different form, etc...

The modal is about not losing the current place for the user. Because most current users don't use multiple tabs/windows for the same product, and they don't pay any attention to the urls.

"Dont open a modal" in cases where the user is likely going to get lost in a detour otherwise is bad advice.

Re:You don't need a modal window by scbrg on Wednesday May 24, 2023 @09:42AM (#36057939)
> Further - users (and I mean normal paying users, not HN commentators) rarely ever give a shit about URLs. It's just not important to most people what the string of characters is.

This is not correct. Normal users have learned that if they copy that URL thingie, and send it to someone else, that someone else will see the same thing they see now.

I don't know how many times I've received a link from someone saying "lol look at this hilarious dog" and ended up on some useless overview page completely devoid of hilarious dogs. Because some fucking designer decided to do exactly what TFA is complaining about.

Re:You don't need a modal window by mock-possum on Wednesday May 24, 2023 @10:14AM (#36058373)
Fair, but there’s no reason a URL can’t resolve to a landing page and already open modal state populated with the content the other person shared to you. Deeplinking / permalinking works just as well with modals as it does with anchor named content blocks below the fold.
Re:You don't need a modal window by usrbinbash on Wednesday May 24, 2023 @11:02AM (#36059103)
> ut there’s no reason a URL can’t resolve to a landing page and already open modal state populated with the content the other person shared to you.

I can think of 2 very good reasons right away:

1. It increases the complexity of the webpage

2. It makes it impossible to simply download or integrate the resource elsewhere

Re:You don't need a modal window by zelphirkalt on Wednesday May 24, 2023 @11:06AM (#36059180)
Sure, if you want to put in the effort to make it work. Most however don't and then their websites suck in that regard.
Re:You don't need a modal window by avisser on Wednesday May 24, 2023 @11:15AM (#36059297)
Permalinking has worked since Netscape 1.0 w/o any code from the developer. Why fight the system?
Re:You don't need a modal window by Brian_K_White on Wednesday May 24, 2023 @11:23AM (#36059387)
So, something can intrinsically work by default, or it can possibly work only when and if you go out of your way to make it work. Two totally equal choices!
Re:You don't need a modal window by horsawlarway on Wednesday May 24, 2023 @03:47PM (#36063065)
> Two totally equal choices!

No, because in the one that intrinsically works, you're losing the user's context by navigating them away.

Which is what the modal is good for.

Whether that's worth it is a discussion, but at least this part of it is trivially easy to implement.

Re:You don't need a modal window by usrbinbash on Thursday May 25, 2023 @06:31AM (#36068995)
> you're losing the user's context

We're talking about BOOKMARKS, so what context do we lose? The users browsers home screen?

Re:You don't need a modal window by usrbinbash on Wednesday May 24, 2023 @11:08AM (#36059195)
> Further - users (and I mean normal paying users, not HN commentators) rarely ever give a shit about URLs.

Tell that to my non-techy spouse and her +1400 bookmarks. You know what her most recent rant was about? That she cannot bookmark certain timetables at a booking platform she uses. Why? Because guess what: The timetable shows in a modal.

> The modal is about not losing the current place for the user.

Resources opening in tabs also don't lose the place of the user. But you know what modals do usually lose the user? The ability to interact with anything but the model while it's open. A usual gem is a form which opens a modal, where I would then really really like to copypaste some info I already entered in another part of the form, but can't, because the effing modal is in the way. So I have to close it, and that usually wipes all the info in it.

> "Dont open a modal" in cases where the user is likely going to get lost in a detour otherwise is bad advice.

If a web design can cause the user to get lost in the first place, then the problem isn't that there is no modal, and adding one will likely not fix it.

Re:You don't need a modal window by hombre_fatal on Wednesday May 24, 2023 @11:24AM (#36059402)
Once again, these sound like issues with poorly done modals.

I've made multiple websites where URLs are routed to modals because the app made most sense as pages on top of an underlying state. GET /things/42/edit loads thing#42 in the background and opens the edit modal prefilled with thing#42's info.

A more obvious example is /login and /register in a modal, a cherry on top if logging in or registering doesn't reset app state if the user decides to register halfway through a task.

Preserving form data during navigation is something you have to consider for any form, even forms on the same page or separate pages where you don't want the form to clear when the user navigates away. One key design principle of modals is to make them mentally cheap to open/close/reopen, and modal state preservation is usually a part of that.

Re:You don't need a modal window by usrbinbash on Wednesday May 24, 2023 @11:39AM (#36059622)
> A more obvious example is /login and /register in a modal, a cherry on top if logging in or registering doesn't reset app state if the user decides to register halfway through a task.

That cherry on top can be just as easily implemented by opening the /login in a new tab. Auth gets set, there, user is logged in even in the old tab, and doesn't lose his position in the page either.

Added cherry on top of that: If the user decides to log into the page halfway through the application, he can still bookmark the login page.

The same is true for almost every other use case of a modal where it displays a resource.

Tabs are builtin capabilities of the browser. Even terminal browsers like w3m support tabs. Why built something else that can be built poorly, instead of using what the browser already can do?

Re:You don't need a modal window by hombre_fatal on Wednesday May 24, 2023 @01:02PM (#36060989)
In your example, the work in progress page traditionally never gets to know that the user logged in until the user refreshes that page. That is exactly the status quo UX that sucks.
Re:You don't need a modal window by usrbinbash on Wednesday May 24, 2023 @01:49PM (#36061662)
> until the user refreshes that page

Funny enough, a page-refresh is usually what happens, after I fill in a login form that appears in a modal.

But even if it doesn't do that: If the page is reachable without logging in, then what relevant information is there on the page to display to the user that is both so important that it immediately needs to appear on login, and so unimportant that it doesn't justify requiring a refresh?

And on the off chance that the use case actually requires that, what specific advantage does a modal confer over two input fields (Username, Password), tucked discreetly along a "Login" Button into the navbar?

Re:You don't need a modal window by hombre_fatal on Wednesday May 24, 2023 @02:05PM (#36061880)
Like all UX, the best solution depends on a multivariate consideration which is why you cannot dismiss modals with zero consideration.

For example, a username/password in the navbar can make a lot of sense. If it's slightly more complicated than that, like if login has multiple screens (e.g. 2fa token, maybe SSO), then a modal can make sense.

On a mobile screen, having username/password in your hamburger slide-out menu isn't automatically superior to extracting it into a modal.

> If the page is reachable without logging in, then what relevant information is there on the page to display to the user that is both so important that it immediately needs to appear on login, and so unimportant that it doesn't justify requiring a refresh

I can think of a lot of examples where this can polish the experience.

Once again, I'm brought back to the airline checkout process where you might have almost finished booking a flight but you want to get flight rewards and autofill your contact info at the last step and realize you want to log in.

Games are another example -- I've built a modal-based UI for a large casino where there's always a round-based game going on. Guests can watch it. They can login to play. Deposit, FAQ, player profiles, game history, etc. are all cheap interactions that users can view and dismiss while participating in the global game without losing their state. At any moment they can login which enhances most of the pages with additional content.

Fwiw, I'm arguing that modal should be a tool in one's UX toolbox, not something you use all the time.

Re:You don't need a modal window by GoblinSlayer on Thursday May 25, 2023 @06:03AM (#36068832)
You can polish authentication by not requiring it every day, not with a modal.
Re:You don't need a modal window by kwhitefoot on Wednesday May 24, 2023 @12:11PM (#36060151)
> these sound like issues with poorly done modals.

There is no other kind. The whole idea of modal window is stupid. It constrains the user instead of empowering them.

Solve the server's problems some other way that doesn't impact the user.

These days almost everything is a single page application so instead of opening a modal window just expand the button that would have opened the window inline instead.

> One key design principle of modals is to make them mentally cheap to open/close/reopen

Cheap for whom?

Re:You don't need a modal window by hombre_fatal on Wednesday May 24, 2023 @01:04PM (#36061022)
Modal can enhance UX. I've given examples in my post including an answer to your "Cheaper for whom?"

I don't think it's a good argument, you could also just use your own argument against you: Pages are only easy for developers but worse for users since you don't have to polish the UX in the way that a modal lets you. It's for developers that don't want to have to think about UX optimizations and defer everything to out of the box browser experiences. Which, granted, might be the best choice for everyone who doesn't want to think about UX.

But I find that to be an empty claim.

> These days almost everything is a single page application so instead of opening a modal window just expand the button that would have opened the window inline instead.

That is often a good choice. However, sometimes a modal makes more sense for an all-or-nothing task, or when the user is already in one of those "expando" forms, or a number of other occasions worth pondering for your app instead of dismissing modals without discretion.

Knowing when a modal does and does not make sense is part of a good intuition about UX.

Re:You don't need a modal window by ricardobeat on Wednesday May 24, 2023 @12:39PM (#36060626)
> URLs are routed to modals

In this current age, this usually means an SPA that will first load the underlying page, then the entire application bundle, start up the JS, detect the route, load the data for the modal over another request, and finally display the modal. In the multiple seconds this is happening, nothing indicates that a modal will be opened. Sounds familiar?

Re:You don't need a modal window by hombre_fatal on Wednesday May 24, 2023 @01:01PM (#36060974)
You can think up poor implementations of everything. It's not a reason to not do something better.
Re:You don't need a modal window by ricardobeat on Wednesday May 24, 2023 @05:43PM (#36064249)
Problem is, this is the standard, not a particularly poor implementation. I don't even know where to find an example that shows UI feedback before the modal is loaded.
Re:You don't need a modal window by smeagull on Wednesday May 24, 2023 @09:36AM (#36057848)
And it's wrong about all of them.

Alerts don't need to stop the world.

Confirmation dialogs block examining the things that you want to confirm.

And forms for creating anything do not need to block access to the rest of the page.

Re:You don't need a modal window by SoftTalker on Wednesday May 24, 2023 @11:04AM (#36059134)
I tend to agree. Modals are just contextually different things and even if some/most of your users understand that it's extra cognative load that may not be required for what the app or web page is doing.

Such questions as "if I close this modal is that different from using the cancel button?" should not even need to be dealt with by the user.

Re:You don't need a modal window by usrbinbash on Wednesday May 24, 2023 @11:27AM (#36059455)
I agree, and I also don't think that modals should be used for these things. I merely also agree with the article that these are use cases when a modal "can" be used. It still isn't a good solution, but at least it doesn't actively hurt my ability to access a resource.
Re:You don't need a modal window by wizofaus on Wednesday May 24, 2023 @03:22PM (#36062793)
Except I've seen countless times that users ignore stuff if they can, including important warnings etc. Ideally confirmations should be kept to a minimum anyway (and instead ensure all actions are reversible), but in cases that's not possible I'd rather have a confirmation show in a modal where I can at least see the page/context it's referring to (and it goes without saying, all modals should be draggable, even for touchscreen devices) than a separate page entirely. And if an action can't be performed then I'd much rather see the reason why in a modal window that grabs my attention and forces me to acknowledge it than a button that appears to do nothing but cause some easy-to-miss message show up elsewhere on the page.
Re:You don't need a modal window by smeagull on Wednesday May 31, 2023 @08:24PM (#36146261)
> users ignore stuff if they can, including important warnings etc.

They sure do. Especially modal dialogs. Everybody has been trained to hit okay automatically, because they're so prevalent on things that don't matter. Good apps track history and have undo.

Apps that have changes that matter use more drastic things than modal dialogs. Just try deleting things on AWS.

Re:You don't need a modal window by mmis1000 on Wednesday May 24, 2023 @09:59AM (#36058170)
Modal sometimes also works as a peek view of a resource. As when there are many resource in a list, you don't want to open every one in a new tab.

In fact, you can make a link open modal with left click but open in new tab with middle click. I think it is the most balanced way in my opinion.

Modal and tab can co-exist. They are not really mutually exclusive.

BTW, social media websites generally implements this in their feed view. A image behaves different when you click it with middle or left click.

Re:You don't need a modal window by usrbinbash on Wednesday May 24, 2023 @11:25AM (#36059422)
> Modal sometimes also works as a peek view of a resource.

That's what thumbnails and stubs are for.

> In fact, you can make a link open modal with left click but open in new tab with middle click. I think it is the most balanced way in my opinion.

Cool. How do I "middle click" on my phone? Left click is "open resource" by default. If a webapp doesn't have a damn good reason to overwrite the browsers default behavior, it shouldn't.

And "we thought it would make the design really pop", is not one of those reasons.

Re:You don't need a modal window by mmis1000 on Wednesday May 24, 2023 @08:32PM (#36065781)
> Cool. How do I "middle click" on my phone?

Try long press and open in new tab.

Besides, open in modal don't even mean the url won't change. Fb, reddit both open in popup AND change the url. Copy the url to other browser would just work as intended.

It is already a resolved problem in my opinion.

Re:You don't need a modal window by usrbinbash on Thursday May 25, 2023 @06:36AM (#36069020)
> but at least this part of it is trivially easy to implement.

It was a resolved problem before that, by letting the browser do what the browser is good at, instead of implementing new UI paradigms on top of it.

> Besides, open in modal don't even mean the url won't change. Fb, reddit both open in popup AND change the url.

So I add more code, and thus more complexity to websites, in order for the browser to behave in the way it would have already behaved in the first place, had I not thrown the modal in there, and instead let it work as intended.

Re:You don't need a modal window by mmis1000 on Thursday May 25, 2023 @02:12PM (#36074046)
Modern social websites uses infinite scroll, and infinite scroll don't really work with browser's back navigation button. A direct navigation means you lost your read position completely. Hence nobody ever navigate directly.
Re:You don't need a modal window by usrbinbash on Thursday May 25, 2023 @02:32PM (#36074324)
> Modern social websites uses infinite scroll, and infinite scroll don't really work with browser's back navigation button

Yes, and the same can happen with any number of other things, like a keybind that scrolls back, or a link in the feed the user accidentially clicks.

Which is part of the reason why infinite scroll falls under the same category as modals as far as I am concerned. There is a reason why pages with lots of entries are paginated.

Re:You don't need a modal window by ablob on Wednesday May 24, 2023 @11:20AM (#36059361)
Depending on my use-case I strongly prefer a modal. A new tab would be highly disruptive, if I just wanted a glimpse over the content.

This is yet another instance of optimizing for something that can not be made perfect. Let me decide what I want. Give me the option to do both without much of a hassle. If a decision needs to be made regarding what should happen on a mouse-click, one may choose a sensible default (i.e. what is the most typical use-case), while leaving the option to configure the other choice.

You can always argue that many options are a non-goal, but any sufficiently sophisticated software needs training anyway. Configuration can be a part of that. Nothing is worse than a program in which the designer chose to make your use-case to be painful to be met.

Furthermore, a uri does not need to be bound to a view. In fact, one might prefer different ways to look at the same data.

Re:You don't need a modal window by WillPostForFood on Wednesday May 24, 2023 @11:28AM (#36059466)
A new tab would be highly disruptive, if I just wanted a glimpse over the content.

I know how to close a tab, be it via keyboard shortcut or mouse click. I know how to resize it. I know how to print it. When content I want to glimpse at opens in a modal, I know none of that. Even if it is well designed, different sites will have different engagement paradigms.

My current pet peeve with modals is when I try to select text with the mouse, and drag past the edge of the modal, it closes.

Re:You don't need a modal window by ablob on Wednesday May 24, 2023 @11:40AM (#36059638)
This is why I encouraged the choice of configuration, as can bee seen in the paragraphs below your citation. The intended message of my comment is that different people prefer different things.

Modal windows and how they interact with the user is obviously something that should be standardized, but that is a different discussion.

Re:You don't need a modal window by usrbinbash on Wednesday May 24, 2023 @11:46AM (#36059717)
> Modal windows and how they interact with the user is obviously something that should be standardized,

It already is. It's called tabs.