Monorepo for Tangled tangled.org
2

Configure Feed

Select the types of activity you want to include in your feed.

appview: sort github repos by star count & last pushed date

Signed-off-by: Seongmin Lee <git@boltless.me>

author
Seongmin Lee
date (Jun 16, 2026, 2:08 AM +0900) commit 0d315506 parent c5c8a7ab change-id uqrymoyk
+33 -11
+23 -10
appview/accountmigration/accountmigration.go
··· 9 9 "slices" 10 10 "strconv" 11 11 "strings" 12 + "time" 12 13 13 14 "github.com/bluesky-social/indigo/atproto/syntax" 14 15 "github.com/go-chi/chi/v5" ··· 103 104 } 104 105 105 106 type githubUserRepo struct { 106 - Name string `json:"name"` 107 - CloneUrl string `json:"clone_url"` 108 - DefaultBranch string `json:"default_branch"` 109 - Description string `json:"description"` 110 - Homepage string `json:"homepage"` 111 - Topics []string `json:"topics"` 112 - Fork bool `json:"fork"` 113 - Private bool `json:"private"` 114 - Archived bool `json:"archived"` 115 - Disabled bool `json:"disabled"` 107 + Name string `json:"name"` 108 + CloneUrl string `json:"clone_url"` 109 + Stars int `json:"stargazers_count"` 110 + PushedAt time.Time `json:"pushed_at"` 111 + DefaultBranch string `json:"default_branch"` 112 + Description string `json:"description"` 113 + Homepage string `json:"homepage"` 114 + Topics []string `json:"topics"` 115 + Fork bool `json:"fork"` 116 + Private bool `json:"private"` 117 + Archived bool `json:"archived"` 118 + Disabled bool `json:"disabled"` 116 119 } 117 120 118 121 func (s *AccountMigration) listGitHubRepos(w http.ResponseWriter, r *http.Request) { ··· 182 185 Description: ghrepo.Description, 183 186 Website: ghrepo.Homepage, 184 187 Topics: ghrepo.Topics, 188 + Stars: ghrepo.Stars, 189 + PushedAt: ghrepo.PushedAt, 185 190 Selected: !migrated, 186 191 }) 187 192 } 193 + 194 + // sort by stars desc, then most recently pushed 195 + slices.SortFunc(importRepos, func(a, b pages.RepoImportParams) int { 196 + if a.Stars != b.Stars { 197 + return b.Stars - a.Stars 198 + } 199 + return b.PushedAt.Compare(a.PushedAt) 200 + }) 188 201 189 202 if err := s.pages.AccountMigrateRepoListFragment(w, pages.AccountMigrateRepoListParams{ 190 203 Repos: importRepos,
+4 -1
appview/pages/pages.go
··· 1829 1829 Website string 1830 1830 Topics []string 1831 1831 1832 - Selected bool 1832 + // metadata used on bulk-import view 1833 + Stars int 1834 + PushedAt time.Time // last push; used for sorting, not rendered yet 1835 + Selected bool // repos that has been already migrateded will be deselected 1833 1836 } 1834 1837 1835 1838 func (p *Pages) AccountMigrateFromGitHub(w io.Writer, params AccountMigrateFromGitHubParams) error {
+6
appview/pages/templates/account/migrate/fragments/repoList.html
··· 14 14 <input type="checkbox" id="selected_{{ $i }}" name="selected_{{ $i }}" value="1" {{ if $repo.Selected }}checked{{ end }} class="shrink-0" /> 15 15 <span class="min-w-0 truncate">{{ $repo.Name }}</span> 16 16 </label> 17 + {{ if gt .Stars 0 }} 18 + <div class="flex items-center gap-1"> 19 + {{ i "star" "size-3 fill-current" }} 20 + <span class="text-sm">{{ scaleFmt .Stars }}</span> 21 + </div> 22 + {{ end }} 17 23 </div> 18 24 19 25 <div class="flex items-center gap-2 shrink-0">