user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
* [PATCH 0/2] www: navigation tweaks
@ 2020-08-27 22:04 Eric Wong
  2020-08-27 22:04 ` [PATCH 1/2] www: improve navigation around comtemporary threads Eric Wong
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Eric Wong @ 2020-08-27 22:04 UTC (permalink / raw)
  To: meta

Just some things I noticed could use improvement while
browsing around old archives.  All subjective...

Eric Wong (2):
  www: improve navigation around comtemporary threads
  www: more descriptive pagination

 Documentation/mknews.perl     |  3 +-
 lib/PublicInbox/Feed.pm       |  5 ++-
 lib/PublicInbox/Hval.pm       |  9 ++++-
 lib/PublicInbox/Over.pm       |  2 +-
 lib/PublicInbox/SearchView.pm | 46 +++++++++++++++++++------
 lib/PublicInbox/Smsg.pm       |  2 +-
 lib/PublicInbox/View.pm       | 63 ++++++++++++++++++++++++-----------
 lib/PublicInbox/WwwListing.pm |  4 +--
 lib/PublicInbox/WwwStream.pm  |  9 ++++-
 9 files changed, 105 insertions(+), 38 deletions(-)

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/2] www: improve navigation around comtemporary threads
  2020-08-27 22:04 [PATCH 0/2] www: navigation tweaks Eric Wong
@ 2020-08-27 22:04 ` Eric Wong
  2020-08-27 22:50   ` Kyle Meyer
  2020-08-27 22:05 ` [PATCH 2/2] www: more descriptive pagination Eric Wong
  2020-08-27 22:49 ` [PATCH 0/2] www: navigation tweaks Kyle Meyer
  2 siblings, 1 reply; 6+ messages in thread
From: Eric Wong @ 2020-08-27 22:04 UTC (permalink / raw)
  To: meta

Sometimes it's useful to quickly get to threads and messages
which are contemporaries of the current thread/message being
focused on.  This hopefully improves navigatin by making:

a) the top line (where $INBOX_DIR/description) is shown
   a link to the latest topics in search results and
   per-thread/per-message views.

b) providing a link to contemporaries ("~YYYY-MM-DD") at
   around the thread overview skeleton area for per-thread
   and per-message views
---
 Documentation/mknews.perl     |  3 ++-
 lib/PublicInbox/Hval.pm       |  9 ++++++-
 lib/PublicInbox/Over.pm       |  2 +-
 lib/PublicInbox/SearchView.pm | 11 ++++++--
 lib/PublicInbox/Smsg.pm       |  2 +-
 lib/PublicInbox/View.pm       | 51 ++++++++++++++++++++++++-----------
 lib/PublicInbox/WwwListing.pm |  4 +--
 lib/PublicInbox/WwwStream.pm  |  9 ++++++-
 8 files changed, 67 insertions(+), 24 deletions(-)

diff --git a/Documentation/mknews.perl b/Documentation/mknews.perl
index f053e2bf..510a4e18 100755
--- a/Documentation/mknews.perl
+++ b/Documentation/mknews.perl
@@ -7,6 +7,7 @@
 use strict;
 use PublicInbox::Eml;
 use PublicInbox::View;
+use PublicInbox::Hval qw(fmt_ts);
 use PublicInbox::MsgTime qw(msg_datestamp);
 use PublicInbox::MID qw(mids mid_escape);
 END { $INC{'Plack/Util.pm'} and warn "$0 should not have loaded Plack::Util\n" }
@@ -91,7 +92,7 @@ sub mime2txt {
 	my $title = $mime->header('Subject');
 	$title =~ s/^\s*\[\w+\]\s*//g; # [ANNOUNCE] or [ANN]
 	my $dtime = msg_datestamp($mime->header_obj);
-	$title .= ' - ' . PublicInbox::View::fmt_ts($dtime) . ' UTC';
+	$title .= ' - ' . fmt_ts($dtime) . ' UTC';
 	print $out $title, "\n" or die;
 	my $uline = '=' x length($title);
 	print $out $uline, "\n\n" or die;
diff --git a/lib/PublicInbox/Hval.pm b/lib/PublicInbox/Hval.pm
index e21a64a6..fb21041a 100644
--- a/lib/PublicInbox/Hval.pm
+++ b/lib/PublicInbox/Hval.pm
@@ -10,7 +10,8 @@ use Encode qw(find_encoding);
 use PublicInbox::MID qw/mid_clean mid_escape/;
 use base qw/Exporter/;
 our @EXPORT_OK = qw/ascii_html obfuscate_addrs to_filename src_escape
-		to_attr prurl mid_href/;
+		to_attr prurl mid_href fmt_ts ts2str/;
+use POSIX qw(strftime);
 my $enc_ascii = find_encoding('us-ascii');
 
 # safe-ish acceptable filename pattern for portability
@@ -123,4 +124,10 @@ sub to_attr ($) {
 	$first . $str;
 }
 
+# for the t= query parameter passed to overview DB
+sub ts2str ($) { strftime('%Y%m%d%H%M%S', gmtime($_[0])) };
+
+# human-friendly format
+sub fmt_ts ($) { strftime('%Y-%m-%d %k:%M', gmtime($_[0])) }
+
 1;
diff --git a/lib/PublicInbox/Over.pm b/lib/PublicInbox/Over.pm
index 0957cbdd..08112386 100644
--- a/lib/PublicInbox/Over.pm
+++ b/lib/PublicInbox/Over.pm
@@ -126,7 +126,7 @@ sub get_all {
 	my $nr = scalar(@_) or return [];
 	my $in = '?' . (',?' x ($nr - 1));
 	do_get($self, <<"", { cull => 1, limit => $nr }, @_);
-SELECT num,ds,ddd FROM over WHERE num IN ($in)
+SELECT num,ts,ds,ddd FROM over WHERE num IN ($in)
 
 }
 
diff --git a/lib/PublicInbox/SearchView.pm b/lib/PublicInbox/SearchView.pm
index 76428dfb..7521a66d 100644
--- a/lib/PublicInbox/SearchView.pm
+++ b/lib/PublicInbox/SearchView.pm
@@ -5,9 +5,10 @@
 package PublicInbox::SearchView;
 use strict;
 use v5.10.1;
+use List::Util qw(max);
 use URI::Escape qw(uri_unescape);
 use PublicInbox::Smsg;
-use PublicInbox::Hval qw(ascii_html obfuscate_addrs mid_href);
+use PublicInbox::Hval qw(ascii_html obfuscate_addrs mid_href fmt_ts);
 use PublicInbox::View;
 use PublicInbox::WwwAtomStream;
 use PublicInbox::WwwStream qw(html_oneshot);
@@ -109,13 +110,15 @@ sub mset_summary {
 			};
 			next;
 		};
+		$ctx->{-t_max} //= $smsg->{ts};
+
 		my $s = ascii_html($smsg->{subject});
 		my $f = ascii_html($smsg->{from_name});
 		if ($obfs_ibx) {
 			obfuscate_addrs($obfs_ibx, $s);
 			obfuscate_addrs($obfs_ibx, $f);
 		}
-		my $date = PublicInbox::View::fmt_ts($smsg->{ds});
+		my $date = fmt_ts($smsg->{ds});
 		my $mid = mid_href($smsg->{mid});
 		$s = '(no subject)' if $s eq '';
 		$$res .= qq{$rank. <b><a\nhref="$mid/">}.
@@ -295,6 +298,10 @@ sub mset_thread {
 	PublicInbox::View::walk_thread($rootset, $ctx,
 		\&PublicInbox::View::pre_thread);
 
+	# link $INBOX_DIR/description text to "recent" view around
+	# the newest message in this result set:
+	$ctx->{-t_max} = max(map { delete $_->{ts} } @$msgs);
+
 	@$msgs = reverse @$msgs if $r;
 	$ctx->{msgs} = $msgs;
 	PublicInbox::WwwStream::aresponse($ctx, 200, \&mset_thread_i);
diff --git a/lib/PublicInbox/Smsg.pm b/lib/PublicInbox/Smsg.pm
index 0a0384ef..171e0a00 100644
--- a/lib/PublicInbox/Smsg.pm
+++ b/lib/PublicInbox/Smsg.pm
@@ -83,7 +83,7 @@ sub psgi_cull ($) {
 	# drop NNTP-only fields which aren't relevant to PSGI results:
 	# saves ~80K on a 200 item search result:
 	# TODO: we may need to keep some of these for JMAP...
-	delete @$self{qw(ts tid to cc bytes lines)};
+	delete @$self{qw(tid to cc bytes lines)};
 	$self;
 }
 
diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm
index f23bfcc9..9c3ef104 100644
--- a/lib/PublicInbox/View.pm
+++ b/lib/PublicInbox/View.pm
@@ -7,8 +7,10 @@ package PublicInbox::View;
 use strict;
 use warnings;
 use bytes (); # only for bytes::length
+use List::Util qw(max);
 use PublicInbox::MsgTime qw(msg_datestamp);
-use PublicInbox::Hval qw(ascii_html obfuscate_addrs prurl mid_href);
+use PublicInbox::Hval qw(ascii_html obfuscate_addrs prurl mid_href
+			ts2str fmt_ts);
 use PublicInbox::Linkify;
 use PublicInbox::MID qw(id_compress mids mids_for_index references
 			$MID_EXTRACT);
@@ -18,7 +20,6 @@ use PublicInbox::WwwStream qw(html_oneshot);
 use PublicInbox::Reply;
 use PublicInbox::ViewDiff qw(flush_diff);
 use PublicInbox::Eml;
-use POSIX qw(strftime);
 use Time::Local qw(timegm);
 use PublicInbox::Smsg qw(subject_normalized);
 use constant COLS => 72;
@@ -68,7 +69,13 @@ sub msg_page {
 	my $over = $ctx->{over} = $ibx->over or return no_over_html($ctx);
 	my ($id, $prev);
 	my $next_arg = $ctx->{next_arg} = [ $ctx->{mid}, \$id, \$prev ];
-	$ctx->{smsg} = $over->next_by_mid(@$next_arg) or return; # undef == 404
+
+	my $smsg = $ctx->{smsg} = $over->next_by_mid(@$next_arg) or
+		return; # undef == 404
+
+	# allow user to easily browse the range around this message if
+	# they have ->over
+	$ctx->{-t_max} = $smsg->{ts};
 	PublicInbox::WwwStream::aresponse($ctx, 200, \&msg_page_i);
 }
 
@@ -168,9 +175,6 @@ sub nr_to_s ($$$) {
 	$nr == 1 ? "$nr $singular" : "$nr $plural";
 }
 
-# human-friendly format
-sub fmt_ts ($) { strftime('%Y-%m-%d %k:%M', gmtime($_[0])) }
-
 # Displays the text of of the message for /$INBOX/$MSGID/[Tt]/ endpoint
 # this is already inside a <pre>
 sub eml_entry {
@@ -420,9 +424,20 @@ sub thread_html {
 	my $ibx = $ctx->{-inbox};
 	my ($nr, $msgs) = $ibx->over->get_thread($mid);
 	return missing_thread($ctx) if $nr == 0;
+
+	# link $INBOX_DIR/description text to "index_topics" view around
+	# the newest message in this thread
+	my $t = ts2str($ctx->{-t_max} = max(map { delete $_->{ts} } @$msgs));
+	my $t_fmt = fmt_ts($ctx->{-t_max});
+
 	my $skel = '<hr><pre>';
 	$skel .= $nr == 1 ? 'only message in thread' : 'end of thread';
-	$skel .= ", back to <a\nhref=\"../../\">index</a>\n\n";
+	$skel .= <<EOF;
+, other threads:[<a
+href="../../?t=$t">~$t_fmt UTC</a> | <a
+href="../../">newest</a>]
+
+EOF
 	$skel .= "<b\nid=t>Thread overview:</b> ";
 	$skel .= $nr == 1 ? '(only message)' : "$nr+ messages";
 	$skel .= " (download: <a\nhref=\"../t.mbox.gz\">mbox.gz</a>";
@@ -782,15 +797,22 @@ sub _parent_headers {
 	$rv;
 }
 
-# returns a string buffer via ->getline
+# returns a string buffer
 sub html_footer {
 	my ($ctx, $hdr) = @_;
 	my $ibx = $ctx->{-inbox};
 	my $upfx = '../';
-	my $skel = " <a\nhref=\"$upfx\">index</a>";
+	my $skel;
 	my $rv = '<pre>';
 	if ($ibx->over) {
-		$skel .= "\n";
+		my $t = ts2str($ctx->{-t_max});
+		my $t_fmt = fmt_ts($ctx->{-t_max});
+		$skel .= <<EOF;
+	other threads:[<a
+href="$upfx?t=$t">~$t_fmt UTC</a>|<a
+href="$upfx">newest</a>]
+EOF
+
 		thread_skel(\$skel, $ctx, $hdr);
 		my ($next, $prev);
 		my $parent = '       ';
@@ -821,6 +843,8 @@ sub html_footer {
 			$parent = " <a\nhref=\"$u\"\nrel=prev>parent</a>";
 		}
 		$rv .= "$next $prev$parent ";
+	} else { # unindexed inboxes w/o over
+		$skel = qq( <a\nhref="$upfx">latest</a>);
 	}
 	$rv .= qq(<a\nhref="#R">reply</a>);
 	$rv .= $skel;
@@ -858,7 +882,7 @@ sub find_mid_root {
 	++$ctx->{root_idx} if $level == 0;
 	if ($node->{mid} eq $ctx->{mid}) {
 		$ctx->{found_mid_at} = $ctx->{root_idx};
-		return 0;
+		return 0; # stop iterating
 	}
 	1;
 }
@@ -1142,9 +1166,6 @@ sub dump_topics {
 	200;
 }
 
-# only for the t= query parameter passed to overview DB
-sub ts2str ($) { strftime('%Y%m%d%H%M%S', gmtime($_[0])) };
-
 sub str2ts ($) {
 	my ($yyyy, $mon, $dd, $hh, $mm, $ss) = unpack('A4A2A2A2A2A2', $_[0]);
 	timegm($ss || 0, $mm || 0, $hh || 0, $dd, $mon - 1, $yyyy);
@@ -1152,7 +1173,6 @@ sub str2ts ($) {
 
 sub pagination_footer ($$) {
 	my ($ctx, $latest) = @_;
-	delete $ctx->{qp} or return;
 	my $next = $ctx->{next_page} || '';
 	my $prev = $ctx->{prev_page} || '';
 	if ($prev) {
@@ -1204,6 +1224,7 @@ sub paginate_recent ($$) {
 	$msgs;
 }
 
+# GET /$INBOX - top-level inbox view for indexed inboxes
 sub index_topics {
 	my ($ctx) = @_;
 	my $msgs = paginate_recent($ctx, 200); # 200 is our window
diff --git a/lib/PublicInbox/WwwListing.pm b/lib/PublicInbox/WwwListing.pm
index 0af0fe68..365743cf 100644
--- a/lib/PublicInbox/WwwListing.pm
+++ b/lib/PublicInbox/WwwListing.pm
@@ -6,7 +6,7 @@
 package PublicInbox::WwwListing;
 use strict;
 use warnings;
-use PublicInbox::Hval qw(ascii_html prurl);
+use PublicInbox::Hval qw(ascii_html prurl fmt_ts);
 use PublicInbox::Linkify;
 use PublicInbox::View;
 use PublicInbox::Inbox;
@@ -91,7 +91,7 @@ sub new {
 
 sub ibx_entry {
 	my ($mtime, $ibx, $env) = @_;
-	my $ts = PublicInbox::View::fmt_ts($mtime);
+	my $ts = fmt_ts($mtime);
 	my $url = prurl($env, $ibx->{url});
 	my $tmp = <<"";
 * $ts - $url
diff --git a/lib/PublicInbox/WwwStream.pm b/lib/PublicInbox/WwwStream.pm
index d79770ed..e06e3456 100644
--- a/lib/PublicInbox/WwwStream.pm
+++ b/lib/PublicInbox/WwwStream.pm
@@ -10,7 +10,7 @@ use strict;
 use parent qw(Exporter PublicInbox::GzipFilter);
 our @EXPORT_OK = qw(html_oneshot);
 use bytes (); # length
-use PublicInbox::Hval qw(ascii_html prurl);
+use PublicInbox::Hval qw(ascii_html prurl ts2str);
 our $TOR_URL = 'https://www.torproject.org/';
 our $CODE_URL = 'https://public-inbox.org/public-inbox.git';
 
@@ -43,6 +43,13 @@ sub html_top ($) {
 	my $color = $upfx.'_/text/color';
 	my $atom = $ctx->{-atom} || $upfx.'new.atom';
 	my $top = "<b>$desc</b>";
+	if (my $t_max = $ctx->{-t_max}) {
+		$t_max = ts2str($t_max);
+		$top = qq(<a\nhref="$upfx?t=$t_max">$top</a>);
+	# we had some kind of query, link to /$INBOX/?t=YYYYMMDDhhmmss
+	} elsif ($ctx->{qp}->{t}) {
+		$top = qq(<a\nhref="./">$top</a>);
+	}
 	my $links = "<a\nhref=\"$help\">help</a> / ".
 			"<a\nhref=\"$color\">color</a> / ".
 			"<a\nhref=\"$atom\">Atom feed</a>";

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] www: more descriptive pagination
  2020-08-27 22:04 [PATCH 0/2] www: navigation tweaks Eric Wong
  2020-08-27 22:04 ` [PATCH 1/2] www: improve navigation around comtemporary threads Eric Wong
