Bug 612739 - search suggestions overflow visible space and cause premature wrapping
Summary: search suggestions overflow visible space and cause premature wrapping
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: RHQ Project
Classification: Other
Component: SearchBar
Version: 3.0.0
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
: ---
Assignee: Joseph Marques
QA Contact: John Sanda
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-07-08 21:26 UTC by Joseph Marques
Modified: 2010-08-12 16:54 UTC (History)
1 user (show)

Fixed In Version: 2.4
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-08-12 16:54:09 UTC
Embargoed:


Attachments (Terms of Use)
screenshot of suggestion overflow/wrapping (69.69 KB, image/png)
2010-07-08 21:28 UTC, Joseph Marques
no flags Details
shows basic wrapping solution (54.14 KB, image/png)
2010-07-16 03:59 UTC, Joseph Marques
no flags Details
shows basic wrapping solution w/first-line highlight matching (58.20 KB, image/png)
2010-07-16 03:59 UTC, Joseph Marques
no flags Details
shows basic wrapping solution w/other-than-first-line highlight matching (33.80 KB, image/png)
2010-07-16 04:00 UTC, Joseph Marques
no flags Details
shows basic wrapping solution w/highlight matching across lines (59.35 KB, image/png)
2010-07-16 04:00 UTC, Joseph Marques
no flags Details

Description Joseph Marques 2010-07-08 21:26:59 UTC
Normally, if the search suggestion text is longer than the width of the drop-down area, it will wrap to the next line.  However, if there isn't any whitespace in the suggestion (such as when users want suggestions for installation directories or application paths), the suggest text will horizontally overflow the completion pop-up.  At the same time, the text will prematurely wrap before the first character of the suggestion, effectively leaving an empty line between suggestion and doubling the height of the suggestion window.  The fix would either be to insert wrapping tokens or elide the beginning of the suggestion.  Both solutions are described below with example results.

Assumptions: the maximum characters a suggestion can contain before wrapping/overflowing as describe in this issue is, say, 30.
Suggestion: "name=supercalifragilisticexpialidocious"

--Wrapping Tokens--

name=supercalifragilisticexpi\
alidocious

--Elided String--

name=...gilisticexpialidocious

Comment 1 Joseph Marques 2010-07-08 21:28:09 UTC
Created attachment 430479 [details]
screenshot of suggestion overflow/wrapping

Comment 2 Joseph Marques 2010-07-08 21:29:19 UTC
An alternate eliding solution could be to elide the center of the string:

--Elided String--

name=supercalifr...ialidocious

Comment 3 Joseph Marques 2010-07-16 03:49:10 UTC
commit fdef972cd1fdb826536b80e6e2e44f5c07ea2351
Author: Joseph Marques <joseph>
Date:   Thu Jul 15 23:39:41 2010 -0400

BZ-612739: ensure that search suggestions never overflow drop-down boundaries

-----

commit c8d7ffa904e66d92b89ae43df500200e7dbe5440
Author: Joseph Marques <joseph>
Date:   Thu Jul 15 23:40:26 2010 -0400

BZ-612739: use more sophisticated highlighting mechanism that respects line breaks

-----

solution i ended up going with treats more than just white-space as characters upon which lines may break.  in this case i also treated back-slash ('\'), slash ('\'), and dash ('-') as additional "line-breakers".  this was sufficient to fix the trait[Application.path] as the slash and backslash nicely tokenize longer path identifiers.  if we want to treat more characters as line-breakers, it could be added easily as the breaking algorithm is generic and takes an array of break-able characters as its input.

Comment 4 Joseph Marques 2010-07-16 03:59:00 UTC
Created attachment 432282 [details]
shows basic wrapping solution

Comment 5 Joseph Marques 2010-07-16 03:59:35 UTC
Created attachment 432283 [details]
shows basic wrapping solution w/first-line highlight matching

Comment 6 Joseph Marques 2010-07-16 04:00:07 UTC
Created attachment 432284 [details]
shows basic wrapping solution w/other-than-first-line highlight matching

Comment 7 Joseph Marques 2010-07-16 04:00:30 UTC
Created attachment 432285 [details]
shows basic wrapping solution w/highlight matching across lines

Comment 8 Joseph Marques 2010-07-16 04:05:40 UTC
also note from the screen shots that suggestions now properly allow highlight-matching on lines other than the first.  prior to this fix, highlight-matching only worked if the string being matched was on the first line of the suggestion; if it were on any other line, the highlighted characters were skewed because of the additional <br/> characters that had to be added to perform the wrapping.

Comment 9 Corey Welton 2010-07-20 00:23:34 UTC
QA Verified:

* Suggestion wraps across multiple lines
* If suggestion is hovered, the gray "selector" background  wraps appropriately
* Highlighting works across multiple lines
* Highlighting works in all multi-line results in the dropdown

Dev can reopen if it is thought that not all cases herein have been appropriately covered.

Comment 10 Corey Welton 2010-08-12 16:54:09 UTC
Mass-closure of verified bugs against JON.


Note You need to log in before you can comment on or make changes to this bug.