Closed Bug 1178129 Opened 9 years ago Closed 9 years ago

Long-press dialog should truncate URL

Categories

(Firefox for iOS :: Browser, defect)

All
iOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Tracking Status
fxios + ---

People

(Reporter: rnewman, Assigned: karim, Mentored)

Details

Attachments

(3 files)

Attached image 2015-06-27 20.59.10.png
See screenshot for the behavior long-pressing a Yahoo image search result.
how would you like this to be done rnewman? (in terms of just capping the url at a specific character count, etc.)
Attached file Pull request
Attachment #8629612 - Flags: review?(rnewman)
Some widgets will do this automatically. If this alert doesn't, then at least break this functionality out into an extension on String. And use "…" not "...".

Over to someone who's not on PTO for the next step, though!
Mentor: sleroux, etoop
Comment on attachment 8629612 [details]
Pull request

Thanks for the patch! See comments earlier in the bug.
Attachment #8629612 - Flags: review?(rnewman) → feedback+
UIAlertController doesn't truncate the title out of the box, so I wrote a String extension for that. I tried "…" instead of "..." first, but for some reason, a line break was appended after the "…" which didn't look nice (*In the UI*, not as a \n or \r character in the string)
Flags: needinfo?(rnewman)
Attachment #8633055 - Flags: review?(rnewman)
Assignee: nobody → kbenhmida
Comment on attachment 8633055 [details] [review]
Link to Github pull-request: https://github.com/mozilla/firefox-ios/pull/724

Looking much better. Let's get some tests and fix those off-by-one errors :)
Flags: needinfo?(rnewman)
Attachment #8633055 - Flags: review?(rnewman) → feedback+
Fixed those errors and added tests. I also left screenshots w/ 3 dots vs ellipsis on Github.
Attachment #8633055 - Flags: review?(rnewman)
If I had to guess, I'd say you want

http://www.fileformat.info/info/unicode/char/2060/index.htm

to tell UIKit not to break there.

That is, the string should be:

"\u{2060}…\u{2060}"

Give that a shot?
Status: NEW → ASSIGNED
(In reply to Richard Newman [:rnewman] from comment #8)
> If I had to guess, I'd say you want
> 
> http://www.fileformat.info/info/unicode/char/2060/index.htm
> 
> to tell UIKit not to break there.
> 
> That is, the string should be:
> 
> "\u{2060}…\u{2060}"
> 
> Give that a shot?

Yes that's exactly what I want. Worked like a charm. I pushed the changes on Github.
Mentor: etoop, sleroux → rnewman
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: