unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
From: Eric Wong <e@80x24.org>
To: meta@public-inbox.org
Cc: Son Luong Ngoc <sluongng@gmail.com>
Subject: [PATCH] view: add [thread overview] anchor next to Date:
Date: Wed, 28 Apr 2021 06:55:22 +0000	[thread overview]
Message-ID: <20210428065522.12795-1-e@80x24.org> (raw)

The existing Subject: anchor to #r may not be 100% obvious,
and we can't stick the phrase "[thread overview]" into the
same line as the Subject without introducing ambiguity.

Fortunately, we have the Date: header directly under it.
Adding "[thread overview]" after the Date: is unambiguous
and won't make the line too long for valid emails.

This hopefully improves navigation ever-so-slightly thanks
to comments by Son Luong Ngoc.

Reported-by: Son Luong Ngoc <sluongng@gmail.com>
Link: https://public-inbox.org/git/YHhfsqfTJ9NzRwS1@C02YX140LVDN.corpad.adbkng.com/
---
 lib/PublicInbox/View.pm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm
index f4f6da11..530c878f 100644
--- a/lib/PublicInbox/View.pm
+++ b/lib/PublicInbox/View.pm
@@ -694,7 +694,7 @@ sub _msg_page_prepare_obuf {
 	for my $v ($eml->header('Date')) {
 		$v = ascii_html($v);
 		obfuscate_addrs($obfs_ibx, $v) if $obfs_ibx; # possible :P
-		$rv .= "Date: $v\n";
+		$rv .= qq{Date: $v\t<a\nhref="#r">[thread overview]</a>\n};
 	}
 	if (!$nr) { # first (and only) message, common case
 		$ctx->{-title_html} = join(' - ', @title);
@@ -739,7 +739,8 @@ sub thread_skel ($$$) {
 			$$skel .= SKEL_EXPAND."\n ";
 			$$skel .= ghost_parent('../', $parent) . "\n";
 		} else {
-			$$skel .= '[no followups] '.SKEL_EXPAND."\n";
+			$$skel .= "<a\nid=r>[no followups]</a> ".
+					SKEL_EXPAND."\n";
 		}
 		$ctx->{next_msg} = undef;
 		$ctx->{parent_msg} = $parent;

                 reply	other threads:[~2021-04-28  6:55 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://public-inbox.org/README

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210428065522.12795-1-e@80x24.org \
    --to=e@80x24.org \
    --cc=meta@public-inbox.org \
    --cc=sluongng@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).