Closed Bug 1213895 Opened 9 years ago Closed 8 years ago

Badge-Text should not be truncated with an ellipsis - hides more than necessary

Categories

(WebExtensions :: Untriaged, defect)

defect
Not set
normal

Tracking

(firefox47 fixed)

RESOLVED FIXED
mozilla47
Tracking Status
firefox47 --- fixed

People

(Reporter: designakt, Assigned: kmag)

References

Details

(Whiteboard: [webextension-polish]triaged)

Attachments

(3 files)

With Bug 1207225 we limited the with of a badge to the width of its button. We also limit to 4 characters, but 4 wide characters might still require the badge text to be truncated. 
Currently we use an ellipsis, which is not ideal for this, as it hides 2 of the max. 4 characters.
Instead of "WWWW" one would only see "WW…" whereas with a hard cut one can see more, or most of the characters.
(Cc-ing Enn, cause he's looking into why the obvious change didn't work… 
Blocks: webext
Flags: blocking-webextensions+
Whiteboard: [webextension-polish] → [webextension-polish]triaged
Flags: blocking-webextensions+ → blocking-webextensions-
Assignee: nobody → kmaglione+bmo
Attachment #8716590 - Flags: review?(bwinton) → review+
Comment on attachment 8716590 [details]
MozReview Request: Bug 1213895: Part 2 - Do not use ellipsis in cropped toolbarbutton badge text. r=bwinton

https://reviewboard.mozilla.org/r/33879/#review30533

Looks good to me.

(I think we might want a larger badge when the button is in the menu panel, but that can be a separate bug.  :)
Comment on attachment 8716589 [details]
MozReview Request: Bug 1213895: Part 1 - Correctly support crop="none" in XUL labels. r?neil

This part looks ok, but it changes the default crop value to 'none'. I think you want to make sure that 'end/right' is used as the default in nsTextBoxFrame::UpdateAttributes.
Attachment #8716589 - Flags: review?(enndeakin) → review-
(In reply to Neil Deakin from comment #5)
> Comment on attachment 8716589 [details]
> MozReview Request: Bug 1213895: Part 1 - Correctly support crop="none" in
> XUL labels. r?neil
> 
> This part looks ok, but it changes the default crop value to 'none'. I think
> you want to make sure that 'end/right' is used as the default in
> nsTextBoxFrame::UpdateAttributes.

Hm. You're right. I thought it only defaulted to none for an attribute with an unknown value, but it defaults to it for a missing attribute too.
Comment on attachment 8716589 [details]
MozReview Request: Bug 1213895: Part 1 - Correctly support crop="none" in XUL labels. r?neil

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/33877/diff/1-2/
Attachment #8716589 - Flags: review- → review?(enndeakin)
Comment on attachment 8716590 [details]
MozReview Request: Bug 1213895: Part 2 - Do not use ellipsis in cropped toolbarbutton badge text. r=bwinton

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/33879/diff/1-2/
Attachment #8716590 - Attachment description: MozReview Request: Bug 1213895: Part 2 - Do not use ellipsis in cropped toolbarbutton badge text. r?bwinton → MozReview Request: Bug 1213895: Part 2 - Do not use ellipsis in cropped toolbarbutton badge text. r=bwinton
Attachment #8716589 - Flags: review?(enndeakin) → review+
https://hg.mozilla.org/integration/fx-team/rev/d61da023339cd16d65aa60c93ce463617f10a5c8
Bug 1213895: Part 1 - Correctly support crop="none" in XUL labels. r=neil

https://hg.mozilla.org/integration/fx-team/rev/c5e7457caf709a38b23d41a9e2dd499edd97459e
Bug 1213895: Part 2 - Do not use ellipsis in cropped toolbarbutton badge text. r=bwinton
Apparently we have code that relies on crop="none" being the default crop
type, and being almost, but not quite, the same as crop="right". In
particular, it does add an ellipsis when when the text is too long, but it
also sets the minimum width of the element to the width of the text.

Since we need the actual documented behavior of crop="none", and we can't
change the current behavior without breaking a lot of existing code, I added a
new crop="auto" type to handle the former behavior, and made it the default.
Attachment #8718223 - Flags: review?(enndeakin)
Keywords: leave-open
Comment on attachment 8718223 [details] [diff] [review]
Part 1 - Correctly support crop="none" in XUL labels

OK, looks good.
Attachment #8718223 - Flags: review?(enndeakin) → review+
https://hg.mozilla.org/integration/fx-team/rev/62cc4b503870cf7be4ae0c530a3d7ab99c8585b9
Bug 1213895: Part 1 - Correctly support crop="none" in XUL labels. r=neil
Keywords: leave-open
https://hg.mozilla.org/mozilla-central/rev/62cc4b503870
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla47
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: