New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 785589 link

Starred by 8 users

Issue metadata

Status: Fixed
Owner:
Closed: Nov 22
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows
Pri: 2
Type: Bug



Sign in to add a comment

Notification Message Truncated

Reported by mtay...@pushnami.com, Nov 16 2017

Issue description

UserAgent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36

Steps to reproduce the problem:
1. Invoke ServiceWorkerRegistration.showNotification()
passing a message "Welcome - Successfully Subscribed".

Alternatively - 
1. Clone https://github.com/mtaylor22/simple-push-demo
2. gulp dev
3. Enable notifications
4. Click "SEND A PUSH VIA XHR"

What is the expected behavior?
The notification message should appear as "Welcome - Successfully Subscribed"

What went wrong?
The notification message appears as "Welcome - Successfully"

Did this work before? Yes 58.0.3029.96

Does this work in other browsers? N/A

Chrome version: 62.0.3202.94  Channel: stable
OS Version: 6.1 (Windows 7, Windows Server 2008 R2)
Flash Version: 

The behavior appears to clip the last word where a line break causes only one word on the second line.
 
Notification Truncating.pdf
165 KB Download
Labels: -OS-Windows Needs-Bisect Needs-Triage-M62
Cc: vamshi.k...@techmahindra.com
Labels: Triaged-ET Needs-Feedback
"We downloaded the zip file from the URL provided, i.e., https://github.com/mtaylor22/simple-push-demo and tried adding the extensions to chrome in order to get the notifications by enabling deverloper mode, we are unable to add the extension from the downloaded file.

@Reporter: Could you please provide a sample extension file to triage the issue further.

Thanks!"
The fork is now published at https://mtaylor22.github.io/simple-push-demo/ for reference. The simplest way to reproduce the bug on Chrome (stable) would be following exactly these steps:

1. navigate to https://mtaylor22.github.io/simple-push-demo/
2. enable notifications
3. Click "SEND A PUSH VIA XHR"

What is the expected behavior?
The notification message should appear as "Welcome - Successfully Subscribed"

What went wrong?
The notification message appears as "Welcome - Successfully"


Project Member

Comment 4 by sheriffbot@chromium.org, Nov 17 2017

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding requester "vamshi.kommuri@techmahindra.com" to the cc list and removing "Needs-Feedback" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Cc: divya.pa...@techmahindra.com
Labels: -Pri-2 -Needs-Bisect hasbisect-per-revision M-64 OS-Windows Pri-1
Owner: yhanada@chromium.org
Status: Assigned (was: Unconfirmed)
Able to reproduce the issue on reported version 62.0.3202.94 and on chrome version # 64.0.3272.0 using Windows 10 hence providing bisect info

NOTE: This is not applicable to Mac 10.12.6 and Ubuntu 14.04

Manual Bisect Info:
================
Good build: 62.0.3187.0
Bad build: 62.0.3188.0

You are probably looking for a change made after 494703 (known good), but no later than 494704 (first known bad).
CHANGELOG URL:
https://chromium.googlesource.com/chromium/src/+log/101b811383bbcdefaa86e864275afbea17d902f8..97156ad7e3aaf12a766c5e69d457ad15f492690b

Suspecting same from changelog.

@yhanada: Please confirm the issue and help in re-assigning if it is not related to your change.

Thanks!

Comment 6 by peter@chromium.org, Nov 20 2017

Cc: peter@chromium.org
Components: -Blink>PushAPI UI>Notifications
Thank you for the bug report!

yhanada's change actually fixed a bug, so it was the right thing to do.

The lack of title space is unfortunate. I wonder if we could consider eliding the title instead of dropping the entire last word?

Comment 7 by peter@chromium.org, Nov 20 2017

Cc: hwi@chromium.org sgabr...@chromium.org
Hello,
We ran into this bug also with cut title.
Can you tell the approximate fix date of this bug, please?
Thank you.
Cc: tetsui@chromium.org yoshiki@chromium.org
As BoundedLabel has eliding functionality, this might be caused by using BoundedLabel wrongly in my change.
AFAIK, the new material design notification doesn't have this issue.

I will take a look, but it will be after M-64, so I appreciate it if anyone could take over this issue.

Comment 10 by peter@chromium.org, Nov 22 2017

Playing around with this, I see the following behaviour:

- Anything that fits on a single line is fine.
- Anything that definitely needs wrapping is fine.
- Anything that *might* need wrapping (i.e. would have fit until we shrunk the label) is being cut-off.

I might be able to take a more in-depth look later on, but don't have time for it at least this week either.

Comment 11 by hwi@chromium.org, Nov 22 2017

re: c6 and c10 - eliding vs. wrapping: if we can get wrapping to work for the 3rd bullet on c10, that'd be great for usefulness. Thanks!
Cc: yhanada@chromium.org
 Issue 789904  has been merged into this issue.
Labels: Hotlist-Interop
By the way, this can be reproduced using much less code (even on this page) -
Notification.requestPermission(() => new Notification("Welcome - Successfully Subscribed"));
Cc: ranjitkan@chromium.org pbomm...@chromium.org rbasuvula@chromium.org nyerramilli@chromium.org msrchandra@chromium.org
 Issue 792350  has been merged into this issue.
 Issue 781690  has been merged into this issue.
Owner: tetsui@chromium.org
Labels: -Pri-1 -Type-Bug-Regression -M-64 -Needs-Triage-M62 M-66 Pri-2 Type-Bug
Status: Started (was: Assigned)
Project Member

