Closed Bug 929502 Opened 11 years ago Closed 5 years ago

bugs with very long but unwrappable summaries cause the tables to overlap when the window is small

Categories

(bugzilla.mozilla.org :: MyDashboard, defect)

Production
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: glob, Assigned: kohei)

References

Details

Attachments

(4 files, 3 obsolete files)

Attached image screenshot
see attached screenshot, where bug 927285's summary is forcing the bugs table under the flags tables.
Assignee: nobody → dkl
Status: NEW → ASSIGNED
OS: Mac OS X → All
Hardware: x86 → All
Assignee: dkl → dylan
Version: Development/Staging → Production
Status: ASSIGNED → NEW
See Also: → 967261
Status: NEW → ASSIGNED
I wonder which approach is best -- truncation or make the text scrollable?
Truncating this has proved to be more involved than I would have imagined, but I think a solution exists somewhere in the YUI data table configuration:

http://yuilibrary.com/yui/docs/datatable/

    CAVEAT: Column widths will expand beyond the configured value if column
    cells contain data that is long and can't line-wrap. Also, column widths
    may be reduced below the configured value if the table width (by
    configuring the DataTable's width attribute, or constrained by a narrow
    containing element) is too narrow to fit all data at the configured widths.

    To force column widths, including cell data truncation and allowing the
    table to spill beyond its configured or inherited width, wrap the cell
    content in a <div> either by configuring the column's formatter or
    cellTemplate, then assign the <div>'s CSS style with the desired width (or
    "inherit"), plus overflow: hidden;. Then set the DataTable column's width
    configuration accordingly.
Attached patch bug-929502-v1.patch (obsolete) — Splinter Review
Attachment #8380622 - Flags: review?(glob)
Comment on attachment 8380622 [details] [diff] [review]
bug-929502-v1.patch

breaking on any character causes unreadable summaries, even in cases where the table isn't overlapping.
Attachment #8380622 - Flags: review?(glob) → review-
Attached patch bug-929502-v2-WIP.patch (obsolete) — Splinter Review
With a new test case that contains more than two words (*grin*) I have made some progress. Finding the right widths for each of the columns is proving a bit difficult -- and there is still a wrapping issue when you click the row expansion link.
Attachment #8380622 - Attachment is obsolete: true
I've not made much headway with making this look decent on both normal-sized and large-sized displays.
you can use regex to insert a "zero width space" unicode character on each word boundary, which would allow for line breaks on punctuation and other stuff.

if that is not enough, AND_LONG_TEXT_RUNS_LIKE_THIS_STILL_CAUSE_PROBLEMS, you can also break long (20+ char) words with the same technique.
Priority: -- → P3
Perhaps this will be fixed by porting to the jquery-based data table.
Severity: normal → minor
It seems to me this should be solved using flexbox.
Assignee: dylan → gideon425xx
I now have a fix for this.

I want to create a patch for review. However, I assume that I need to clone git.mozilla.org as part of this and I cannot see how to do this.
Flags: needinfo?(dylan)
okay, I think I have figured it out
Flags: needinfo?(dylan)
Attached patch p1.txt (obsolete) — Splinter Review
Attachment #8613297 - Attachment is patch: true
Attachment #8613297 - Attachment mime type: application/octet-stream → text/plain
Attachment #8613297 - Flags: feedback?(dylan)
Comment on attachment 8613297 [details] [diff] [review]
p1.txt

Review of attachment 8613297 [details] [diff] [review]:
-----------------------------------------------------------------

Aside from the issues regarding style, I don't see anything wrong with this approach. Fix the style and ask for review?

::: extensions/MyDashboard/web/js/query.js
@@ +87,5 @@
> +                var str;
> +                var str2;
> +                var count;
> +                var c2;
> +                for (c in e.response.results)

put the curly braces on the same line as their statement to match the existing code
Attachment #8613297 - Flags: feedback?(dylan) → feedback+
Attachment #8381126 - Attachment is obsolete: true
At the moment, the number of characters in each chunk is fixed. Perhaps I should make it configurable with a field in User Preferences
Flags: needinfo?(dylan)
(In reply to gideon425xx from comment #21)
> At the moment, the number of characters in each chunk is fixed. Perhaps I
> should make it configurable with a field in User Preferences

there's no reason for that to be user or admin configurable.

ps. instead of appending a normal space it would probably be better to use a zero-width space - http://www.fileformat.info/info/unicode/char/200b/index.htm
Flags: needinfo?(dylan)
(In reply to Byron Jones ‹:glob› from comment #22)
> ps. instead of appending a normal space it would probably be better to use a
> zero-width space -
> http://www.fileformat.info/info/unicode/char/200b/index.htm

.. or <wbr> - https://developer.mozilla.org/en-US/docs/Web/HTML/Element/wbr
Attached image x2.jpg
Attached image x3.jpg
Attachment #8616026 - Attachment mime type: application/octet-stream → image/png
Attachment #8616027 - Attachment mime type: application/octet-stream → image/png
The two attachments (before is 8616026 and after is 8616027) show another issue with the dashboard, namely that when additional details for a bug are displayed, the box can widen to overlap one on the right.

I think it would be a good idea to fix this as part of this bug.

My idea now is to implement the fix using javascript and perl, but with less reliance on YUI. Also I would be using flexbox and style "white-space:pre-wrap; word-wrap:break-word" lines. I have tested this and it works with firefox, breaking at words where possible but splitting up words when they are longer than the available space. It also does not involve any hard-coding of numbers of characters.

Before I go ahead with this, I wanted to get a feeling that such a patch would be approved for integration. Do you see any problems with my proposal?
Flags: needinfo?(glob)
(In reply to gideon425xx from comment #26)

> Before I go ahead with this, I wanted to get a feeling that such a patch
> would be approved for integration. Do you see any problems with my proposal?

i can't think of any issues with that proposal.
Flags: needinfo?(glob)
Attachment #8613297 - Attachment is obsolete: true
Just a quick note to say that work is continuing on this
I am stopping work on this. To fix this in the way I had intended seems like a lot of changes for my first contribution to bmo, risking breaking a lot of things.
Assignee: gideon425xx → nobody
Status: ASSIGNED → NEW
Priority: P3 → --
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX

This is annoying for sure so I’ll try to fix this. On the bug page and regular bug lists, we are already inserting <wbr> to bug summaries to work around the issue.

Assignee: nobody → kohei.yoshino
Severity: minor → normal
Status: RESOLVED → REOPENED
Resolution: WONTFIX → ---
See Also: 9672611428270
Attached file GitHub Pull Request
Status: REOPENED → ASSIGNED

Merged to master.

Status: ASSIGNED → RESOLVED
Closed: 6 years ago5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: