Обсуждение: Undesirable whitespace treatment in mail archive display

Поиск
Список
Период
Сортировка

Undesirable whitespace treatment in mail archive display

От
Tom Lane
Дата:
Since we moved to the new website design, the mailing list archives
display all messages with leading indentation suppressed.  This can
be pretty awful, eg in the code fragment here:

https://www.postgresql.org/message-id/20180611170812.7ypf6xs6dlteo57j@alap3.anarazel.de

Looking closer, I think it may not just be leading indentation that
gets lost; seems like *any* whitespace string gets smashed to a
single space, cf followup at

https://www.postgresql.org/message-id/7382.1528737252%40sss.pgh.pa.us

which certainly does not look like it did in my outbox.

I assume this is just an ill-considered stylesheet choice somewhere
... can we fix it please?

            regards, tom lane


Re: Undesirable whitespace treatment in mail archive display

От
"Jonathan S. Katz"
Дата:
> On Jun 11, 2018, at 1:47 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> Since we moved to the new website design, the mailing list archives
> display all messages with leading indentation suppressed.  This can
> be pretty awful, eg in the code fragment here:
>
> https://www.postgresql.org/message-id/20180611170812.7ypf6xs6dlteo57j@alap3.anarazel.de
>
> Looking closer, I think it may not just be leading indentation that
> gets lost; seems like *any* whitespace string gets smashed to a
> single space, cf followup at
>
> https://www.postgresql.org/message-id/7382.1528737252%40sss.pgh.pa.us
>
> which certainly does not look like it did in my outbox.
>
> I assume this is just an ill-considered stylesheet choice somewhere
> ... can we fix it please?

Hmm…agreed. I’m going to check the old code to see how that was handled. This
may have occurred when trying to make the archives readable across different
viewports.

Jonathan



Re: Undesirable whitespace treatment in mail archive display

От
Daniel Gustafsson
Дата:
> On 11 Jun 2018, at 19:52, Jonathan S. Katz <jkatz@postgresql.org> wrote:
>
>>
>> On Jun 11, 2018, at 1:47 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>>
>> Since we moved to the new website design, the mailing list archives
>> display all messages with leading indentation suppressed.  This can
>> be pretty awful, eg in the code fragment here:
>>
>> https://www.postgresql.org/message-id/20180611170812.7ypf6xs6dlteo57j@alap3.anarazel.de
>>
>> Looking closer, I think it may not just be leading indentation that
>> gets lost; seems like *any* whitespace string gets smashed to a
>> single space, cf followup at
>>
>> https://www.postgresql.org/message-id/7382.1528737252%40sss.pgh.pa.us
>>
>> which certainly does not look like it did in my outbox.
>>
>> I assume this is just an ill-considered stylesheet choice somewhere
>> ... can we fix it please?
>
> Hmm…agreed. I’m going to check the old code to see how that was handled. This
> may have occurred when trying to make the archives readable across different
> viewports.

The below diff will retain the whitespace included the post.  It doesn’t seem
to make it less readable on smaller viewports (although more scrolling), but I
only tested quickly so more input is welcome.

cheers ./daniel

diff --git a/media/css/main.css b/media/css/main.css
index 6221d90..46e427d 100644
--- a/media/css/main.css
+++ b/media/css/main.css
@@ -771,6 +771,7 @@ h3.messages {
     font-size: 0.8em;
     line-height: 1.2em;
     margin: 0 auto;
+    white-space: pre;
 }

Re: Undesirable whitespace treatment in mail archive display

От
"Jonathan S. Katz"
Дата:

On Jun 11, 2018, at 1:58 PM, Daniel Gustafsson <daniel@yesql.se> wrote:

On 11 Jun 2018, at 19:52, Jonathan S. Katz <jkatz@postgresql.org> wrote:


On Jun 11, 2018, at 1:47 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Since we moved to the new website design, the mailing list archives
display all messages with leading indentation suppressed.  This can
be pretty awful, eg in the code fragment here:

https://www.postgresql.org/message-id/20180611170812.7ypf6xs6dlteo57j@alap3.anarazel.de

Looking closer, I think it may not just be leading indentation that
gets lost; seems like *any* whitespace string gets smashed to a
single space, cf followup at

https://www.postgresql.org/message-id/7382.1528737252%40sss.pgh.pa.us

which certainly does not look like it did in my outbox.

I assume this is just an ill-considered stylesheet choice somewhere
... can we fix it please?

Hmm…agreed. I’m going to check the old code to see how that was handled. This
may have occurred when trying to make the archives readable across different
viewports.

The below diff will retain the whitespace included the post.  It doesn’t seem
to make it less readable on smaller viewports (although more scrolling), but I
only tested quickly so more input is welcome.

I did some testing locally and it does solve the whitespace problem, but
introduces the following:

1. The line heights are not a bit larger, which could introduce the return of
the “scrolling” problem.

2. We lose the mobile-friendly wrapping that was introduced.

Looking at our mobile traffic numbers, I’d be inclined to solve the immediate
issue of the whitespace problem and make it a bit harder to use the archives on
mobile temporarily while looking for a better solution. In other words, we don’t
have that much mobile traffic in the archives.

