-
Notifications
You must be signed in to change notification settings - Fork 566
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
feat: implement Stack selected commit right half of workspace page #7340
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
f584fc9
to
08320fa
Compare
08320fa
to
63238f1
Compare
63238f1
to
e2bea97
Compare
e2bea97
to
349c531
Compare
349c531
to
e436608
Compare
e436608
to
61cb743
Compare
}} | ||
/> | ||
{/each} | ||
{#if diff.subject.hunks.length} |
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.
I think you can drop this if statement? Iterating of a zero length array is a no-op.
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.
Hmm yeah logically you're probably right. I had it here in order to be able ot render at least something (in this case the string "No Content"), when there are no hunks.
Ideally I'd like to just not allow the user to toggle them open when there are no hunks, however, due to the way we have it architected now, we don't know the contents of the file change, i.e. the diff, until when the user opens it.
So its not straight forward to disable toggling open of a file which doesn't have a hunk (i.e. new empty file Addition
) without checking them all beforehand, which is what we wanted to avoid, right. You have any good ideas? 🤔
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.
Good point.
@krlvi I think in v2 code we generate a synthetic hunk when there is no diff. It's easier for the front end if we keep that behaviour, but what do you think?

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.
Surely we could add a synthetic hunk, but on face value this feels like masking another problem. It's totally valid to have no hunks in the file (eg. file executable bit added/removed) - and the app could/should show that.
At the moment I feel like I'd rather favor correctness (of the API) over supporting the existing semantic.
Is there something that I might be missing here?
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.
And I guess the same applies for commits with no files in them - the app allows their creation, and it should be still possible to preview / edit the message
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.
@krlvi Yeah +1
I was just reading through the types again and it seems like we could disable the opening of these types of file with those flags too. Would it be a lot of work on your end to add a EmptyFile
TreeChange.status
Flag?
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.
@ndom91 my intuition is that we should still allow the file to be opened, but show a message where we otherwise have a diff.
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.
Okay yeah I'm open to whatever. Maybe Pavel has a nice design idea haha
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.
Not yet, but we will at some point. For now we can just drop some text in its place?
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.
d4b513e
to
94349d7
Compare
0ebcbcc
to
5d11b51
Compare
5f84ba3
to
a3243ee
Compare
a3243ee
to
cceb88f
Compare
@@ -1,27 +1,32 @@ | |||
<script lang="ts"> | |||
import UnifiedDiffView from './v3/UnifiedDiffView.svelte'; | |||
import ReduxResult from '$components/ReduxResult.svelte'; |
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.
@mtsgrd you wanted to potentially get rid of this file btw, is that still the case?
I had to fix one or two TS-related things here in this file in order to get the project to build and then just kept going a bit further haha
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.
Yeah we can drop SelectionView.svelte
!
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.
Sounds good. Dropped!
cceb88f
to
c9bdcbd
Compare
🧢 Changes
FileList
commit.message
fieldStackTabs
dynamic border-radius changesUnifiedDiffView
to take a wholeTreeChange
prop in order to more easily show both worktree changes and committed changes via that 1 component☕️ Reasoning