Monorepo for Tangled tangled.org

appview: replace PullComment to Comment #865

open opened by boltless.me targeting master from sl/wnrvrwyvrlzo
Labels

None yet.

assignee

None yet.

Participants 2
AT URI
at://did:plc:xasnlahkri4ewmbuzly2rlc5/sh.tangled.repo.pull/3m7iohv2yb422
+23 -22
Interdiff #5 #6
appview/db/comments.go

This file has not been changed.

+8 -8
appview/db/db.go
··· 1173 1173 return err 1174 1174 }) 1175 1175 1176 + return &DB{ 1177 + db, 1178 + logger, 1179 + 1180 + 1181 + return err 1182 + }) 1183 + 1176 1184 orm.RunMigration(conn, logger, "add-comments-table", func(tx *sql.Tx) error { 1177 1185 _, err := tx.Exec(` 1178 1186 drop table if exists comments; ··· 1254 1262 return err 1255 1263 }) 1256 1264 1257 - return &DB{ 1258 - db, 1259 - logger, 1260 - 1261 - 1262 - return err 1263 - }) 1264 - 1265 1265 return &DB{ 1266 1266 db, 1267 1267 logger,
appview/db/pulls.go

This file has not been changed.

appview/db/reference.go

This file has not been changed.

+6 -6
appview/ingester.go
··· 930 930 return nil 931 931 } 932 932 933 + func (i *Ingester) ingestLabelDefinition(e *jmodels.Event) error { 934 + did := e.Did 935 + rkey := e.Commit.RKey 936 + return nil 937 + } 938 + 933 939 func (i *Ingester) ingestComment(e *jmodels.Event) error { 934 940 did := e.Did 935 941 rkey := e.Commit.RKey ··· 999 1005 return nil 1000 1006 } 1001 1007 1002 - func (i *Ingester) ingestLabelDefinition(e *jmodels.Event) error { 1003 - did := e.Did 1004 - rkey := e.Commit.RKey 1005 - return nil 1006 - } 1007 - 1008 1008 func (i *Ingester) ingestLabelDefinition(e *jmodels.Event) error { 1009 1009 did := e.Did 1010 1010 rkey := e.Commit.RKey
appview/models/comment.go

This file has not been changed.

appview/models/pull.go

This file has not been changed.

appview/notify/db/db.go

This file has not been changed.

appview/notify/merged_notifier.go

This file has not been changed.

appview/notify/notifier.go

This file has not been changed.

appview/notify/posthog/notifier.go

This file has not been changed.

+9 -8
appview/pages/templates/repo/pulls/pull.html
··· 505 505 {{ end }} 506 506 507 507 {{ define "submissionComment" }} 508 - <div id="comment-{{.Id}}" class="flex gap-2 -ml-4 py-4 w-full mx-auto"> 508 + <div id="comment-{{.ID}}" class="flex gap-2 -ml-4 py-4 w-full mx-auto"> 509 509 <!-- left column: profile picture --> 510 510 <div class="flex-shrink-0"> 511 511 <img 512 - src="{{ tinyAvatar .Did.String }}" 512 + src="{{ tinyAvatar .OwnerDid }}" 513 513 alt="" 514 514 class="rounded-full size-8 mr-1 border-2 border-gray-100 dark:border-gray-900" 515 515 /> ··· 518 518 <div class="flex-1 min-w-0"> 519 519 <!-- Row 1: Author and timestamp --> 520 520 <div class="text-sm text-gray-500 dark:text-gray-400 flex items-center gap-1"> 521 - <span>{{ resolve .Did.String }}</span> 521 + <span>{{ resolve .OwnerDid }}</span> 522 522 <span class="before:content-['·']"></span> 523 - <a class="text-gray-500 dark:text-gray-400 hover:text-gray-500 dark:hover:text-gray-300" href="#comment-{{.Id}}"> 523 + <a class="text-gray-500 dark:text-gray-400 hover:text-gray-500 dark:hover:text-gray-300" href="#comment-{{.ID}}"> 524 524 {{ template "repo/fragments/time" .Created }} 525 525 </a> 526 526 </div> ··· 565 565 {{ end }} 566 566 567 567 {{ define "submissionComment" }} 568 - <div id="comment-{{.ID}}" class="flex gap-2 -ml-4 py-4 w-full mx-auto"> 568 + <div id="comment-{{.Id}}" class="flex gap-2 -ml-4 py-4 w-full mx-auto"> 569 569 <!-- left column: profile picture --> 570 570 <div class="flex-shrink-0 h-fit relative"> 571 571 <img 572 - src="{{ tinyAvatar .OwnerDid }}" 572 + src="{{ tinyAvatar .Did.String }}" 573 573 alt="" 574 574 class="rounded-full size-8 mr-1 border-2 border-gray-100 dark:border-gray-900 z-5" 575 575 /> ··· 578 578 <div class="flex-1 min-w-0"> 579 579 <!-- Row 1: Author and timestamp --> 580 580 <div class="text-sm text-gray-500 dark:text-gray-400 flex items-center gap-1"> 581 - {{ $handle := resolve .OwnerDid }} 581 + {{ $handle := resolve .Did.String }} 582 582 <a class="text-gray-500 dark:text-gray-400 hover:text-gray-500 dark:hover:text-gray-300" href="/{{ $handle }}">{{ $handle }}</a> 583 583 <span class="before:content-['·']"></span> 584 - <a class="text-gray-500 dark:text-gray-400 hover:text-gray-500 dark:hover:text-gray-300" href="#comment-{{.ID}}"> 584 + <a class="text-gray-500 dark:text-gray-400 hover:text-gray-500 dark:hover:text-gray-300" href="#comment-{{.Id}}"> 585 + {{ template "repo/fragments/time" .Created }} 585 586 {{ template "repo/fragments/shortTime" .Created }} 586 587 </a> 587 588 </div>
appview/pulls/opengraph.go

This file has not been changed.

appview/pulls/pulls.go

This patch was likely rebased, as context lines do not match.

appview/state/state.go

This file has not been changed.

History

8 rounds 4 comments
sign up or login to add to the discussion
1 commit
expand
appview: replace PullComment to Comment
2/3 timeout, 1/3 success
expand
merge conflicts detected
expand
  • appview/notify/db/db.go:260
  • appview/notify/merged_notifier.go:81
  • appview/notify/notifier.go:22
  • appview/pulls/opengraph.go:277
expand 0 comments
1 commit
expand
appview: replace PullComment to Comment
2/3 failed, 1/3 success
expand
expand 0 comments
1 commit
expand
appview: replace PullComment to Comment
3/3 success
expand
expand 0 comments
1 commit
expand
appview: replace PullComment to Comment
3/3 success
expand
expand 1 comment

here, the sort order is reversed, it should be .Before.

1 commit
expand
appview: replace PullComment to Comment
1/3 failed, 2/3 success
expand
expand 0 comments
1 commit
expand
appview: replace PullComment to Comment
1/3 failed, 2/3 success
expand
expand 0 comments
1 commit
expand
appview: replace PullComment to Comment
3/3 success
expand
expand 3 comments

here will this delete all comments made on tangled thus far? don't think this is the right approach if so.

I should've been more precise about my expression. Existing comments won't be dropped as they are stored in issue_comments and pull_comments table (I'm just dropping legacy table with same name there), but yeah this PR itself doesn't include the backward compatibility layer yet so old comments won't be rendered.

Honestly this PR hasn't been updated since you two suggested to just ingest old records. I'll push more commits on top of this stack.

As a side note: I'd suggest to not publish the new sh.tangled.comment lexicon yet.

This unified comment record can be used for PR review comments and it might make us to modify the schema again. I think it would be safest to publish this when PR redesign discussion is finished.

1 commit
expand
appview: replace PullComment to Comment
3/3 success
expand
expand 0 comments