fix: show linked repo status lines with diff stats

This commit is contained in:
Alex Lucero 2026-05-31 08:22:31 +02:00
parent bd9f6cba20
commit e096b662ab
2 changed files with 20 additions and 14 deletions

View file

@ -1459,19 +1459,24 @@ function LinkedRepoChangeRow({ dir }: { dir: LinkedRepoChangeDirectorySummary })
</div>
{dir.error ? (
<div className="linked-repo-change-row__error">{dir.error}</div>
) : dir.diffStat ? (
<pre className="linked-repo-change-row__stat">
{dir.diffStat}
{dir.diffStatTruncated ? "\n…truncated" : ""}
</pre>
) : visibleStatusLines.length > 0 ? (
<div className="linked-repo-change-row__status-lines">
{visibleStatusLines.map((line) => (
<code key={line}>{line}</code>
))}
{dir.statusTruncated ? <code>truncated</code> : null}
</div>
) : null}
) : (
<>
{dir.diffStat ? (
<pre className="linked-repo-change-row__stat">
{dir.diffStat}
{dir.diffStatTruncated ? "\n…truncated" : ""}
</pre>
) : null}
{visibleStatusLines.length > 0 ? (
<div className="linked-repo-change-row__status-lines">
{visibleStatusLines.map((line) => (
<code key={line}>{line}</code>
))}
{dir.statusTruncated ? <code>truncated</code> : null}
</div>
) : null}
</>
)}
</div>
);
}

View file

@ -349,6 +349,7 @@ describe('AssistantMessage linked repo changes', () => {
expect(screen.getByText('Linked repo changes')).toBeTruthy();
expect(screen.getByText('2 changed files · 1 untracked file')).toBeTruthy();
expect(screen.getByText('repo/app')).toBeTruthy();
expect(screen.getByText(/src\/app\.ts/)).toBeTruthy();
expect(screen.getAllByText(/src\/app\.ts/).length).toBeGreaterThan(0);
expect(screen.getByText('?? src/new.ts')).toBeTruthy();
});
});