Comment 19 by bugdroid1@chromium.org, Jan 30 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ecc9db734979ea7db10a7add238984af49113e1e

commit ecc9db734979ea7db10a7add238984af49113e1e
Author: Tetsui Ohkubo <tetsui@chromium.org>
Date: Tue Jan 30 23:26:56 2018

Remove icon view from layout when no icon available.

Previously, |icon_view_| was created even if the notification
does not have an icon, and changing is visibility by
icon_view_->SetVisible().
However, ProportionalImageView always returns the fixed image size
and FillLayout does not take visibility into account. As a result,
|right_content_| always occupied the right side even if there is
no icon.

By this CL, the behavior is changed as follows:
* When icon is available,
  * icon_view_->visible() always returns true.
  * right_content_->visible() may return false.
    (in case of use_image_for_icon)
* When icon is not available,
  * icon_view_ is null.
  * right_content_->visible() always returns false.

Before: http://screen/5KwSgEQQBaH
After: http://screen/ym6upUfc1qc
(Pressing Shift-Esc to show the notification)

TEST=message_center_unittests
BUG= 785589 

Change-Id: Ie3c133c82947681565cd07ddfada0c17a87dc591
Reviewed-on: https://chromium-review.googlesource.com/891079
Commit-Queue: Tetsui Ohkubo <tetsui@chromium.org>
Reviewed-by: Evan Stade <estade@chromium.org>
Cr-Commit-Position: refs/heads/master@{#533079}
[modify] https://crrev.com/ecc9db734979ea7db10a7add238984af49113e1e/ui/message_center/views/notification_view_md.cc
[modify] https://crrev.com/ecc9db734979ea7db10a7add238984af49113e1e/ui/message_center/views/notification_view_md.h
[modify] https://crrev.com/ecc9db734979ea7db10a7add238984af49113e1e/ui/message_center/views/notification_view_md_unittest.cc

I ran into this issue as well on Windows 10. When I use this title:

[Urgent] Submit a seller proposal

it gets truncated to this:

[Urgent] Submit a seller

I spent some time trying to get to the root cause of this bug and and appears to be related to how title_view_ inside NotificationView is sized. If I remove the right padding from it, i.e. replace this code in MakeTextBorder:

  return MakeEmptyBorder(padding / 2 + top, kTextLeftPadding,
                         (padding + 1) / 2 + bottom, kTextRightPadding);

with this:

  return MakeEmptyBorder(padding / 2 + top, kTextLeftPadding,
                         (padding + 1) / 2 + bottom, 0);

However, as I have no experience with the UI framework used by Chromium I don't know if this is a good solution. It may break something.

I hope this helps.
It's also funny that if I use a slightly longer title the text is not truncated. From my experiments if the title length is between 26 and 33 characters it gets cut off, if it's shorter or longer than that it's rendered fine. 

I'm currently working on a website where notification titles can have dynamic length (i.e. their content is not static), sadly this workaround can't be applied. It would be really great if this bug was fixed.
Any news on this issue? Should I submit a patch or somebody is working on it?
It looks like Chrome 68 would switch to native notifications for Windows 10 which would not have this bug to my understanding. It was reported as not applicable to Mac 10.12.6 and Ubuntu 14.04, so I am not sure which OS versions would still have the bug at that point. 
#20: This fix is not correct. This is a bug in message_center::BoundedLabel.

#23: Win 7, some Linux distro, and Chrome OS still have this bug.
Labels: -M-66
Owner: ----
Status: Untriaged (was: Started)
Cc: pnangunoori@chromium.org
 Issue 789727  has been merged into this issue.
Labels: OS-Linux
Owner: knollr@chromium.org
Status: Assigned (was: Untriaged)
Project Member

Comment 28 by bugdroid1@chromium.org, Nov 21

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/b55473e5c6756e806b755b4994e5a1898da2105a

commit b55473e5c6756e806b755b4994e5a1898da2105a
Author: Richard Knoll <knollr@chromium.org>
Date: Wed Nov 21 21:43:31 2018

fix: do not crop notification titles

If a notification title is between 22 and 26 characters long, it might
get truncated in the view. This is because we calculate different line
counts for a title in the layout and draw phases.
This is related to crbug.com/682266.

Instead of relying on the layout phase, we now just set a wider
right-border on the first element in the view, to make space for the
control buttons.

Bug:  785589 
Change-Id: I4c6e157d732065224612766dbe02a3f21f377b2f
Reviewed-on: https://chromium-review.googlesource.com/c/1341924
Commit-Queue: Richard Knoll <knollr@chromium.org>
Reviewed-by: Peter Beverloo <peter@chromium.org>
Reviewed-by: Yoshiki Iguchi <yoshiki@chromium.org>
Cr-Commit-Position: refs/heads/master@{#610225}
[modify] https://crrev.com/b55473e5c6756e806b755b4994e5a1898da2105a/ui/message_center/views/bounded_label.cc
[modify] https://crrev.com/b55473e5c6756e806b755b4994e5a1898da2105a/ui/message_center/views/bounded_label.h
[modify] https://crrev.com/b55473e5c6756e806b755b4994e5a1898da2105a/ui/message_center/views/notification_view.cc
[modify] https://crrev.com/b55473e5c6756e806b755b4994e5a1898da2105a/ui/message_center/views/notification_view.h
[modify] https://crrev.com/b55473e5c6756e806b755b4994e5a1898da2105a/ui/message_center/views/notification_view_unittest.cc

Status: Fixed (was: Assigned)

Sign in to add a comment