Repository navigation
Lite: misc - #13449
Lite: misc#13449
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9b7f8dc70b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
Refactors the Lite workspace preview UI to reduce duplication when rendering per-file diffs across change/commit/branch previews.
Changes:
- Removes the
editableprop fromHunk,FileDiff, and preview components, simplifying call sites. - Introduces
ChangesFileDiffListto centralize “fetch diff + render file header + render FileDiff” logic for multiple preview types. - Simplifies commit message body rendering in
CommitPreview(with a behavioral caveat noted in review comments).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| apps/lite/ui/src/routes/project/$id/workspace/route.tsx | Extracts shared file-diff list rendering into ChangesFileDiffList and wires it into Changes/Commit/Branch previews; removes editable plumbing. |
| apps/lite/ui/src/routes/project/$id/workspace/Item.ts | Adds missing /** @public */ annotation to ChangesSectionItem to align with other exported item types. |
9b7f8dc to
d058ba1
Compare
47776c7 to
81ca6c0
Compare
d058ba1 to
2b69c05
Compare
2b69c05 to
5271d69
Compare
| Match.tag("Commit", ({ commitId }) => | ||
| stackId !== undefined | ||
| ? commitFileItem({ | ||
| stackId, | ||
| commitId, | ||
| treeChange: change, | ||
| }) | ||
| : undefined, | ||
| ), |
There was a problem hiding this comment.
ChangesFileDiffList accepts fileParent and stackId independently, but Commit sources require a stackId to build a commitFileItem. Consider tightening the props with a discriminated union so stackId is required when fileParent?._tag === "Commit" (or handle the missing stackId explicitly) to avoid silent behavior differences if it’s ever called with an inconsistent prop combination.
| Match.tag("Commit", ({ commitId }) => | |
| stackId !== undefined | |
| ? commitFileItem({ | |
| stackId, | |
| commitId, | |
| treeChange: change, | |
| }) | |
| : undefined, | |
| ), | |
| Match.tag("Commit", ({ commitId }) => { | |
| assert( | |
| stackId !== undefined, | |
| "`ChangesFileDiffList` requires `stackId` when `fileParent._tag === \"Commit\"`" | |
| ); | |
| return commitFileItem({ | |
| stackId, | |
| commitId, | |
| treeChange: change, | |
| }); | |
| }), |
5419d49 to
ac70d09
Compare
5271d69 to
01d4902
Compare
4a7ba68 to
5e31769
Compare
01d4902 to
46e7c54
Compare
2dc84ff to
a6db527
Compare
We can use `fileParent`.
46e7c54 to
400367b
Compare
No description provided.