diff --git a/resources/js/components/related-commits.tsx b/resources/js/components/related-commits.tsx
index 9efecb4a1..23e278bdf 100644
--- a/resources/js/components/related-commits.tsx
+++ b/resources/js/components/related-commits.tsx
@@ -1,7 +1,6 @@
import { CommitCard } from '@/components/commit-card';
import { GraphCanvas } from '@/components/graph-canvas';
import { useRelatedCommits } from '@/hooks/use-related-commits';
-import { laneOf } from '@/lib/utils';
import type { Commit } from '@/types';
export function RelatedCommits({ commitId }: { commitId: string }) {
@@ -25,25 +24,15 @@ export function RelatedCommits({ commitId }: { commitId: string }) {
}
/**
- * The related commits chain one after the other in a canvas of their own, below the thread's, and end on a dot below
- * the last one, as a feed does.
+ * The related commits relate to the commit shown, not to each other, so each one ends on a dot of its own in a canvas
+ * below the thread's, as a feed does.
*/
export function RelatedCommitList({ commits }: { commits: Commit[] }) {
return (
- {commits.map((commit, index) => {
- const previous = commits[index - 1];
-
- return (
-
- );
- })}
+ {commits.map((commit) => (
+
+ ))}
);
}
diff --git a/tests/Unit/StandaloneCommitGraphs.test.tsx b/tests/Unit/StandaloneCommitGraphs.test.tsx
index f238cf40f..fa5db5d1a 100644
--- a/tests/Unit/StandaloneCommitGraphs.test.tsx
+++ b/tests/Unit/StandaloneCommitGraphs.test.tsx
@@ -181,7 +181,7 @@ test('ends the chain of search results on a dot below the last one', async () =>
);
});
-test('draws related commits in a canvas of their own, chained one after the other and ending on a dot below the last one', async () => {
+test('draws related commits in a canvas of their own, each commit ending on its dot as in a feed', async () => {
const html = await render(() => (
- html.lastIndexOf('Commit two'),
- );
+ assert.equal(html.match(/data-test="rail-end-dot"/g)?.length, 3);
});