-
-
Notifications
You must be signed in to change notification settings - Fork 7.1k
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
Change design of account notes in web UI #14208
Conversation
81dec9a
to
8fafa26
Compare
Wow! That's nice and seamless, how does it look in light theme? |
Also,
Why not just adapt Enter for this, but allow newline with Shift+Enter?
That would be unfunny to discover on random. Maybe it's best to remove it altogether? Esc behavior is already unclear (sometimes it closes modals, sometimes it cancels page load). |
Ctrl+Enter works as save/submit in multiple other forms so it seems like what most users would expect to just work.
Not sure, but it makes sense to me to have a quick reset hotkey. |
This is the default on many other website with similar forms including Github Not sure about the reset on Esc but the unfocus is intuitiv. |
I doubt anyone would have a problem with it but if anyone does I'll change it in the next update |
It does look better, but I'm not sure if it's as intuitive or usable. It'd be the first thing we have so far that you just click to edit, and there's nothing telling you that unfocusing it will save it or anything. |
Actually, the media descriptions used to be like this! So even though we changed them into the media editing modal, there's precedent. I've tried different combinations and I think it sits here the best! |
Oh, I remember the media editing thing being an issue on mobile because of that: it was difficult discovering you could actually do that. The “Click to add a note” placeholder probably is enough to address that issue though. |
Yeah, it does look better, but my complaints with it are:
|
What about keeping the same style as this PR, but initiating the edit with a pencil button or something besides the “Note” header, and having the “Save” / “Cancel” button from previously? They would increase the height of the note part of the UI, but not change how the input itself would look. |
Not really, no. In context of [non-retractable] forms, you may be required to enter multiple lines, there this would be suitable. For user notes, if we adapting such quick edit field, I think save shortcut must be simplified too. What are the odds user is going to insert multiple line breaks on a short note? Pretty low, probably. “And if you are exceptional one, we give you Shift+Enter” (sound effect).
Very good point and not easy to solve, we already have a pointer, which changes to beam on hover, but maybe can make it ever more noticeable by adding a border on hover (which is massive area). Or, using hint (in the far far away future): Regarding save / cancel buttons, I don't see any benefit of them. The notes feature is dead simple, as a notepad — it's only you Also,
<details>I took some time to rewrite the whole class component to functional one, just for fun, you know. And thought, why shouldn't I try and implement my concept? Umm, yea… Regarding 500 errors, it's my developer instance slightly broken with me jumping from one branch to another, and this actually makes a good point that I need to determine whether it saved successfully or not, don't think it's much of a problem. I may post gist with the code, but it's too much hooking, you may not like this. Okay, I posted it. P.S. The border on GIF is React DevTools. |
Probably low, yes, but not extremely so, and the user would need a way to find out that they can indeed do that.
Those things only work when you have a mouse pointer, not when you're on mobile.
Yeah, the feature is simple, but you need to know how it'll be saved, and I think you'd need to be able to cancel a change too. Currently, you can do that by pressing Escape. That doesn't work on mobile. |
Updated previous comment with another concept (see “using hint” spoiler).
Also added a link! |
app/javascript/mastodon/features/account/components/account_note.js
Outdated
Show resolved
Hide resolved
app/javascript/mastodon/features/account/components/account_note.js
Outdated
Show resolved
Hide resolved
8fafa26
to
f0abaae
Compare
Edit: Solved the issue of blur firing a 2nd save after ctrl+enter by entering into a "saving" state that's reset when the prop value is updated to the state value (i.e. the server-side value saved successfully) or when the user changes the state value again. |
6a467d5
to
6fc0baa
Compare
6fc0baa
to
018b35f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fully went through the code, and I haven't seen any real issue with it, but I think the component being stateful and trying to handle context changes make it significantly more difficult to understand, tbh.
Design-wise, I think it looks significantly better than the previous version, but I'm still not convinced it's as easy to use, particularly on mobile, where you don't really have a way to cancel your changes. Maybe those concerns aren't that important though 🤷♀️
@@ -323,6 +314,8 @@ class Header extends ImmutablePureComponent { | |||
</div> | |||
)} | |||
|
|||
{account.get('id') !== me && <AccountNoteContainer account={account} />} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait, why did you remove ability to set note for yourself?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because we don't load relationship for the user itself the note is never loaded, so while it was possible to set it, it would always show up as empty later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to fix it somehow? Because I find note for myself useful, just like chatting with myself in messengers… you can leave some things for later in there. I actively used that in Discord.
Add keyboard shortcut is nice. But I would like you to add some buttons, like previous one. Current one is not user-friendly at mobile and for mastodon beginner. Mastodon settings has "save" button and setting is not saved automatically. This is my thought that Mastodon base design is saving manually not saving automatically. So add "save" button is natural for me.😊 |
* Change design of account notes in web UI * Fix `for` -> `htmlFor`
ctrl+enter
to save and unfocusesc
to reset and unfocus