From 849646edb4e2b98e2283fdae4102192a8e19ad04 Mon Sep 17 00:00:00 2001 From: eti Date: Thu, 7 May 2026 23:43:12 +0200 Subject: [PATCH] appview: use shared repoCard in quick-search results Adds a compact mode (6th positional arg) to repoCard that skips minimum height and applies focus-within highlight for keyboard nav. Signed-off-by: eti --- .../templates/search/fragments/quick.html | 35 +------------------ .../templates/user/fragments/repoCard.html | 10 ++++-- 2 files changed, 8 insertions(+), 37 deletions(-) diff --git a/appview/pages/templates/search/fragments/quick.html b/appview/pages/templates/search/fragments/quick.html index ffe89b14..1250cb18 100644 --- a/appview/pages/templates/search/fragments/quick.html +++ b/appview/pages/templates/search/fragments/quick.html @@ -30,43 +30,10 @@ {{define "search/fragments/quickPage"}} {{- range .Repos -}} - {{ template "search/fragments/quickItem" . }} + {{ template "user/fragments/repoCard" (list $ . true false (dict) true) }} {{- end -}} {{end}} -{{define "search/fragments/quickItem"}} -{{ $owner := resolve .Did }} - -
- {{ i "book-marked" "size-4 pt-0.5 text-gray-400" }} - {{ $owner }}/{{ .Name }} -
- {{- with .Description -}} -
{{ . }}
- {{- end -}} - {{- with .RepoStats -}} - {{- if or .Language .StarCount .IssueCount.Open .PullCount.Open -}} -
- {{- with .Language -}} - {{ template "repo/fragments/colorBall" (dict "color" (langColor .)) }}{{ . }} - {{- end -}} - {{- with .StarCount -}} - {{ i "star" "w-3 h-3" }} {{ . }} - {{- end -}} - {{- with .IssueCount.Open -}} - {{ i "circle-dot" "w-3 h-3" }} {{ . }} - {{- end -}} - {{- with .PullCount.Open -}} - {{ i "git-pull-request" "w-3 h-3" }} {{ . }} - {{- end -}} -
- {{- end -}} - {{- end -}} -
-{{end}} - {{define "search/fragments/quickFooter"}}
showing {{ len .Repos }} of {{ .Total }} diff --git a/appview/pages/templates/user/fragments/repoCard.html b/appview/pages/templates/user/fragments/repoCard.html index d8319ebe..7d487b71 100644 --- a/appview/pages/templates/user/fragments/repoCard.html +++ b/appview/pages/templates/user/fragments/repoCard.html @@ -5,15 +5,19 @@ {{ $fullName := index . 2 }} {{ $starButton := false }} {{ $starData := dict }} + {{ $compact := false }} {{ if gt (len .) 3 }} {{ $starButton = index . 3 }} {{ if gt (len .) 4 }} {{ $starData = index . 4 }} + {{ if gt (len .) 5 }} + {{ $compact = index . 5 }} + {{ end }} {{ end }} {{ end }} {{ with $repo }} -
+
{{ if .Source }} @@ -23,9 +27,9 @@ {{ end }} {{ $repoOwner := resolve .Did }} {{- if $fullName -}} - {{ $repoOwner }}/{{ .Name }} + {{ $repoOwner }}/{{ .Name }} {{- else -}} - {{ .Name }} + {{ .Name }} {{- end -}}
{{ if and $starButton $root.LoggedInUser }} -- 2.51.2