From 8e52aa5d5a9186a1c90bc77e444d77d6130c8779 Mon Sep 17 00:00:00 2001
From: Eric Wong <e@80x24.org>
Date: Thu, 30 Jun 2016 08:39:35 +0000
Subject: [PATCH] view: show thread size when linking to summary

This should give readers a better idea of what to expect.
---
 lib/PublicInbox/View.pm | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm
index 22d72500..fac53eb9 100644
--- a/lib/PublicInbox/View.pm
+++ b/lib/PublicInbox/View.pm
@@ -156,7 +156,7 @@ sub index_entry {
 		}
 		$rv .= " / [<a\nhref=\"${mhref}T/#u\">$flat</a>";
 		$rv .= "|<a\nhref=\"${mhref}t/#u\">$threaded</a>]";
-		$rv .= " / <a\nhref=#r$id>thread overview</a>";
+		$rv .= " / <a\nhref=#r$id>$ctx->{s_nr}</a>";
 	}
 
 	$rv .= $more ? "\n\n" : "\n";
@@ -226,7 +226,8 @@ sub _th_index_lite {
 			$rv .= $pad . $mapping->{$nn->messageid}->[1];
 		}
 	}
-	$rv .= "<a\nhref=#e$id\nid=m$id>_</a> <a\nhref=#r$id>$s_s, $s_c</a>\n";
+	$rv .= "<a\nhref=#e$id\nid=m$id>_</a> ";
+	$rv .= "<a\nhref=#r$id>$s_s, $s_c; $ctx->{s_nr}</a>\n";
 }
 
 sub walk_thread {
@@ -319,6 +320,7 @@ sub thread_html {
 	$ctx->{root_anchor} = anchor_for($mid);
 	$ctx->{seen} = {};
 	$ctx->{mapping} = {};
+	$ctx->{s_nr} = "$nr+ messages in thread";
 
 	my $th = thread_results($msgs);
 	walk_thread($th, $ctx, *pre_thread);
-- 
2.51.0