mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-12-24 01:51:57 +03:00
fix: upstream commits accordion and cards (#5044)
This commit is contained in:
parent
d8df95efc8
commit
1d4f5f6762
@ -75,7 +75,8 @@
|
||||
files = await listRemoteCommitFiles(project.id, commit.id);
|
||||
}
|
||||
|
||||
function toggleFiles() {
|
||||
function toggleFiles(e?: MouseEvent) {
|
||||
e?.stopPropagation();
|
||||
if (!filesToggleable) return;
|
||||
showDetails = !showDetails;
|
||||
|
||||
|
@ -25,57 +25,12 @@ function generateLineData({
|
||||
line.top.type = 'Upstream';
|
||||
line.bottom.type = 'Upstream';
|
||||
line.commitNode = { type: 'Upstream', commit };
|
||||
|
||||
// If there are local commits we want to fill in a local dashed line
|
||||
if (localBranchGroups.length > 0) {
|
||||
line.commitNode.type = 'Local';
|
||||
line.top.type = 'Local';
|
||||
line.bottom.type = 'Local';
|
||||
line.top.style = 'dashed';
|
||||
line.bottom.style = 'dashed';
|
||||
}
|
||||
});
|
||||
|
||||
let localCommitWithChangeIdFound = false;
|
||||
localBranchGroups.forEach(({ commit, line }) => {
|
||||
line.top.type = 'Local';
|
||||
line.bottom.type = 'Local';
|
||||
line.commitNode = { type: 'Local', commit };
|
||||
|
||||
if (localCommitWithChangeIdFound) {
|
||||
// If a commit with a change ID has been found above this commit, use the leftStyle
|
||||
line.top.type = 'LocalShadow';
|
||||
line.bottom.type = 'LocalShadow';
|
||||
|
||||
if (commit.relatedRemoteCommit) {
|
||||
line.commitNode = {
|
||||
type: 'LocalShadow',
|
||||
commit
|
||||
};
|
||||
}
|
||||
} else {
|
||||
if (commit.relatedRemoteCommit) {
|
||||
// For the first commit with a change ID found, only set the top if there are any remote commits
|
||||
if (remoteBranchGroups.length > 0) {
|
||||
line.top.type = 'LocalShadow';
|
||||
}
|
||||
|
||||
line.commitNode = {
|
||||
type: 'LocalShadow',
|
||||
commit
|
||||
};
|
||||
line.bottom.type = 'LocalShadow';
|
||||
|
||||
localCommitWithChangeIdFound = true;
|
||||
} else {
|
||||
// If there are any remote commits, continue the line
|
||||
if (remoteBranchGroups.length > 0) {
|
||||
line.top.type = 'LocalRemote';
|
||||
line.bottom.type = 'LocalRemote';
|
||||
line.commitNode.type = 'LocalRemote';
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
localAndRemoteBranchGroups.forEach(({ commit, line }) => {
|
||||
|
Loading…
Reference in New Issue
Block a user