@ 2020-08-27 22:05 ` Eric Wong
  2020-08-27 22:49 ` [PATCH 0/2] www: navigation tweaks Kyle Meyer
  2 siblings, 0 replies; 6+ messages in thread
From: Eric Wong @ 2020-08-27 22:05 UTC (permalink / raw)
  To: meta

Being an easily confused person, I find "next" and "prev"
ambiguous as to whether messages on the next or previous page
will be newer or older than the current page.  Clarify that for
the threaded /$INBOX/ view and search results.

For search results sorted by relevance, we'll use "[>= $SCORE]"
or "[<= $SCORE]" to indicate to indicate directionality.

This also fixes $INBOX/new.html for unindexed v1 inboxes.
---
 lib/PublicInbox/Feed.pm       |  5 ++++-
 lib/PublicInbox/SearchView.pm | 37 ++++++++++++++++++++++++++---------
 lib/PublicInbox/View.pm       | 12 +++++++-----
 3 files changed, 39 insertions(+), 15 deletions(-)

diff --git a/lib/PublicInbox/Feed.pm b/lib/PublicInbox/Feed.pm
index bf095a2c..cbdf5db9 100644
--- a/lib/PublicInbox/Feed.pm
+++ b/lib/PublicInbox/Feed.pm
@@ -133,7 +133,10 @@ sub recent_msgs {
 		}
 	}
 
