git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCHv6 3/8] gitweb: right-align date cell in shortlog

From
Jakub Narebski <jnareb@gmail.com>
Date
Jun 27, 2009, 12:14 UTC
Message-ID
<200906271414.53717.jnareb@gmail.com>
In-Reply-To
<cb7bb73a0906261106n5e12948dydd02bd8d1b19a5e6@mail.gmail.com>
On Fri, 26 June 2009, Giuseppe Bilotta wrote:
Show 12 quoted lines
> 2009/6/26 Jakub Narebski <jnareb@gmail.com>:
>> On Thu, 25 June 2009, Giuseppe Bilotta wrote:
>>
>>> diff --git a/gitweb/gitweb.css b/gitweb/gitweb.css
>>> index 68b22ff..7240ed7 100644
>>> --- a/gitweb/gitweb.css
>>> +++ b/gitweb/gitweb.css
>>> @@ -180,6 +180,10 @@ table {
>>
>>> +table.shortlog td:first-child{
>>> +     text-align: right;
>>> +}
Show 6 quoted lines
>> Second, I'd rather avoid more advanced CSS constructs; not all web
>> browsers support ':first-child' selector.  On the other hand adding
>> class attribute to handle this would make page slightly larger.
> 
> IIRC :first-child is supported from IE7 onwards. There are hacks to
> make it work on IE6, but I think they are definitely not worth it.

I was thinking here about more exotic web browsers, like Lynx, ELinks, w3m (and w3m in Emacs), Konqueror (KHTML). I think that both Opera and Safari (and other browsers based on WebKit engine) support ':first-child' pseudo-class selector. Also I'd rather not start trend to use more advanced parts of CSS...

On the other hand if we introduce 'age coloring' (as used in projects list view), by using classes age0..age2, then we would be able to use class selector instead of :first-child pseudo-class selector for that.

Show 16 quoted lines
>> Last, and most important: I don't agree with this change.  In my
>> opinion it does not improve layout (and you didn't provide support
>> for this change).  Right-align justification should be sparingly,
>> as it is not natural in left-to-right languages.
> 
> Of course, in my opinion it does improve layout.
> 
> The effect is to right-align the first column of shortlog view, i.e.
> the one holding the date. For dates that are presented as yyyy-mm-dd
> it makes not difference, but when the phrasing is 'X days ago' it
> provides the benefit of aligning the 'days ago' part instead of having
> it ragged. See it live at
> 
> http://git.oblomov.eu/git/shortlog
> 
> and judge for yourselves.
First, it would be nice to have
  See it live at http://git.oblomov.eu/git/shortlog
in the patch comment (between "---\n" line and diffstat).
And I took a look how it looks like, with:
 $ <mark whole thread>
 $ <save as>
 $ git am -3 <file>
 $ stg uncommit -n <n>
 $ stg pop -a
 $ stg push
 $ gitweb-update.sh
 $ <view http://localhost/cgi-bin/gitweb/gitweb.cgi>
 $ ...

Second, even disregarding using ':first-child' pseudo-class selector (it is not that important issue that it is required to have this supported in all browsers), there is problem that this change is _incomplete_. Take a look at 'summary' view (probably most used project specific action): in 'shortlog' you have date right-aligned, while date column in 'heads' and 'tags' parts below you have date left-aligned.

Third, in my opinion it does not improve layout. You align on least important part of relative date specification: on the word "ago". Unit specifiers in relative date specification are of different length so you don't have align (or rather have align in sort subsequences).

Compare:
  15 min ago
  6 hours ago
  10 hours ago
  2 days ago
  2 weeks ago
  6 months ago
  2009-06-12
with
    15 min ago
   6 hours ago
  10 hours ago
    2 days ago
   2 weeks ago
  6 months ago
    2009-06-12

What you probably want to have (and which I am not sure if it is worth complication) is to align on first space/whitespace (align="char" char=" ")

  15 min ago
   6 hours ago
  10 hours ago
   2 days ago
   2 weeks ago
   6 months ago
  2009-06-12
or even
  15 min    ago
   6 hours  ago
  10 hours  ago
   2 days   ago
   2 weeks  ago
   6 months ago
  2009-06-12
-- 
Jakub Narebski
Poland
Previous: Junio C HamanoNext: Jakub Narebski
Message 34 of 46 in “[PATCHv6 0/8] gitweb: gravatar support”
  1. Giuseppe BilottaJun 25, 2009
  2. 1/8 gitweb: refactor author name insertionGiuseppe Bilotta, Jun 25, 2009
  3. 2/8 gitweb: uniform author info for commit and commitdiffGiuseppe Bilotta, Jun 25, 2009
  4. 3/8 gitweb: right-align date cell in shortlogGiuseppe Bilotta, Jun 25, 2009
  5. 4/8 gitweb: (gr)avatar supportGiuseppe Bilotta, Jun 25, 2009
  6. 5/8 gitweb: gravatar url cacheGiuseppe Bilotta, Jun 25, 2009
  7. 6/8 gitweb: add 'alt' to avatar imagesGiuseppe Bilotta, Jun 25, 2009
  8. 7/8 gitweb: recognize 'trivial' acksGiuseppe Bilotta, Jun 25, 2009
  9. 8/8 gitweb: add avatar in signoff linesGiuseppe Bilotta, Jun 25, 2009
  10. 9/8 gitweb: put signoff lines in a tableGiuseppe Bilotta, Jun 25, 2009
  11. Jakub NarebskiJun 27, 2009
  12. Jakub NarebskiJun 27, 2009
  13. Giuseppe BilottaJun 27, 2009
  14. Jakub NarebskiJun 27, 2009
  15. Junio C HamanoJun 27, 2009
  16. Giuseppe BilottaJun 27, 2009
  17. Jakub NarebskiJun 26, 2009
  18. Thomas AdamJun 27, 2009
  19. Jakub NarebskiJun 26, 2009
  20. Giuseppe BilottaJun 26, 2009
  21. Jakub NarebskiJun 26, 2009
  22. Jakub NarebskiJun 26, 2009
  23. Giuseppe BilottaJun 26, 2009
  24. Jakub NarebskiJun 26, 2009
  25. Giuseppe BilottaJun 26, 2009
  26. Jakub NarebskiJun 26, 2009
  27. Junio C HamanoJun 27, 2009
  28. Giuseppe BilottaJun 27, 2009
  29. Jakub NarebskiJun 26, 2009
  30. Giuseppe BilottaJun 26, 2009
  31. Junio C HamanoJun 26, 2009
  32. Giuseppe BilottaJun 26, 2009
  33. Junio C HamanoJun 26, 2009
  34. Jakub NarebskiJun 27, 2009
  35. Jakub NarebskiJun 27, 2009
  36. Jakub NarebskiJun 25, 2009
  37. Giuseppe BilottaJun 26, 2009
  38. Jakub NarebskiJun 25, 2009
  39. Jakub NarebskiJun 25, 2009
  40. Giuseppe BilottaJun 25, 2009
  41. Jakub NarebskiJun 25, 2009
  42. Giuseppe BilottaJun 25, 2009
  43. Junio C HamanoJun 25, 2009
  44. Giuseppe BilottaJun 25, 2009
  45. Junio C HamanoJun 25, 2009
  46. Jakub NarebskiJun 25, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.