From: Kyle Ackerman Subject: Re: gotwebd: foldable briefs? To: Omar Polo Cc: gameoftrees@openbsd.org Date: Fri, 01 Dec 2023 20:29:34 -0600 Good idea! My only feedback is that I agree with you that the brief toggles are a little noisy (see below). Tracey Emery writes: > On Fri, Dec 01, 2023 at 08:55:17PM +0100, Omar Polo wrote: >> I'm a bit unsure about this. It's nice since it makes the full commit >> message accessible in the briefs pages, and doesn't depend on javascript >> (just a plain
tag.) Most (all?) text browsers however don't >> understand it and so this diffs adds some "noise" (the three dots) to >> the briefs page. >> >> I have this too on my instance: >> >> >> (the aria-hidden attribute is just to make screen reader & co ignoring >> the three dots that are only decorative.) > > I don't mind this. It could be handy. Let's wait for more feedback. > >> >> diff /home/op/w/got >> commit - 227f81a40643e9c82bb019336421e17e914d015a >> path + /home/op/w/got >> blob - c6f473ced0d7b7454f210dfaa119b63cd96d2ba4 >> 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 { >> + display: inline; >> + cursor: pointer; >> +} >> + >> +.briefs_toggle { >> + display: inline-block; >> + padding: 3px 4px; >> + border: 1px solid #222; >> + border-radius: 3px; >> + user-select: none; After playing around with it, I'd only change the padding to "0px 4px" and border-radius to 6px. The intent is to soften out the boxes, but this of course is only a nit. This does tempt me to submit a dark mode patch to change the border color of this to the purple I've been using. >> >> diff_url = (struct gotweb_url){ >> .action = DIFF, >> @@ -385,9 +385,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++; >> + } >> !} >>
>>

>> @@ -399,15 +402,33 @@ nextsep(char *s, char **t) >> {{ rc->committer }} >> >>

>> -

>> - >> - {{ rc->commit_msg }} >> - >> - {{ if rc->refs_str }} >> - {{ " " }} ({{ rc->refs_str }}) >> - {{ end }} >> - >> -

>> + {{ if body && *body != '\0' }} >> +
>> + >> + >> + {{ rc->commit_msg }} >> + >> + {{ if rc->refs_str }} >> + {{ " " }} ({{ rc->refs_str }}) >> + {{ end }} >> + {{ " " }} >> + >> + >> + {{ "\n" }} >> +

{{ body }}

>> +
>> + {{ else }} >> +

>> + >> + {{ rc->commit_msg }} >> + >> + {{ if rc->refs_str }} >> + {{ " " }} ({{ rc->refs_str }}) >> + {{ end }} >> +

>> + {{ end }} >>
>>