jayvdb created this task.
Herald added subscribers: pywikibot-bugs-list, Aklapper.

TASK DESCRIPTION
  Pywikibot includes lots of text messages (especially scripts), and they fall 
into three categories:
  
  1. very short messages, unlikely to wrap except on very small devices
  2. no length limits, with long text wrapping onto the next line, and
  3. fixed width, and
  4. variable width with an attempt to limit the width in a sensible but 
unreliable way
  
  As option 1 is very common, we should decide on a 'minimum width' that is 
acceptable for Pywikibot usage, and any message shorter than or equal to that 
is considered OK from a UI perspective.
  
  Almost any attempt to provide a nice layout will fail when page titles are 
involved, as the page title can be 255 *bytes* of utf8, which can mean fewer 
characters in some scripts, but it means 255 characters of typical Latin 
script.  An example of a very long redirect is 
https://en.wikipedia.org/w/index.php?title=To_authorize_the_President_to_extend_the_term_of_the_Agreement_for_Cooperation_between_the_Government_of_the_United_States_of_America_and_the_Government_of_the_Republic_of_Korea_Concerning_Civil_Uses_of_Nuclear_Energy&redirect=no.
   
https://en.wikipedia.org/wiki/Suzukake_no_Ki_no_Michi_de_%22Kimi_no_Hohoemi_o_Yume_ni_Miru%22_to_Itte_Shimattara_Bokutachi_no_Kankei_wa_D%C5%8D_Kawatte_Shimau_no_ka,_Bokunari_ni_Nannichi_ka_Kangaeta_Ue_de_no_Yaya_Kihazukashii_Ketsuron_no_Y%C5%8D_na_Mono
  is the longest real page on English Wikipedia at 210 characters including at 
least two non-ASCII characters, so the actually number of bytes is slightly 
higher..
  
  We need a consistent approach for handling very long titles.  The simplest 
approach that is almost perfect is to detect when a page title is too large for 
the screen and try to find a prefix substring that is sufficient to uniquely 
identify the page, e.g. [[abc foo s...]]
  
  In order to improve the level of 'sensible' width, we need to know what the 
width of the terminal is.
  This was added in Python 3.3 shutil 
<https://docs.python.org/3/library/shutil.html#querying-the-size-of-the-output-terminal>
 and a backport 
<https://pypi.python.org/pypi/backports.shutil_get_terminal_size> exists  , but 
it hasnt been added to `python-future` 
<https://github.com/PythonCharmers/python-future/search?utf8=%E2%9C%93&q=get_terminal_size>
 .
  
  The current UI patch regarding length is 
https://gerrit.wikimedia.org/r/#/c/266587/ (warning about incoming links to 
page being deleted) .  It is going down the path of option 3 - sensible but 
unreliable limits.

TASK DETAIL
  https://phabricator.wikimedia.org/T131510

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: jayvdb
Cc: Aklapper, pywikibot-bugs-list, jayvdb



_______________________________________________
pywikibot-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs

Reply via email to