Monorepo for Tangled tangled.org

appview: allows a default knot to be configured #858

closed opened by willdot.net targeting master from [deleted fork]: master

This follows on from the work carried out in #836

I've added a select box in the Knots settings page which pulls in the users knots and also adds in knot1.tangled.sh. When the user selects one of these options, it will save to their profile in the database. NOTE: I haven't yet implemented adding that to the AT record because I'm not sure on how the lexicon setup works yet!

Then when users go to create a new repo / fork, if there is a value in their profile for the default knot, then that will pre select the knot to use for the new repo / fork.

Labels

None yet.

assignee

None yet.

Participants 2
AT URI
at://did:plc:dadhhalkfcq3gucaq25hjqon/sh.tangled.repo.pull/3m7glmp44b322
+26 -8
Interdiff #2 โ†’ #3
appview/db/db.go

This file has not been changed.

appview/db/profile.go

This file has not been changed.

appview/knots/knots.go

This file has not been changed.

appview/models/profile.go

This file has not been changed.

appview/pages/pages.go

This file has not been changed.

appview/pages/templates/knots/index.html

This file has not been changed.

appview/pages/templates/repo/fork.html

This file has not been changed.

+1 -1
appview/pages/templates/repo/index.html
··· 47 <div class="px-4 py-2 border-b border-gray-200 dark:border-gray-600 flex items-center gap-4 flex-wrap"> 48 {{ range $value := .Languages }} 49 <div 50 - class="flex flex-grow items-center gap-2 text-xs align-items-center justify-center" 51 > 52 {{ template "repo/fragments/colorBall" (dict "color" (langColor $value.Name)) }} 53 <div>{{ or $value.Name "Other" }}
··· 47 <div class="px-4 py-2 border-b border-gray-200 dark:border-gray-600 flex items-center gap-4 flex-wrap"> 48 {{ range $value := .Languages }} 49 <div 50 + class="flex items-center gap-2 text-xs align-items-center justify-center" 51 > 52 {{ template "repo/fragments/colorBall" (dict "color" (langColor $value.Name)) }} 53 <div>{{ or $value.Name "Other" }}
appview/pages/templates/repo/new.html

This file has not been changed.

