RFC: dealing with timestamp-induced judder on TL #374
Labels
No labels
a11y
Bug
Bug fix
Critical Priority
Documentation
Feature
Feature request
Held for next release cycle
High Priority
Low Priority
Medium Priority
Minor change
Translation/Locale
WIP
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: AkkomaGang/akkoma-fe#374
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
#353 fixed notifications constantly moving around due to changing timestamps.
However, as it turns out this can sometimes also happen for full notes on the TL or a thread view.
I have ideas how to fix this, but would ideally like to get some feedback on the options first. I’ll explain the source of the problem and possible solutions in detail below.
Unlike notifications, which show the displayname, sometimes the handle and some descriptive text in their title, normal notes only show the displayname and handle. (In the left section which is a flexbox; the right section contains the timestamp, scope indicators and the collapse button).
The displayname is already set to hide overflow with an ellipsis, and the handle + instance icon forms a
nowrap
block. However, it is possible for an automatic linebreak to be inserted between displayname and the handle if they don’t fit into a single line.Now if both initially just fit into a single line for a time of say
9min ago
, after a little while the timestamp will update to10min ago
causing a linewrap to be inserted, thus changing the height of the note container and everything shifting a bit. The same can happen the other way around when a linebreak is no longer necessary when going from e.g.59min ago
to1h ago
.Now, at first thought it might seem reasonable to just copy the approach from #353 and always reserve enough space for any reasonable timestamp. However, just like in #353, this would be an issue for the long-form timestamps due to differences in localisations and most of the time wasting way to much space. I don’t think it is desirable to use short timestamps here either.
However, since we only have to deal with two blocks and a single possible linebreak, we have other options not possible for notifications. They come with different tradeoffs though and making the approach a user options would get too messy I think.
Just don’t allow an automatic linebreak between the two blocks; i.e. set
This is foolproof and what I’m using atm (with
!important
) as a client-side CSS addition.However, it is overly punishing on long displaynames imho, and for remote users whose handle contains the whole domain, the display name doesn’t even need to be that long to trigger ellipsis.
Just always enforce a line break between the two, i.e. add something equivalent to the following after the displayname (if we’re not inside the notification view and without using inline style):
This also works, but to me feels like a waste of space for local users and/or short displaynames.
Additionally, this should also allow enabling ellipsis for handles to avoid handles overflowing over the entire screen for ridiculously long domain or nicknames. Though I can’t seem to get this ellipsis working in initial testing.
Freeze the line count after initial creation.
This avoids wasting space and punishing long displaynames, but comes at the cost of notably increased implementation complexity (and I’m not sure whether that’s desired) — and
doesn’t help with overly long handlesi guess we can also add a class for two-liners to neable handle ellipsis.I don’t have an actual implementation yet, but the basic idea is:
.vue
file.js
side, on component creation check whether theoffsetTop
properties of both are identical(potentially a race condition if the user is scrolling??)
nowrap
If you’re wondering “but why can’t we do totally different option X”, or “why does the above use such an ugly CSS/JS hack instead of the cleaner and more concise feature Y”, the answer is probably because I don’t know about X/Y. I’m not too well-versed with web frontend stuff; do not hesitate to suggest alternative approaches.
Version
ed0b403
Severity
I can manage
Have you searched for this issue?