I can tweak the line heights the make the scrolling not as bad, if not the same.
I’ll experiment and once it looks like before push / commit.

Jonathan

Re: Undesirable whitespace treatment in mail archive display

От
"Jonathan S. Katz"
Дата:

On Jun 11, 2018, at 2:09 PM, Jonathan S. Katz <jkatz@postgresql.org> wrote:


On Jun 11, 2018, at 1:58 PM, Daniel Gustafsson <daniel@yesql.se> wrote:

On 11 Jun 2018, at 19:52, Jonathan S. Katz <jkatz@postgresql.org> wrote:


On Jun 11, 2018, at 1:47 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Since we moved to the new website design, the mailing list archives
display all messages with leading indentation suppressed.  This can
be pretty awful, eg in the code fragment here:

https://www.postgresql.org/message-id/20180611170812.7ypf6xs6dlteo57j@alap3.anarazel.de

Looking closer, I think it may not just be leading indentation that
gets lost; seems like *any* whitespace string gets smashed to a
single space, cf followup at

https://www.postgresql.org/message-id/7382.1528737252%40sss.pgh.pa.us

which certainly does not look like it did in my outbox.

I assume this is just an ill-considered stylesheet choice somewhere
... can we fix it please?

Hmm…agreed. I’m going to check the old code to see how that was handled. This
may have occurred when trying to make the archives readable across different
viewports.

The below diff will retain the whitespace included the post.  It doesn’t seem
to make it less readable on smaller viewports (although more scrolling), but I
only tested quickly so more input is welcome.

I did some testing locally and it does solve the whitespace problem, but
introduces the following:

1. The line heights are not a bit larger, which could introduce the return of
the “scrolling” problem.

2. We lose the mobile-friendly wrapping that was introduced.

Looking at our mobile traffic numbers, I’d be inclined to solve the immediate
issue of the whitespace problem and make it a bit harder to use the archives on
mobile temporarily while looking for a better solution. In other words, we don’t
have that much mobile traffic in the archives.

I can tweak the line heights the make the scrolling not as bad, if not the same.
I’ll experiment and once it looks like before push / commit.

Below is what I’m thinking. This should keep the whitespace and
continue to keep the scroll relatively tight. It also helps to not look as bad on
mobile, though it’s still not great.

If this is acceptable I can get it committed.

Jonathan