-	$ctx->{next_page} = "r=$last_commit" if $last_commit;
+	$last_commit and
+		$ctx->{next_page} = qq[<a\nhref="?r=$last_commit"\nrel=next>] .
+					'next (older)</a>';
+
 	[ map { bless {blob => $_ }, 'PublicInbox::Smsg' } @oids ];
 }
 
diff --git a/lib/PublicInbox/SearchView.pm b/lib/PublicInbox/SearchView.pm
index 7521a66d..892e8fda 100644
--- a/lib/PublicInbox/SearchView.pm
+++ b/lib/PublicInbox/SearchView.pm
@@ -5,7 +5,7 @@
 package PublicInbox::SearchView;
 use strict;
 use v5.10.1;
-use List::Util qw(max);
+use List::Util qw(min max);
 use URI::Escape qw(uri_unescape);
 use PublicInbox::Smsg;
 use PublicInbox::Hval qw(ascii_html obfuscate_addrs mid_href fmt_ts);
@@ -98,6 +98,7 @@ sub mset_summary {
 	my $obfs_ibx = $ibx->{obfuscate} ? $ibx : undef;
 	my @nums = @{$ibx->search->mset_to_artnums($mset)};
 	my %num2msg = map { $_->{num} => $_ } @{$ibx->over->get_all(@nums)};
+	my ($min, $max);
 
 	foreach my $m ($mset->items) {
 		my $rank = sprintf("%${pad}d", $m->get_rank + 1);
@@ -112,6 +113,11 @@ sub mset_summary {
 		};
 		$ctx->{-t_max} //= $smsg->{ts};
 
+		# only when sorting by relevance, ->items is always
+		# ordered descending:
+		$max //= $pct;
+		$min = $pct;
+
 		my $s = ascii_html($smsg->{subject});
 		my $f = ascii_html($smsg->{from_name});
 		if ($obfs_ibx) {
@@ -125,6 +131,10 @@ sub mset_summary {
 			$s . "</a></b>\n";
 		$$res .= "$pfx  - by $f @ $date UTC [$pct%]\n\n";
 	}
+	if ($q->{r}) { # for descriptions in search_nav_bot
+		$q->{-min_pct} = $min;
+		$q->{-max_pct} = $max;
+	}
 	$$res .= search_nav_bot($mset, $q);
 	undef;
 }
@@ -218,42 +228,46 @@ sub search_nav_bot {
 	my $beg = $off + 1;
 
 	if ($beg <= $end) {
-		$rv .= "Results $beg-$end of $total";
-		$rv .= ' (estimated)' if $end != $total;
+		my $approx = $end == $total ? '' : '~';
+		$rv .= "Results $beg-$end of $approx$total";
 	} else {
 		$rv .= "No more results, only $total";
 	}
-	my ($next, $join, $prev);
+	my ($next, $join, $prev, $nd, $pd);
 
 	if ($o >= 0) { # sort descending
 		my $n = $o + $l;
 		if ($n < $total) {
 			$next = $q->qs_html(o => $n, l => $l);
+			$nd = $q->{r} ? "[&lt;= $q->{-min_pct}%]" : '(older)';
 		}
 		if ($o > 0) {
-			$join = $n < $total ? '/' : '       ';
+			$join = $n < $total ? ' | ' : "\t";
 			my $p = $o - $l;
 			$prev = $q->qs_html(o => ($p > 0 ? $p : 0));
+			$pd = $q->{r} ? "[&gt;= $q->{-max_pct}%]" : '(newer)';
 		}
 	} else { # o < 0, sort ascending
 		my $n = $o - $l;
 
 		if (-$n < $total) {
 			$next = $q->qs_html(o => $n, l => $l);
+			$nd = $q->{r} ? "[&lt;= $q->{-min_pct}%]" : '(newer)';
 		}
 		if ($o < -1) {
-			$join = -$n < $total ? '/' : '       ';
+			$join = -$n < $total ? ' | ' : "\t";
 			my $p = $o + $l;
 			$prev = $q->qs_html(o => ($p < 0 ? $p : 0));
+			$pd = $q->{r} ? "[&gt;= $q->{-max_pct}%]" : '(older)';
 		}
 	}
 
-	$rv .= qq{  <a\nhref="?$next"\nrel=next>next</a>} if $next;
+	$rv .= qq{  <a\nhref="?$next"\nrel=next>next $nd</a>} if $next;
 	$rv .= $join if $join;
-	$rv .= qq{<a\nhref="?$prev"\nrel=prev>prev</a>} if $prev;
+	$rv .= qq{<a\nhref="?$prev"\nrel=prev>prev $pd</a>} if $prev;
 
 	my $rev = $q->qs_html(o => $o < 0 ? 0 : -1);
-	$rv .= qq{ | <a\nhref="?$rev">reverse results</a></pre>};
+	$rv .= qq{ | <a\nhref="?$rev">reverse</a></pre>};
 }
 
 sub sort_relevance {
@@ -279,6 +293,11 @@ sub mset_thread {
 	my $msgs = $ibx->over->get_all(keys %pct);
 	$_->{pct} = $pct{$_->{num}} for @$msgs;
 	my $r = $q->{r};
+	if ($r) { # for descriptions in search_nav_bot
+		my @pct = values %pct;
+		$q->{-min_pct} = min(@pct);
+		$q->{-max_pct} = max(@pct);
+	}
 	my $rootset = PublicInbox::SearchThread::thread($msgs,
 		$r ? \&sort_relevance : \&PublicInbox::View::sort_ds,
 		$ctx);
diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm
index 9c3ef104..3055da20 100644
--- a/lib/PublicInbox/View.pm
+++ b/lib/PublicInbox/View.pm
@@ -1175,9 +1175,9 @@ sub pagination_footer ($$) {
 	my ($ctx, $latest) = @_;
 	my $next = $ctx->{next_page} || '';
 	my $prev = $ctx->{prev_page} || '';
-	if ($prev) {
-		$next = $next ? "$next " : '     ';
-		$prev .= qq! <a\nhref='$latest'>latest</a>!;
+	if ($prev) {  # aligned padding for: 'next (older) | '
+		$next = $next ? "$next | " : '             | ';
+		$prev .= qq[ | <a\nhref="$latest">latest</a>];
 	}
 	"<hr><pre>page: $next$prev</pre>";
 }
@@ -1215,11 +1215,13 @@ sub paginate_recent ($$) {
 	}
 	if (defined($oldest) && $more) {
 		my $s = ts2str($oldest);
-		$ctx->{next_page} = qq!<a\nhref="?t=$s"\nrel=next>next</a>!;
+		$ctx->{next_page} = qq[<a\nhref="?t=$s"\nrel=next>] .
+					'next (older)</a>';
 	}
 	if (defined($newest) && (defined($before) || defined($after))) {
 		my $s = ts2str($newest);
-		$ctx->{prev_page} = qq!<a\nhref="?t=$s-"\nrel=prev>prev</a>!;
+		$ctx->{prev_page} = qq[<a\nhref="?t=$s-"\nrel=prev>] .
+					'prev (newer)</a>';
 	}
 	$msgs;
 }

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 0/2] www: navigation tweaks
  2020-08-27 22:04 [PATCH 0/2] www: navigation tweaks Eric Wong
  2020-08-27 22:04 ` [PATCH 1/2] www: improve navigation around comtemporary threads Eric Wong
  2020-08-27 22:05 ` [PATCH 2/2] www: more descriptive pagination Eric Wong
@ 2020-08-27 22:49 ` Kyle Meyer
  2 siblings, 0 replies; 6+ messages in thread
From: Kyle Meyer @ 2020-08-27 22:49 UTC (permalink / raw)
  To: Eric Wong; +Cc: meta

Eric Wong writes:

> Just some things I noticed could use improvement while
> browsing around old archives.  All subjective...

Nice, I like these changes too :)

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] www: improve navigation around comtemporary threads
  2020-08-27 22:04 ` [PATCH 1/2] www: improve navigation around comtemporary threads Eric Wong
@ 2020-08-27 22:50   ` Kyle Meyer
  2020-08-28  4:27     ` Eric Wong
  0 siblings, 1 reply; 6+ messages in thread
From: Kyle Meyer @ 2020-08-27 22:50 UTC (permalink / raw)
  To: Eric Wong; +Cc: meta

Eric Wong writes:

> Sometimes it's useful to quickly get to threads and messages
> which are contemporaries of the current thread/message being
> focused on.  This hopefully improves navigatin by making:

s/navigatin/navigation/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] www: improve navigation around comtemporary threads
  2020-08-27 22:50   ` Kyle Meyer
@ 2020-08-28  4:27     ` Eric Wong
  0 siblings, 0 replies; 6+ messages in thread
From: Eric Wong @ 2020-08-28  4:27 UTC (permalink / raw)
  To: Kyle Meyer; +Cc: meta

Kyle Meyer <kyle@kyleam.com> wrote:
> Eric Wong writes:
> 
> > Sometimes it's useful to quickly get to threads and messages
> > which are contemporaries of the current thread/message being
> > focused on.  This hopefully improves navigatin by making:
> 
> s/navigatin/navigation/

Thanks, I also fixed the subject (s/com/con/)

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-08-28  4:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-27 22:04 [PATCH 0/2] www: navigation tweaks Eric Wong
2020-08-27 22:04 ` [PATCH 1/2] www: improve navigation around comtemporary threads Eric Wong
2020-08-27 22:50   ` Kyle Meyer
2020-08-28  4:27     ` Eric Wong
2020-08-27 22:05 ` [PATCH 2/2] www: more descriptive pagination Eric Wong
2020-08-27 22:49 ` [PATCH 0/2] www: navigation tweaks Kyle Meyer

Code repositories for project(s) associated with this public inbox

	https://80x24.org/public-inbox.git

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).