+3 -1
appview/pages/templates/user/followers.html
··· 19 "FollowersCount" .FollowersCount 20 "FollowingCount" .FollowingCount) }} 21 {{ else }} 22 - <p class="px-6 dark:text-white">This user does not have any followers yet.</p> 23 {{ end }} 24 </div> 25 {{ end }}
··· 19 "FollowersCount" .FollowersCount 20 "FollowingCount" .FollowingCount) }} 21 {{ else }} 22 + <div class="text-base text-gray-500 flex items-center justify-center italic p-12 border border-gray-200 dark:border-gray-700 rounded"> 23 + <span>This user does not have any followers yet.</span> 24 + </div> 25 {{ end }} 26 </div> 27 {{ end }}
+3 -1
appview/pages/templates/user/following.html
··· 19 "FollowersCount" .FollowersCount 20 "FollowingCount" .FollowingCount) }} 21 {{ else }} 22 - <p class="px-6 dark:text-white">This user does not follow anyone yet.</p> 23 {{ end }} 24 </div> 25 {{ end }}
··· 19 "FollowersCount" .FollowersCount 20 "FollowingCount" .FollowingCount) }} 21 {{ else }} 22 + <div class="text-base text-gray-500 flex items-center justify-center italic p-12 border border-gray-200 dark:border-gray-700 rounded"> 23 + <span>This user does not follow anyone yet.</span> 24 + </div> 25 {{ end }} 26 </div> 27 {{ end }}
+10 -2
appview/pages/templates/user/overview.html
··· 16 <p class="text-sm font-bold px-2 pb-4 dark:text-white">ACTIVITY</p> 17 <div class="flex flex-col gap-4 relative"> 18 {{ if .ProfileTimeline.IsEmpty }} 19 - <p class="dark:text-white">This user does not have any activity yet.</p> 20 {{ end }} 21 22 {{ with .ProfileTimeline }} ··· 254 {{ template "user/fragments/repoCard" (list $ . false) }} 255 </div> 256 {{ else }} 257 - <p class="dark:text-white">This user does not have any pinned repos.</p> 258 {{ end }} 259 </div> 260 </div>
··· 16 <p class="text-sm font-bold px-2 pb-4 dark:text-white">ACTIVITY</p> 17 <div class="flex flex-col gap-4 relative"> 18 {{ if .ProfileTimeline.IsEmpty }} 19 + <div class="text-base text-gray-500 flex items-center justify-center italic p-12 border border-gray-200 dark:border-gray-700 rounded"> 20 + <span class="flex items-center gap-2"> 21 + This user does not have any activity yet. 22 + </span> 23 + </div> 24 {{ end }} 25 26 {{ with .ProfileTimeline }} ··· 258 {{ template "user/fragments/repoCard" (list $ . false) }} 259 </div> 260 {{ else }} 261 + <div class="text-base text-gray-500 flex items-center justify-center italic p-12 border border-gray-200 dark:border-gray-700 rounded"> 262 + <span class="flex items-center gap-2"> 263 + This user does not have any pinned repos. 264 + </span> 265 + </div> 266 {{ end }} 267 </div> 268 </div>
+3 -1
appview/pages/templates/user/repos.html
··· 13 {{ template "user/fragments/repoCard" (list $ . false) }} 14 </div> 15 {{ else }} 16 - <p class="px-6 dark:text-white">This user does not have any repos yet.</p> 17 {{ end }} 18 </div> 19 {{ end }}
··· 13 {{ template "user/fragments/repoCard" (list $ . false) }} 14 </div> 15 {{ else }} 16 + <div class="text-base text-gray-500 flex items-center justify-center italic p-12 border border-gray-200 dark:border-gray-700 rounded"> 17 + <span>This user does not have any repos yet.</span> 18 + </div> 19 {{ end }} 20 </div> 21 {{ end }}
+3 -1
appview/pages/templates/user/starred.html
··· 13 {{ template "user/fragments/repoCard" (list $ . true) }} 14 </div> 15 {{ else }} 16 - <p class="px-6 dark:text-white">This user does not have any starred repos yet.</p> 17 {{ end }} 18 </div> 19 {{ end }}
··· 13 {{ template "user/fragments/repoCard" (list $ . true) }} 14 </div> 15 {{ else }} 16 + <div class="text-base text-gray-500 flex items-center justify-center italic p-12 border border-gray-200 dark:border-gray-700 rounded"> 17 + <span>This user does not have any starred repos yet.</span> 18 + </div> 19 {{ end }} 20 </div> 21 {{ end }}
+3 -1
appview/pages/templates/user/strings.html
··· 13 {{ template "singleString" (list $ .) }} 14 </div> 15 {{ else }} 16 - <p class="px-6 dark:text-white">This user does not have any strings yet.</p> 17 {{ end }} 18 </div> 19 {{ end }}
··· 13 {{ template "singleString" (list $ .) }} 14 </div> 15 {{ else }} 16 + <div class="text-base text-gray-500 flex items-center justify-center italic p-12 border border-gray-200 dark:border-gray-700 rounded"> 17 + <span>This user does not have any strings yet.</span> 18 + </div> 19 {{ end }} 20 </div> 21 {{ end }}
appview/repo/repo.go

This file has not been changed.

appview/state/profile.go

This file has not been changed.

appview/state/router.go

This file has not been changed.

appview/state/state.go

This file has not been changed.

History

4 rounds 8 comments
sign up or login to add to the discussion
1 commit
expand
ead0762e
appview: allows a default knot to be configured
expand 2 comments

I've fucked up @oppi.li

I had to delete my fork last week because I messed it up badly ๐Ÿ™ˆ And now I can't fix the merge conflicts.

Is there an easy way to rectify changing this PR to my new fork or should I just cut my losses and start the PR from scratch (fixing the merge conflicts by doing so)

im afraid there is no way to do that right now, probably best to open a new PR!

closed without merging
3 commits
expand
fe49521e
appview: allows a default knot to be configured
48ed4260
undo flake.lock change
3eae6087
appview: nil check when getting profile
expand 6 comments

valuable addition!

this strikes me more as a preference, i don't think this should go into the profile record however.

Do you mean the AT record or the database record?

Iโ€™m now doubting storing it in AT record because the default knot1.tangled.sh is only available in the tangled app view, not a 3rd party app view!

thanks for the work on this. comments:

  • can we squash all of this work into just one commit?
  • the PR also touches a few other template files, are these changes relevant to this addition? could we extract that to a different PR/commit?

will give this a quick test!

Oh Iโ€™m not sure why those files have changed. Iโ€™ll revert them. Probably my IDE autoformat.

Ok squashed the commits into a single commit, which also removed the random files that had been changed from the diff ๐Ÿคฃ

2 commits
expand
fe49521e
appview: allows a default knot to be configured
48ed4260
undo flake.lock change
expand 0 comments
1 commit
expand
fe49521e
appview: allows a default knot to be configured
expand 0 comments