"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Omar Polo <op@omarpolo.com>
Subject:
Re: gotwebd: foldable briefs?
To:
Tracey Emery <tracey@traceyemery.net>
Cc:
Mark Jamsek <mark@jamsek.com>, Kyle Ackerman <kackerman0102@gmail.com>, gameoftrees@openbsd.org
Date:
Fri, 08 Dec 2023 09:05:39 +0100

Download raw body.

Thread
On 2023/12/07 13:32:22 -0700, Tracey Emery <tracey@traceyemery.net> wrote:
> The arrow is nearly impossible to click on a cell phone. The elipses was
> better for that situation. What about moving the arrow to the end of the
> line and give it a bit of space from the linked title? I don't know,
> maybe that isn't the answer either.

I don't think we can move the arrow at the end.  The arrow is not a real
element, is just a pseudo-one.  There's the ::marker selector in CSS to
customize it, but I doubt we can move it.

Another option would be to keep both the arrow in place and also the
[...] button (with the style tweak from Kyle, thanks!)

I've updated my instance.

ok?

diff /home/op/w/got
commit - ac15152e219bed9c7f41007a39c3cbce83ea9386
path + /home/op/w/got
blob - b61f9292109e3986171a8d14865d128e2087e905
file + gotwebd/files/htdocs/gotwebd/gotweb.css
--- gotwebd/files/htdocs/gotwebd/gotweb.css
+++ gotwebd/files/htdocs/gotwebd/gotweb.css
@@ -213,6 +213,24 @@ header.subtitle h2 {
 	}
 }
 
+.briefs_log summary {
+	cursor: pointer;
+}
+
+.briefs_toggle {
+	display: inline-block;
+	padding: 3px 4px;
+	padding: 0px 4px;
+	border: 1px solid #222;
+	border-radius: 3px;
+	user-select: none;
+}
+
+/* work around .commits being unusable here */
+.briefs_log > p {
+	white-space: pre-wrap;
+}
+
 .tag_age, .tag_name, .tag_log {
 	display: inline-block;
 	vertical-align: middle;
blob - 8080344cb29306239d3e58af9772c1a730874aec
file + gotwebd/pages.tmpl
--- gotwebd/pages.tmpl
+++ gotwebd/pages.tmpl
@@ -354,7 +354,7 @@ nextsep(char *s, char **t)
 	struct repo_commit	*rc;
 	struct repo_dir		*repo_dir = t->repo_dir;
 	struct gotweb_url	 diff_url, patch_url, tree_url;
-	char			*tmp;
+	char			*tmp, *body;
 
 	diff_url = (struct gotweb_url){
 		.action = DIFF,
@@ -392,9 +392,12 @@ nextsep(char *s, char **t)
 	if (tmp)
 		*tmp = '\0';
 
-	tmp = strchr(rc->commit_msg, '\n');
-	if (tmp)
-		*tmp = '\0';
+	body = strchr(rc->commit_msg, '\n');
+	if (body) {
+		*body++ = '\0';
+		while (*body == '\n')
+		      body++;
+	}
     !}
     <div class='brief'>
       <p class='brief_meta'>
@@ -406,15 +409,33 @@ nextsep(char *s, char **t)
           {{ rc->committer }}
         </span>
       </p>
-      <p class="briefs_log">
-        <a href="{{ render gotweb_render_url(tp->tp_arg, &diff_url) }}">
-          {{ rc->commit_msg }}
-        </a>
-        {{ if rc->refs_str }}
-          {{ " " }} <span class="refs_str">({{ rc->refs_str }})</span>
-        {{ end }}
-        </a>
-      </p>
+      {{ if body && *body != '\0' }}
+        <details class="briefs_log">
+          <summary>
+            <a href="{{ render gotweb_render_url(tp->tp_arg, &diff_url) }}">
+              {{ rc->commit_msg }}
+            </a>
+            {{ if rc->refs_str }}
+              {{ " " }} <span class="refs_str">({{ rc->refs_str }})</span>
+            {{ end }}
+            {{ " " }}
+            <span class="briefs_toggle" aria-hidden="true">
+              {{ " ⋅⋅⋅ " }}
+            </span>
+          </summary>
+          {{ "\n" }}
+          <p>{{ body }}</p>
+        </details>
+      {{ else }}
+        <p class="briefs_log">
+          <a href="{{ render gotweb_render_url(tp->tp_arg, &diff_url) }}">
+            {{ rc->commit_msg }}
+          </a>
+          {{ if rc->refs_str }}
+            {{ " " }} <span class="refs_str">({{ rc->refs_str }})</span>
+          {{ end }}
+        </p>
+      {{ end }}
     </div>
     <div class="navs_wrapper">
       <div class="navs">