diff --git a/django/media/css/main.css b/django/media/css/main.css
index 6221d90..39358d3 100644
--- a/django/media/css/main.css
+++ b/django/media/css/main.css
@@ -768,9 +768,14 @@ h3.messages {
 .message-content {
     display: inline-block;
     font-family: monospace, monospace;
-    font-size: 0.8em;
-    line-height: 1.2em;
+    font-size: 0.7em;
+    line-height: 1.1em;
     margin: 0 auto;
+    white-space: pre;
+}
+
+.message-content p {
+    margin-bottom: 0;
 }

Re: Undesirable whitespace treatment in mail archive display

От
"Jonathan S. Katz"
Дата:

On Jun 11, 2018, at 2:22 PM, Jonathan S. Katz <jkatz@postgresql.org> wrote:


On Jun 11, 2018, at 2:09 PM, Jonathan S. Katz <jkatz@postgresql.org> wrote:


On Jun 11, 2018, at 1:58 PM, Daniel Gustafsson <daniel@yesql.se> wrote:

On 11 Jun 2018, at 19:52, Jonathan S. Katz <jkatz@postgresql.org> wrote:


On Jun 11, 2018, at 1:47 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Since we moved to the new website design, the mailing list archives
display all messages with leading indentation suppressed.  This can
be pretty awful, eg in the code fragment here:

https://www.postgresql.org/message-id/20180611170812.7ypf6xs6dlteo57j@alap3.anarazel.de

Looking closer, I think it may not just be leading indentation that
gets lost; seems like *any* whitespace string gets smashed to a
single space, cf followup at

https://www.postgresql.org/message-id/7382.1528737252%40sss.pgh.pa.us

which certainly does not look like it did in my outbox.

I assume this is just an ill-considered stylesheet choice somewhere
... can we fix it please?

Hmm…agreed. I’m going to check the old code to see how that was handled. This
may have occurred when trying to make the archives readable across different
viewports.

The below diff will retain the whitespace included the post.  It doesn’t seem
to make it less readable on smaller viewports (although more scrolling), but I
only tested quickly so more input is welcome.

I did some testing locally and it does solve the whitespace problem, but
introduces the following:

1. The line heights are not a bit larger, which could introduce the return of
the “scrolling” problem.

2. We lose the mobile-friendly wrapping that was introduced.

Looking at our mobile traffic numbers, I’d be inclined to solve the immediate
issue of the whitespace problem and make it a bit harder to use the archives on
mobile temporarily while looking for a better solution. In other words, we don’t
have that much mobile traffic in the archives.

I can tweak the line heights the make the scrolling not as bad, if not the same.
I’ll experiment and once it looks like before push / commit.

Below is what I’m thinking. This should keep the whitespace and
continue to keep the scroll relatively tight. It also helps to not look as bad on
mobile, though it’s still not great.

If this is acceptable I can get it committed.

Committed and pushed. Changes should be visible in that thread and as caches
clear.

I did some more research into the CSS directive Daniel posted and found that
“pre-wrap” can give us the same effect that we had on mobile before (though
long lines don’t look great) so I think we have as close to best-of-all-worlds for
now.

Please let me know if this adversely affects scrolling and I can look into adjusting.

Thanks,

Jonathan

Re: Undesirable whitespace treatment in mail archive display

От
Daniel Gustafsson
Дата:
> On 11 Jun 2018, at 20:40, Jonathan S. Katz <jkatz@postgresql.org> wrote:

> I did some more research into the CSS directive Daniel posted and found that
> “pre-wrap” can give us the same effect that we had on mobile before (though
> long lines don’t look great) so I think we have as close to best-of-all-worlds for
> now.

For reading indented code, sideways scrolling is preferrable to wrapping or
whitespace squashing so +1 on the current approach.  If we wan’t to improve
further I think pulling down the font-size for mobile devices in landscape mode
is the way forward, but let’s await actual complaints before hacking on it
further since desktop will most likely be the main viewport for the lists.

cheers ./daniel

Re: Undesirable whitespace treatment in mail archive display

От
Tom Lane
Дата:
"Jonathan S. Katz" <jkatz@postgresql.org> writes:
> Committed and pushed. Changes should be visible in that thread and as caches
> clear.

Hm ... there's now a surprisingly large amount of vertical space between
paragraphs (ie, double newlines in the original text).  Weird that this
affects that.

            regards, tom lane


Re: Undesirable whitespace treatment in mail archive display

От
"Jonathan S. Katz"
Дата:
> On Jun 11, 2018, at 3:06 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> "Jonathan S. Katz" <jkatz@postgresql.org> writes:
>> Committed and pushed. Changes should be visible in that thread and as caches
>> clear.
>
> Hm ... there's now a surprisingly large amount of vertical space between
> paragraphs (ie, double newlines in the original text).  Weird that this
> affects that.

Yeah, that’s an effect of the “pre” text. I tried to reduce the impact by
lowering the font size and line height, but it still starkly stands out.

I’ll do some research to see if there is another CSS property to help
minimize that gap.

Jonathan



Re: Undesirable whitespace treatment in mail archive display

От
"Jonathan S. Katz"
Дата:

On Jun 11, 2018, at 3:11 PM, Jonathan S. Katz <jkatz@postgresql.org> wrote:


On Jun 11, 2018, at 3:06 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

"Jonathan S. Katz" <jkatz@postgresql.org> writes:
Committed and pushed. Changes should be visible in that thread and as caches
clear.

Hm ... there's now a surprisingly large amount of vertical space between
paragraphs (ie, double newlines in the original text).  Weird that this
affects that.

Yeah, that’s an effect of the “pre” text. I tried to reduce the impact by
lowering the font size and line height, but it still starkly stands out.

I’ll do some research to see if there is another CSS property to help
minimize that gap.

Based upon some research this did not sound like a problem people were
trying to solve, but I tested, committed and pushed a change that should help
reduce the gap. Will be available as caches clear, but I did apply it to originally
discussed thread[1].

Thanks,

Jonathan

Re: Undesirable whitespace treatment in mail archive display

От
Tom Lane
Дата:
"Jonathan S. Katz" <jkatz@postgresql.org> writes:
>> On Jun 11, 2018, at 3:11 PM, Jonathan S. Katz <jkatz@postgresql.org> wrote:
>>> On Jun 11, 2018, at 3:06 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>>>> Hm ... there's now a surprisingly large amount of vertical space between
>>>> paragraphs (ie, double newlines in the original text).  Weird that this
>>>> affects that.

> Based upon some research this did not sound like a problem people were
> trying to solve, but I tested, committed and pushed a change that should help
> reduce the gap. Will be available as caches clear, but I did apply it to originally
> discussed thread[1].

Thanks, it looks more proportionate now.  The text is all rather tightly
set now, but I guess we're doing that intentionally to conserve screen
space.

            regards, tom lane


Re: Undesirable whitespace treatment in mail archive display

От
"Jonathan S. Katz"
Дата:
> On Jun 11, 2018, at 4:23 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> "Jonathan S. Katz" <jkatz@postgresql.org> writes:
>>> On Jun 11, 2018, at 3:11 PM, Jonathan S. Katz <jkatz@postgresql.org> wrote:
>>>> On Jun 11, 2018, at 3:06 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>>>>> Hm ... there's now a surprisingly large amount of vertical space between
>>>>> paragraphs (ie, double newlines in the original text).  Weird that this
>>>>> affects that.
>
>> Based upon some research this did not sound like a problem people were
>> trying to solve, but I tested, committed and pushed a change that should help
>> reduce the gap. Will be available as caches clear, but I did apply it to originally
>> discussed thread[1].
>
> Thanks, it looks more proportionate now.  The text is all rather tightly
> set now, but I guess we're doing that intentionally to conserve screen
> space.

Pushed a fixed to relax the spacing that should still conserve screen space.
Available after next cache clear, etc.

Jonathan