ashishkranjan / dabr

Automatically exported from code.google.com/p/dabr
0 stars 0 forks source link

Text wrapping to prevent horizontal scrollbar #47

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What are the steps to trigger the problem?
1) select replies
2) view replies

What happened?
text does not wrap, stays all on single line causing horizontal scrollbar 

What did you expect to happen?
text to wrap just like it does in the other views.

Original issue reported on code.google.com by Maxthon...@gmail.com on 21 Jun 2009 at 1:02

GoogleCodeExporter commented 9 years ago
This is typically a temporary problem caused by long tweets like "Oh 
nooooooooooooooooooooooooooo!". It's something that could probably be "fixed" 
in such a 
way that makes it worse for others. Any fix should be careful not to stop long 
URLs 
from working.

Original comment by david.carrington on 11 Aug 2009 at 9:31

GoogleCodeExporter commented 9 years ago
Issue 23 has been merged into this issue.

Original comment by david.carrington on 11 Aug 2009 at 9:38

GoogleCodeExporter commented 9 years ago
Been looking in to this - it's especially bad when you set URLs to autoexpand.
HTML doesn't support wrapping inside tables (used in Dabr) and it's not 
supported via
CSS until CSS3 (rules out lots of mobile phones).

So, I'm going to see which mobile browsers support the <wbr> tag
(http://net.tutsplus.com/articles/web-roundups/10-rare-html-tags-you-really-shou
ld-know/
and http://www.quirksmode.org/oddsandends/wbr.html for details)

I reckon on placing it in any word >=20 characters.  That sound about right?
I figure, worse case scenario the unsupported browser will just ignore it.

Original comment by terence.eden on 24 Dec 2009 at 10:47

GoogleCodeExporter commented 9 years ago
We can accomplish this using PHP's wordwrap function -
http://www.php.net/manual/en/function.wordwrap.php

The question is, how many characters should this be cut off at?  I'd say that 32
characters is long enough not to break most English words - but it may break 
apart
some German and Japanese words.

Without knowing the width of the phone's screen (and font size)* etc it's
impracticable to calculate the "best" word wrap length.

So, for now, I'm suggesting a word wrap of 32 characters for URLs only.

Any objections / questions?

T
*Well, you could using DeviceAtlas or WURFL - but that would involve installing 
extra
software and could mean spending time calculating a width which may be 
incorrect.

Original comment by terence.eden on 9 Feb 2010 at 1:52

GoogleCodeExporter commented 9 years ago
While this benefits mobile users, it's also slightly detrimental to PC users - 
approx
35%. Stupidly - I had not previously considered that this could be handled by a
theme() function and ignored appropriately on desktops.

The majority of mobile traffic comes through Opera Mini, where it is impossible 
to
judge screen size.

Original comment by david.carrington on 9 Feb 2010 at 2:04

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
In URLs it's not that noticeable. A random URL when rendered looks like
http://nlabnetworks.typepad.com/_transliteracy/2010/02/thoughts-a_t-half-time-at
-the-transliteracy_-conference-.html

Funnily enough, I use the Touch Mode when I use via the desktop.  I don't 
suppose
you've got any way of knowing which theme is used by the majority of desktop 
browsers?

Original comment by terence.eden on 9 Feb 2010 at 2:17

GoogleCodeExporter commented 9 years ago
I don't have any storage or stats on what themes people are using.

Original comment by david.carrington on 9 Feb 2010 at 2:18

GoogleCodeExporter commented 9 years ago
curious as to why, with expanded URLs, the entire URL needs to be _shown_ 
instead of just the domain the link is 
coming from

Original comment by ldoug...@gmail.com on 11 Feb 2010 at 12:42

GoogleCodeExporter commented 9 years ago
@lgouglas I agree that you could show just the domain - like Slashdot.  But, 
for me,
that's only half the point.  Not only do I want to know that the link I'm going 
to is
on a safe domain, I also want to know whether it's a story I've read before.

So, seeing "@edent check out [example.com]" isn't as useful as "@edent check out
example.com/blog/story-about-dabr"

I could set it so that you see the short URL but when you hover you see the 
full URL
- but that breaks the tracking built in to some URL shorteners.  Which, 
admittedly,
isn't our concern.

Original comment by terence.eden on 11 Feb 2010 at 8:27

GoogleCodeExporter commented 9 years ago
ahh - I didn't think about url shortener tracking. Plus i agree the hover 
wouldn't be
as useful on a mobile. Not sure how you could handle it other than showing the 
short
link as well as the long link - maybe below? maybe truncated?

Original comment by ldoug...@gmail.com on 13 Feb 2010 at 6:42

GoogleCodeExporter commented 9 years ago
Since removing TABLEs and switching to DIVs the affects of really 
looooooooooooooooooooooooooooong words is negated in that only that tweet 
scrolls over, whilst the rest remain in the viewport.

Original comment by ryancul...@gmail.com on 3 May 2011 at 10:12