user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [PATCH 3/3] view: per-message view links to real previous sibling
  2016-07-07  3:11  5% [PATCH 0/3] view: visual and navigation tweaks Eric Wong
@ 2016-07-07  3:11  7% ` Eric Wong
  0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2016-07-07  3:11 UTC (permalink / raw)
  To: meta

This is closer to the behavior of thread-aware MUAs.
---
 lib/PublicInbox/View.pm | 42 +++++++++++++++++++++++++++++-------------
 1 file changed, 29 insertions(+), 13 deletions(-)

diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm
index f47ecba..054b358 100644
--- a/lib/PublicInbox/View.pm
+++ b/lib/PublicInbox/View.pm
@@ -636,21 +636,35 @@ sub html_footer {
 	if ($idx && $srch) {
 		$idx .= "\n";
 		thread_skel(\$idx, $ctx, $hdr, $tpfx);
-		my $p = $ctx->{parent_msg};
-		my $next = $ctx->{next_msg};
-		if ($p) {
-			$p = PublicInbox::Hval->new_msgid($p);
-			$p = $p->as_href;
-			$irt = "<a\nhref=\"$upfx$p/\"\nrel=prev>parent</a> ";
-		} else {
-			$irt = ' ' x length('parent ');
+		my ($next, $prev);
+		my $parent = '       ';
+		$next = $prev = '    ';
+
+		if (my $n = $ctx->{next_msg}) {
+			$n = PublicInbox::Hval->new_msgid($n)->as_href;
+			$next = "<a\nhref=\"$upfx$n/\"\nrel=next>next</a>";
 		}
-		if ($next) {
-			my $n = PublicInbox::Hval->new_msgid($next)->as_href;
-			$irt .= "<a\nhref=\"$upfx$n/\"\nrel=next>next</a> ";
-		} else {
-			$irt .= ' ' x length('next ');
+		my $u;
+		my $par = $ctx->{parent_msg};
+		if ($par) {
+			$u = PublicInbox::Hval->new_msgid($par)->as_href;
+			$u = "$upfx$u/";
 		}
+		if (my $p = $ctx->{prev_msg}) {
+			$prev = PublicInbox::Hval->new_msgid($p)->as_href;
+			if ($p && $par && $p eq $par) {
+				$prev = "<a\nhref=\"$upfx$prev/\"\n" .
+					'rel=prev>prev parent</a>';
+				$parent = '';
+			} else {
+				$prev = "<a\nhref=\"$upfx$prev/\"\n" .
+					'rel=prev>prev</a>';
+				$parent = " <a\nhref=\"$u\">parent</a>" if $u;
+			}
+		} elsif ($u) { # unlikely
+			$parent = " <a\nhref=\"$u\"\nrel=prev>parent</a>";
+		}
+		$irt = "$next $prev$parent ";
 	} else {
 		$irt = '';
 	}
@@ -744,6 +758,8 @@ sub _skel_header {
 			$$dst .= "<b>$d<a\nid=r\nhref=\"#t\">".
 				 "$attr [this message]</a></b>\n";
 			return;
+		} else {
+			$ctx->{prev_msg} = $mid;
 		}
 	} else {
 		$ctx->{next_msg} ||= $mid;
-- 
EW


^ permalink raw reply related	[relevance 7%]

* [PATCH 0/3] view: visual and navigation tweaks
@ 2016-07-07  3:11  5% Eric Wong
  2016-07-07  3:11  7% ` [PATCH 3/3] view: per-message view links to real previous sibling Eric Wong
  0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2016-07-07  3:11 UTC (permalink / raw)
  To: meta

These little things should make the navigation experience a
little more tolerable in the per-message view.

Eric Wong (3):
      view: reduce visual noise in conversation view
      view: preserve attribution for current message
      view: per-message view links to real previous sibling

 lib/PublicInbox/View.pm | 57 ++++++++++++++++++++++++++++++-------------------
 1 file changed, 35 insertions(+), 22 deletions(-)

^ permalink raw reply	[relevance 5%]

Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2016-07-07  3:11  5% [PATCH 0/3] view: visual and navigation tweaks Eric Wong
2016-07-07  3:11  7% ` [PATCH 3/3] view: per-message view links to real previous sibling Eric Wong

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