Bugzilla will be upgraded to version 5.0 on December 2, 2018. The outage period for the upgrade will start at 0:00 UTC and have a duration of 12 hours
Bug 612739 - search suggestions overflow visible space and cause premature wrapping
search suggestions overflow visible space and cause premature wrapping
Status: CLOSED CURRENTRELEASE
Product: RHQ Project
Classification: Other
Component: SearchBar (Show other bugs)
3.0.0
All Linux
low Severity medium (vote)
: ---
: ---
Assigned To: Joseph Marques
John Sanda
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-07-08 17:26 EDT by Joseph Marques
Modified: 2010-08-12 12:54 EDT (History)
1 user (show)

See Also:
Fixed In Version: 2.4
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-08-12 12:54:09 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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

  None (edit)
Description Joseph Marques 2010-07-08 17:26:59 EDT
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 17:28:09 EDT
Created attachment 430479 [details]
screenshot of suggestion overflow/wrapping
Comment 2 Joseph Marques 2010-07-08 17:29:19 EDT
An alternate eliding solution could be to elide the center of the string:

--Elided String--

name=supercalifr...ialidocious
Comment 3 Joseph Marques 2010-07-15 23:49:10 EDT
commit fdef972cd1fdb826536b80e6e2e44f5c07ea2351
Author: Joseph Marques <joseph@redhat.com>
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@redhat.com>
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-15 23:59:00 EDT
Created attachment 432282 [details]
shows basic wrapping solution
Comment 5 Joseph Marques 2010-07-15 23:59:35 EDT
Created attachment 432283 [details]
shows basic wrapping solution w/first-line highlight matching
Comment 6 Joseph Marques 2010-07-16 00:00:07 EDT
Created attachment 432284 [details]
shows basic wrapping solution w/other-than-first-line highlight matching
Comment 7 Joseph Marques 2010-07-16 00:00:30 EDT
Created attachment 432285 [details]
shows basic wrapping solution w/highlight matching across lines
Comment 8 Joseph Marques 2010-07-16 00:05:40 EDT
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-19 20:23:34 EDT
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 12:54:09 EDT
Mass-closure of verified bugs against JON.

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