Skip to content
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

UI: allow to close notifications #8345

Merged
merged 3 commits into from Jul 15, 2021
Merged

Conversation

stsewd
Copy link
Member

@stsewd stsewd commented Jul 14, 2021

This is fixed on the new templates too, but we still need more work before releasing them.

Screenshot 2021-07-14 at 11-10-43 test Read the Docs
Screenshot 2021-07-14 at 11-10-21 test Read the Docs

I'd put this on the other side, but we don't have something like a box for these notifications

@stsewd stsewd force-pushed the allow-close-notifications branch from bc7c3f6 to 46fbfbc Compare July 14, 2021 17:11
Copy link
Member

@ericholscher ericholscher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<3 -- does this also work on .com?

@@ -621,6 +621,14 @@ p.build-missing { font-size: .8em; color: #9d9a55; margin: 0 0 3px; }
color: #5a5;
}

a.notification-action {
text-decoration: none;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would probably be better floated right. On the left, this feels like more of an icon instead of an action:

image

media/css/core.css Show resolved Hide resolved
@@ -102,6 +102,11 @@
<ul class="notifications">
{% for message in messages %}
<li class="notification notification-{{ message.level }}" {% if message.pk %}data-dismiss-url="{% url 'message_mark_read' message.pk %}{% endif %}">
{% if message.pk %}
<a class="notification-action" href="{% url 'message_mark_read' message.pk %}">
<span class="icon close" aria-label="Close notification"></span>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively, instead of dropping the icon on both community/commercial, this span could default to text (<span>Close</span>), and on community the span would have text content removed via CSS and replaced with a FA icon

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, needs {% trans %} on text

@stsewd
Copy link
Member Author

stsewd commented Jul 14, 2021

does this also work on .com?

Looks like no, the template is overridden in .com, I'll need to port these changes there :/

@stsewd
Copy link
Member Author

stsewd commented Jul 14, 2021

@agjohnson I didn't use float: right because we don't have like a box for the notification, so it looks weird, for .com it looks good.

Screenshot 2021-07-14 at 13-03-29 Project Dashboard Read the Docs

Screenshot 2021-07-14 at 13-04-19 Project Dashboard - Read the Docs for Business

And about using text, where would you put it?

@stsewd
Copy link
Member Author

stsewd commented Jul 14, 2021

Also, we need to change this in .com either way, because we don't inherit from this template. What about leaving the icon on the left for .org and make it float 🎈 on .com?

@agjohnson
Copy link
Contributor

I didn't use float: right because we don't have like a box for the notification, so it looks weird

Yeah true, for most notifications and viewport sizes, it's probably too wide. I'd still put it on the right side of the notification, but perhaps not with floating. The icons will stagger when messages stack up, but that's probably not awful.

Commercial notification looks good!

@stsewd
Copy link
Member Author

stsewd commented Jul 15, 2021

I'd still put it on the right side of the notification, but perhaps not with floating.

How would that be? Like at the end of the sentence?

Notification x

That won't work for multi-line notifications

Notification
Multiline x

@agjohnson
Copy link
Contributor

Two options:

  • Use width: max-content on the notification div. This will reduce the width on most browsers and allow for a float right close button that is close to the content
  • Style the notification div to have a background or border, similar to how notifications are on commercial. Float right the close button.

@stsewd
Copy link
Member Author

stsewd commented Jul 15, 2021

@agjohnson using max-content requires fewer changes. Which one looks better? max-content applied to the whole list or per-item?

Screenshot 2021-07-15 at 13-27-29 Integration Read the Docs

Screenshot 2021-07-15 at 13-28-45 Integration Read the Docs

@agjohnson
Copy link
Contributor

Should be per ul > li, otherwise I don't think the width will change on the individual notification <li> elements.

I'd also increase left padding or margin:
image

@stsewd
Copy link
Member Author

stsewd commented Jul 15, 2021

@agjohnson done

Screenshot 2021-07-15 at 14-22-57 testings Read the Docs

@stsewd stsewd requested a review from agjohnson July 15, 2021 19:27
Copy link
Contributor

@agjohnson agjohnson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@ericholscher
Copy link
Member

Thanks for jumping on this @stsewd ❤️

@ericholscher ericholscher merged commit 65d7757 into master Jul 15, 2021
@ericholscher ericholscher deleted the allow-close-notifications branch July 15, 2021 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants