217 points · by edent · 2y ago · 166 comments
For example:
1. Pasting an image into a markdown field. A common action is to upload the image and insert the correct markup to embed it.
2. Pasting richer content inside an application. For example when copying a rich widget you may embed a text representation, HTML representation but if the user pastes the widget back into your app it is often best to keep a "native" representation that can be used to faithfully reconstruct the original data.
Ultimately, misguided developers or PMs will always find a way to make our lives harder if they set their mind to it; let’s not make it an arms race.
That said, for password managers and known-bad sites, your proposal sounds tempting!
I've noticed some inconsistency on Android: many, but not all, SMS notifications from Google Messages (Pixel) contain a "Copy code" button when the message has an OTP. I wonder if there's some kind of heuristic or list of known phrases/senders baked into the app, always lagging behind as things evolve.
OTP messages from non-A-list services have only the "Reply" / "Mark as read" buttons on the notification a substantial portion of the time, at which point one can type the code manually or copy the whole message after opening it.
It's actually rely on specific message format. And it's a function of google message app instead of system wide function. Although the pattern isn't documented anywhere.
https://blog.google/products/messages/five-new-features-try-...
I know SMS is less secure but the UX of autofill on e.g. iPhone at least is so much nicer than having to pop out of my browser/app, open an authenticator app etc.
Related to accessibility concerns of numeric and number input, there is a good blog post from UK Gov that was on the front page a (long?) while ago: https://technology.blog.gov.uk/2020/02/24/why-the-gov-uk-des...
I just checked and it seems like they hijacked it so it navigates the search suggestions instead (ie. pressing "end" goes to the last suggestion)?
It also means if I've pressed page down, then press down it jumps upwards to the top of the page.
Extremely user-hostile choices.
Another sign that the website you are on was only tested on macOS used to be scrollbars everywhere, since there is no visual difference between overflow: scroll and overflow: hidden. Unfortunately now the default in most places seems to be hidden scrollbars, which is great because if a page or component happens to layout just right, it will simply look like there's no more content and you'll have to rely on the user just knowing they can scroll or you have to add additional cues. If only there was some standard visual cue that could indicate that you can scroll and how far in you currently are!
(And of course, the wrong overflow values are still hiding everywhere, so it didn't really fix the problem...)
A simple input is much better, even at the cost of a UI that is slightly more ambigous for the user on desktop (on mobile, there's a bagillion things to make inputting OTP codes easy).
I've seen some of these that magically work with paste, but plenty that don't.
[1]: https://shkspr.mobi/blog/2023/10/firefox-might-remember-old-...
I'm more likely to get it wrong twice than I am if I just copy and paste it from my actual bank account website once.
Not only does your browser know the character code, it knows the key that is pressed. For details I do recommend reading the article itself.
Of course, your 2FA updates every 30 seconds so hurry.
As ugly as the keyCode/which APIs are, they work. I've never had an issue with them.
`code` is useful for key positions, e.g. for WASD movement in a game. `key` is useful as the interpretation of a key, but primarily for non-text keys, since IMEs and virtual keyboards mean that text does not necessarily correspond directly to keys.
As a result you have to go back to all the autofilled fields and type something to trigger their validation logic.
Annoying….
I reject this strongly: they’re both wrong. It’s not reasonable to control this via a KeyboardEvent at all. If you want to do this sort of thing, you should only manipulate in real-time based on the input’s value and selection, triggering on 'input' events when !event.isComposing. Otherwise, you will break things for some users.
Also, you should very, very strongly consider not manipulating the field contents, but only validating (and somewhat relaxed masking at that). The web just doesn’t give good, robust primitives for input masking.
JavaScript violates the rule of least power in this regard: https://en.m.wikipedia.org/wiki/Rule_of_least_power
Before JavaScript it was impossible to even implement such functionality on the client side...
There was no "number" input before HTML5 spec which came out in 2008, and was adopting for 6 years before finally becoming a recommendation in 2014. You had to let user put any text in the input and do the validation on the backend, which had the same Turing complete language running letting you make any mistakes you want.
Rule of least power is just a design principle, and it could not hold as an axiom of good design for the web, because when the least power becomes not enough power, it takes years for the adoption of new powers needed – that's why JavaScript exists in the first place.
Such a small thing, but it drives me up the wall.
I give up. But I guess at least this proves my point.
With this extension (+1), I'm happy that `C-w` does as God, readline, and Emacs intended.
- do not prevent default
- do not limit my input to the exact number of characters
- do not listen to any event other than “blur” unless you’re updating another part of the UI in real time
I really wish that browsers gave control back to the users, and I say this as a FE developer.
Exactly this. Browsers have stopped doing their job as the "User's Agent" and instead are acting more in the interest of web developers. Consequently, developers now see the browser window as a limitless empty canvas that they can just do whatever they want in, regardless of the user's desires.
uio
jkl
m,.
to be used as a keypad so you don't need to move your hand to the actual keypad.
Or you can break actual keypads.
Meanwhile all the numbers are still there on the regular keyboard just one row higher than you're normally typing. Plus, for a lot of typing a typist is already pressing the symbols on the number row anyways, so it's not like a typist is having to stretch to locations they're not normally pressing anyways. I'm not an accountant or mathematician or whatever so I tend to eschew number pads, so I'm probably a bit biased.
But they have to stretch, that's the issue, why do something unergonomic when you can do it better? On phones you have numpad input for the same reason - it's more convenient than the "familiar" horizontal keys
> straight lines of the number pad are kind of the whole point to me for having a separate number pad area.
But your fingers aren't straight, so that's also suboptimal. On the other hand you don't need to move your hand off home row and can also add more convenient backspace for error correction
People already routinely type at least !, @, and $ often enough and it doesn't seem to be that big of a deal.
> On phones you have numpad input for the same reason
Yes, a straight grid of numbers for touchscreens not one heavily skewed to the side. Also, the number pad keyboard means larger hitboxes for numbers to type them faster. There's also no real "home row" on a phone keyboard.
Look, if it makes you happy, do it. I'm just suggesting that to me its not really that much better than just pressing the keys that are practically always there on any regular keyboard. I'd personally just rather get better at pressing the number row keys instead of ensuring I'm on a keyboard or OS configuration to allow me to have some non-standard numberpad layer on the keyboard.
It seems like forgotten information, but all of these computer interfaces that were invented in the 80s and 90s were built by doctorate level professionals who spent years thinking about these things. Why do all these bozos who took a six month code boot camp (or at best, finished a four year degree with a 2.9 GPA) think the ten minutes they spent thinking about it lead to some brilliant insight?
I've encountered navigation bars that use this pattern, which is really frustrating to my preferred way of browsing.
Somewhat related is a plugin (Safari, Mac) called StoptheMadness). It aims to end stupid crap like this. I’m not the dev.
I will never understand software engineers who feel they need to build their own custom controls, or who won't push back when their "designers" insist on it. You could be doing so much with your life, but here you are re-implementing scrolling again.
“The only problem with [modern software developers" is they just have no taste. They have absolutely no taste.”
Most developers working today haven't regularly used software that doesn't suck so they're not personally offended by unusable designs or 500ms of latency when typing.
The one that annoys me most is whenever someone needs to enter a code with a fixed length. Like a 6 digit OTP code. They want to have a UI with 6 separate input fields: _ _ _ _ _ _ that behaves like one input and only allows the correct values and has the cursor behave correctly jumping from one box to the next as you type / backspace. Turns out, creating that UI element is kinda time consuming and adds NOTHING and at best results in the same user experience as just tossing in an HTML input element, and more often than not results in some non-standard behavior that breaks something (auto-fill, paste, arrow key, accessibility, etc, etc). Just use a standard input, throw some css on it to make it the characters big if you want.
I believe most people that do this kind of thing do it because they don‘t know there‘s a native API that works better for these things.
Remember, the software engineers that are good at their jobs aren‘t the ones that end up teaching at coding bootcamps.
Because the web is a terrible platform that made basic reusable components far harder than they ever needed to be, so every developer got into bad habits of rolling their own solutions to every problem. It's gotten better now but modernizing involves throwing out literal decades of practice.
For developers supporting projects implemented using simple raw-js or things like jquery, it's no wonder they developed a habit of DIY. I've had review so much code and push back on this stuff, so I fully understand why it happens.
I think it made them just hard enough to ensure continuous employment of lots of web developers :)
You took “don’t reimplement the browser”, something that is generally incredibly true, and cargo-culted it into placing some old farts on a pedestal just because they were there ‘first’.
I'm not saying these ideas shouldn't be revisited, but if you're going to revisit them, do it at an academic institute, where you can spend time figuring out the problems, not at your commercial job where you have to ship next week, no matter how broken it is.
This. So much this.
I've gotten down-voted in the past for being really harsh on Macs, this is because I've worked places where the company would only issue MacBooks to its developers, and requests for non-Macs were denied by a blanket policy. So I kind of hold a grudge that's more fairly directed at the companies rather than Apple (but still, Apple's "our way or the highway" approach is antithetical to my way of interacting with computers). These company policies not only affect developer productivity when your engineers have decades of experience training themselves to be productive on their non-Mac system of choice, but it gets so much dumber when your company officially supports non-Mac-using users.
p.s. please everyone: factory reset your phones before you sell them :)
The one rationale that makes sense to me when it comes to restricting choice to a certain degree is the ability for IT to remote-wipe if necessary.
How important that is will depend on context. At my current place of work, most company data is accessed through various web applications so if the computer were compromised, there is no sensitive data kept locally that would require wiping. Though I suppose it could be argued that browser caches could be sensitive, and even if you couldn't sign on to those web apps, due to MFA, an attacker could still get information about procedures and tech used that would get them closer.
But if they're using JAMF or something they can at least support Windows and Mac. The only other reason that I can think of that a company would have such a policy is economic... but lost productivity and user frustration is a hidden cost, so how real the economic advantages of standardizing are is something I question.
Testing is more thorough, and endpoint management remains focused on just the one authorized system.
But that's "the best of one world", not "both."
The other half of the equation is developer experience and productivity.
I'm not going to blanket bash Mac or Apple, because many people love their devices. But being someone who has used computers since the 1980s, who has vision difficulties (the fonts and inability to adjust them on MacBooks actually cause me headaches) and is extremely accustomed to a particular workflow, keyboard layout, shortcuts, the ability to customize all aspects of the desktop environment ... I find the experience of using MacOS 8 hours per day to be intolerable. To pour salt on the wound, the new habits that I started forming on the work devices began interfering with my use of personal devices (suddenly muscle memory was getting confused).
And yes, it's my choice where to work. The last time I got downvoted for expressing this opinion, I said that I almost resigned due to this. Had the company not been able to accommodate me (the CEO was actually surprised to learn that IT had instituted a blanket policy and said "that's dumb, of course we will issue PCs to those who request them") then I would have eventually found work elsewhere because it was that big of a misalignment for me. And I tried to adjust for a year and a half before finding myself in the position where I was really thinking that I couldn't do it anymore.
People who have grown up using Macs, or who feel comfortable using either or, cannot empathazise with this position. But after 40 years of being a programmer, having high functioning autism and thus being inflexible in routines and habits, my computer and my way of interacting with it is almost an extension of me. When you mess with that tool, my productivity and morale drops very significantly. And having spoken with others in these environments, I know that I'm not the only one.
But, again, this isn't really trying to bash Mac, it's attacking a policy that ignores that software engineers are most productive on certain systems vs others and that those choices are deeply personal.
Again, security is only one factor. An important one, but you can't have "best of both worlds" while ignoring one massive "world" that I was talking about.
ignoring the biggest of world, mac aren't the standard, nor more widespread, and never was
I happen to struggle with the trackpad on non-Mac laptops to an extreme degree, and while I don't put that in the same category as reasonable accommodations required by the ADA of course (probably just lack of practice), it does help me (along with web UI a11y training and formal job responsibility) empathize with the point you are making to some extent. Glad to hear it eventually worked out with the CEO.
Standardizing on a small set of easily available hardware, a single popular OS, and a single set of tools across an organization can have vast benefits in direct proportion to the scale of that organization.
On the other hand, you are one person who is set in their ways.
In some ways, I’m a lot like you. I know the straitjacket feeling when placed into an unfamiliar or uncustomized environment. At this point, adapting to new interfaces has happened so often and so many times that I consider it a core job skill.