Monorepo for Tangled tangled.org

appview/pages: make user references clickable #939

merged opened by moshyfawn.dev targeting master from moshyfawn.dev/core: feat/clickable-user-refs

Wrap participant avatars with profile links. Make DID-type labels fully clickable chips linking to user profiles, matching the commit hash chip pattern

Signed-off-by: moshyfawn email@moshyfawn.dev

Labels

None yet.

assignee

None yet.

Participants 2
AT URI
at://did:plc:sshwio5obbx4zjfrn3fhsen6/sh.tangled.repo.pull/3mbxnxoqilb22
+37 -22
Diff #1
+7 -5
appview/pages/templates/fragments/tinyAvatarList.html
··· 5 5 <div class="inline-flex items-center -space-x-3"> 6 6 {{ $c := "z-50 z-40 z-30 z-20 z-10" }} 7 7 {{ range $i, $p := $ps }} 8 - <img 9 - src="{{ tinyAvatar . }}" 10 - alt="" 11 - class="rounded-full size-8 mr-1 border-2 border-gray-100 dark:border-gray-900 z-{{sub 5 $i}}0 {{ $classes }}" 12 - /> 8 + <a href="/{{ resolve . }}" title="{{ resolve . }}"> 9 + <img 10 + src="{{ tinyAvatar . }}" 11 + alt="" 12 + class="rounded-full size-8 mr-1 border-2 border-gray-100 dark:border-gray-900 z-{{sub 5 $i}}0 {{ $classes }}" 13 + /> 14 + </a> 13 15 {{ end }} 14 16 15 17 {{ if gt (len $all) 5 }}
+30 -17
appview/pages/templates/labels/fragments/label.html
··· 2 2 {{ $d := .def }} 3 3 {{ $v := .val }} 4 4 {{ $withPrefix := .withPrefix }} 5 - <span class="w-fit flex items-center gap-2 font-normal normal-case rounded py-1 px-2 border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800 text-sm"> 6 - {{ template "repo/fragments/colorBall" (dict "color" $d.GetColor) }} 7 5 8 - {{ $lhs := printf "%s" $d.Name }} 9 - {{ $rhs := "" }} 6 + {{ $lhs := printf "%s" $d.Name }} 7 + {{ $rhs := "" }} 8 + {{ $isDid := false }} 9 + {{ $resolvedVal := "" }} 10 10 11 - {{ if not $d.ValueType.IsNull }} 12 - {{ if $d.ValueType.IsDidFormat }} 13 - {{ $v = resolve $v }} 14 - {{ end }} 15 - 16 - {{ if not $withPrefix }} 17 - {{ $lhs = "" }} 18 - {{ else }} 19 - {{ $lhs = printf "%s/" $d.Name }} 20 - {{ end }} 11 + {{ if not $d.ValueType.IsNull }} 12 + {{ $isDid = $d.ValueType.IsDidFormat }} 13 + {{ if $isDid }} 14 + {{ $resolvedVal = resolve $v }} 15 + {{ $v = $resolvedVal }} 16 + {{ end }} 21 17 22 - {{ $rhs = printf "%s" $v }} 18 + {{ if not $withPrefix }} 19 + {{ $lhs = "" }} 20 + {{ else }} 21 + {{ $lhs = printf "%s/" $d.Name }} 23 22 {{ end }} 24 23 25 - {{ printf "%s%s" $lhs $rhs }} 26 - </span> 24 + {{ $rhs = printf "%s" $v }} 25 + {{ end }} 26 + 27 + {{ $chipClasses := "w-fit flex items-center gap-2 font-normal normal-case rounded py-1 px-2 border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800 text-sm" }} 28 + 29 + {{ if $isDid }} 30 + <a href="/{{ $resolvedVal }}" class="{{ $chipClasses }} no-underline hover:underline"> 31 + {{ template "repo/fragments/colorBall" (dict "color" $d.GetColor) }} 32 + {{ printf "%s%s" $lhs $rhs }} 33 + </a> 34 + {{ else }} 35 + <span class="{{ $chipClasses }}"> 36 + {{ template "repo/fragments/colorBall" (dict "color" $d.GetColor) }} 37 + {{ printf "%s%s" $lhs $rhs }} 38 + </span> 39 + {{ end }} 27 40 {{ end }} 28 41 29 42

History

2 rounds 5 comments
sign up or login to add to the discussion
1 commit
expand
appview/pages: make user references clickable
expand 5 comments

Sorry for the resubmit: I was checking whether tangled supports GPG signing and if it could handle re-signing the commit with SSH, since that seems to be the only verification method currently supported. I confirmed 446d2d9e is signed locally - "Good 'git' signature" - but my fork doesn't show the verified badge in the commit history.

Again, apologies for the noise, just experimenting with the platform.

Ah, scrap that. I see the commit verification status now 馃

lgtm! nice addition. one regression: when viewing the pulls/issues page and there is a label with, say, an assignee, it is rendered as a link using the styling of a link, as opposed to inheriting the color of the parent container. perhaps adding text-inherit to $chipClasses could fix this? not a deal breaker however.

going to merge this as-is, don't want to keep this on hold for such a small thing ;)

Thanks!

Created a PR to fix that; didn't see someone's committed it already

pull request successfully merged
1 commit
expand
appview/pages: make user references clickable
expand 0 comments