Commit Graph

5 Commits

Author SHA1 Message Date
Tim Abbott 08e04e2195 message_edit_notice_tooltip: Rewrite to fix inverted check.
Apparently, abece73c5a had misconverted
the case where edit history is disabled.
2024-09-23 18:13:17 -07:00
Pratik Chanda aeebbbb825 tooltips: Defer computing last_edit_timestr until tooltip renders.
Earlier, we used to compute last_edit_timestr as data-tippy-content
when rendering the whole message feed.

This commit changes the behaviour by computing the `last_edit_timestr`
when a user hovers over the message_edit_notice.

Fixes: zulip#27240.
2024-09-23 18:13:17 -07:00
Sayam Samal abece73c5a tooltips: Add hotkey hints and modify edit history tooltip.
This commit consists of the following visual changes:

- Add the hotkey hints in the tooltip of the view edit history option,
the shortcut (Shift + H) for which was added in PR #26245

- Swap "Click to view edit history." and the edit status string
(EDITED/MOVED/SAVING) to make the tooltip consistent with other
tooltips across the web app.

- Rename "Click to view edit history." to "View edit history", since
the "Click to view" part is evident from the icon as well as the the
keyboard shortcut hints.

Fixes #26581.
2023-10-03 14:37:47 -07:00
Sayam Samal 8d3f2baebf tooltips: Use <div> tags inside tooltip's inner content.
By replacing `<span>` tags with `<div>` tags inside the tooltip's inner
content we remove the redundancy of having to use break tags to
separate the tooltip's title and it's content.

We also replace any `<p>` tags with `<div>` tags for the following
reasons:

- Since what we want to achieve are just block elements in order to
avoid the break tags, using `<div>` tags provide use with a wider
scope of use cases.

- We don't want the pause, screen readers often introduce after reading
the contents of a paragraph.

- The `<p>` tag cannot contain tables and other block-level elements.

- The semantic meaning of the <p> tag doesn't apply to the commonly
used tooltip content.
2023-10-03 14:37:47 -07:00
Palash Baderia ef9645a509 message_feed: Improve edited/moved tooltip.
This commit improves the edited/moved tippy tooltip to now include a
second italic line: "Click to view history" This line is visible
only when 'realm_allow_edit_history' is true for any organization
settings. Additionally, the first line is changed to display
"Last edited today at 00:00 AM" The date is in lowercase if it
doesn't contain a number for example 'today' unless the first
alphabet is uppercase.

'tippy-zulip-delayed-tooltip' was used as a common class to
implement tippy tooltips in addition to other elements in the
'edited_notice.hbs' file. However, now we need to make some
changes in tippyjs inside the onShow function to decide whether
to show the second line of a tooltip or not. Therefore, we need
to use a unique class for the edited_notice tooltips. Hence, removed
the 'tippy-zulip-delayed-tooltip' class from the edited_notice.hbs
file and used the 'message_edit_notice' class instead.

Fixes: #23075
2023-07-11 17:33:06 -07:00