Last modified: 2010-05-15 16:03:35 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T16398, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 14398 - mwsuggest.js: Let width of container be configurable
mwsuggest.js: Let width of container be configurable
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Search (Other open bugs)
1.13.x
All All
: Normal enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks: javascript css
  Show dependency treegraph
 
Reported: 2008-06-03 21:19 UTC by Dan Barrett
Modified: 2010-05-15 16:03 UTC (History)
6 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Dan Barrett 2008-06-03 21:19:33 UTC
For AJAX search with $wgEnableMWSuggest, the width of the autosuggest box is hard-coded to be the same as the search box:

function os_createContainer(r){
...
  c.style.width = s.offsetWidth+"px";

Please let this width be a system-configurable or user-configurable parameter.  If a wiki has many long article titles, this limits the usefulness of the AJAX search.

Thanks.
Comment 1 Aaron Schulz 2008-09-05 03:27:34 UTC
This would look pretty sloppy. Do note that when the cursor is over a title, the full title shows in a tooltip box already.
Comment 2 Dan Barrett 2008-09-05 03:51:23 UTC
Hmmm... I don't think it looks sloppy (we're using a larger width and 280 people are happy), and the functionality is greatly improved. Imagine looking at these dropdown results:

Star
star
star
star
star
star
star
star

They're useless until you expand the width.

Starbucks
starch
stare
starfish
stargazer
stark
...

Mousing over each one isn't a solution -- it takes tons of time. The wider dropdown lets the user visually see the right link in one second.  Widening the dropdown instantly increased productivity and user happiness at my company.

Please reconsider...?
Comment 3 Aaron Schulz 2008-09-05 03:57:49 UTC
How many identical prefixes are there? And how is this happening all the time?
Comment 4 Dan Barrett 2008-09-05 04:18:49 UTC
In a corporate wiki, it's common for many articles to begin with the same few words, say, the name of a department or a process:

Software development standards
Software development best practices
Software development workstation setup
Software development environment
Software development migration
Software development department
Software development deliverables for September 2008
etc....

Our corporate wiki has 12,000 titles and this kind of repetition happens all the time. Heck, try typing "Software develop" on en.wikipedia and you get the same result (10 lines that say "Software devel").

The first day I enabled mwsuggest functionality on our wiki, 10 users asked if I could increase the width. 

Bottom line: if the dropdown width is configurable, it benefits the sites who want to configure it, and wouldn't impact anyone else who prefers the tidy-looking, search-box-sized default.  Since the code involved is JavaScript, it's hard to write an extension that does this without modifying or duplicating mwsuggest.js.  A global variable like $mwSuggestDropdownWidth for LocalSettings.php, set to the current width as the default, would be very helpful.  (A user preference would be grand (but perhaps overkill).)
Comment 5 Mike.lifeguard 2008-09-05 11:31:04 UTC
Having it widen dynamically to fit the titles displayed (perhaps with a maximum width) would be fine if having it configurable by the user is a concern.
Comment 6 Mike.lifeguard 2008-09-05 11:36:43 UTC
(In reply to comment #3)
> How many identical prefixes are there? And how is this happening all the time?
> 

My first attempt at finding an example to show you:

Wikipedia talk:!...
Wikipedia talk:!L...
Wikipedia talk:!...
Wikipedia talk:!...
Wikipedia talk:!...
Wikipedia talk:!...
Wikipedia talk:"I...
Wikipedia talk:...

These results are 100% useless; tooltips provide a workaround, but using it 100% of the time on results such as these is unacceptable.
Comment 7 Aaron Schulz 2008-09-05 16:56:43 UTC
If this is a problem, it really shouldn't need a config var. The JS should deal with this on it's own.
Comment 8 Robert Stojnic 2008-09-05 20:51:51 UTC
I think this is a problem worth fixing. It would be nice to have adaptable width, and possibly some resizing-animation for eye candy so the user knows the variable width is not a bug. I've made an attempt in r40507. 

All config vars are js variable, so they go to MediaWiki:Common.js. One might for instance want to override os_animation_steps=1 to kill all animation effects, or os_container_max_width to change max relative width. 
Comment 9 Daniel Schwen 2008-09-16 21:30:39 UTC
We made the list width customizable on commons a couple of weeks ago.
http://commons.wikimedia.org/w/index.php?title=MediaWiki%3ACommon.js&diff=13309960&oldid=13295819

Dynamic resizing to adapt to the contents is a tad more work though.

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


Navigation
Links