mirror of
https://github.com/nexu-io/open-design.git
synced 2026-05-31 19:04:39 +07:00
fix: show linked repo status lines with diff stats
This commit is contained in:
parent
bd9f6cba20
commit
e096b662ab
2 changed files with 20 additions and 14 deletions
|
|
@ -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>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue