Repository navigation
fix: preserve graph links in deep reply threads #1497
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: production
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1206,7 +1206,7 @@ export function ThreadReplies({ | |
| reply={reply} | ||
| parent={thread.commit} | ||
| depth={depth + 1} | ||
| graph={isFlattened ? {} : { parent: branchFrom }} | ||
| graph={{ parent: branchFrom }} | ||
| links={ | ||
| isFlattened ? null : ( | ||
| <WithoutGraph> | ||
|
|
@@ -1249,9 +1249,7 @@ export function ThreadReplies({ | |
| <MoreRepliesButton | ||
| thread={thread} | ||
| isFlattened={depth + 1 > maxIndentDepth} | ||
| graph={ | ||
| isFlattened ? {} : { parent: branchFrom } | ||
| } | ||
| graph={{ parent: branchFrom }} | ||
| /> | ||
| </div> | ||
| )} | ||
|
|
@@ -1423,6 +1421,11 @@ function ReplyItem({ | |
| <span className="font-mono text-xs">[deleted]</span> | ||
| This commit was deleted. | ||
| </p> | ||
| <ReplyParentLabel | ||
| parent={parent} | ||
| depth={depth} | ||
| isQuote={reply.parent_id !== parent.id} | ||
| /> | ||
| <ThreadActions thread={thread} /> | ||
| </div> | ||
| </div> | ||
|
|
@@ -1445,6 +1448,47 @@ function ReplyItem({ | |
| ); | ||
| } | ||
|
|
||
| function ReplyParentLabel({ | ||
| parent, | ||
| depth, | ||
| isQuote, | ||
| }: { | ||
| parent: ThreadCommit; | ||
| depth: number; | ||
| isQuote: boolean; | ||
| }) { | ||
| if (depth <= maxIndentDepth) { | ||
| return null; | ||
| } | ||
|
|
||
| return ( | ||
| <p | ||
| className="flex min-w-0 items-center gap-1 font-mono text-xs text-muted-foreground" | ||
| data-test="reply-parent-context" | ||
| > | ||
| <CornerDownRight className="size-3 shrink-0" aria-hidden /> | ||
| <span className="shrink-0"> | ||
| {isQuote ? 'quoting' : 'replying to'} | ||
| </span> | ||
| {isDeleted(parent) ? ( | ||
| <span>[deleted]</span> | ||
|
Comment on lines
+1473
to
+1474
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use the local deletion state for the parent If a parent request returns 404,
|
||
| ) : ( | ||
| <Link | ||
| prefetch | ||
| href={CommitController.show({ | ||
| profile: parent.author, | ||
| commit: parent, | ||
| })} | ||
| className="min-w-0 truncate hover:text-foreground hover:underline" | ||
| data-test="reply-parent-link" | ||
| > | ||
| @{parent.author.handle} | ||
| </Link> | ||
| )} | ||
| </p> | ||
| ); | ||
| } | ||
|
|
||
| function CommitReply({ | ||
| reply, | ||
| parent, | ||
|
|
@@ -1485,7 +1529,6 @@ function CommitReply({ | |
| ); | ||
|
|
||
| const isOwn = useOwnsCommit()(reply); | ||
| const isFlattened = depth > maxIndentDepth; | ||
| const isQuote = reply.quoted_commit_id === parent.id; | ||
| const permalink = CommitController.show({ | ||
| profile: reply.author, | ||
|
|
@@ -1640,17 +1683,11 @@ function CommitReply({ | |
| )} | ||
| </div> | ||
|
|
||
| {isFlattened && ( | ||
| <p className="flex min-w-0 items-center gap-1 font-mono text-xs text-muted-foreground"> | ||
| <CornerDownRight className="size-3 shrink-0" /> | ||
| <span className="truncate"> | ||
| {isQuote ? 'quoting' : 'replying to'}{' '} | ||
| {isDeleted(parent) | ||
| ? '[deleted]' | ||
| : `@${parent.author.handle}`} | ||
| </span> | ||
| </p> | ||
| )} | ||
| <ReplyParentLabel | ||
| parent={parent} | ||
| depth={depth} | ||
| isQuote={isQuote} | ||
| /> | ||
|
|
||
| <div ref={bodyRef} style={translation.bodyStyle}> | ||
| <FoldedCommitBody | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid running the TSX suite twice.
The Node test glob already runs
SeriesStash.test.ts, which invokesvp test runwith this configuration. The configuration selects alltests/Unit/*.test.tsxfiles, so the appended command runs the entire suite again. Remove the appended command to avoid duplicating that work. (raw.githubusercontent.com)