Skip to content
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

Improve diff tree spacing #27714

Merged
merged 5 commits into from
Oct 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion web_src/js/components/DiffFileTree.vue
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,19 @@ export default {
};
</script>
<template>
<div v-if="store.fileTreeIsVisible" class="gt-mr-3">
<div v-if="store.fileTreeIsVisible" class="diff-file-tree-items">
<!-- only render the tree if we're visible. in many cases this is something that doesn't change very often -->
<DiffFileTreeItem v-for="item in fileTree" :key="item.name" :item="item"/>
<div v-if="store.isIncomplete" class="gt-pt-2">
<a :class="['ui', 'basic', 'tiny', 'button', store.isLoadingNewData ? 'disabled' : '']" @click.stop="loadMoreData">{{ store.showMoreMessage }}</a>
</div>
</div>
</template>
<style scoped>
.diff-file-tree-items {
display: flex;
flex-direction: column;
gap: 1px;
margin-right: .5rem;
}
</style>
11 changes: 7 additions & 4 deletions web_src/js/components/DiffFileTreeItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,14 @@ a, a:hover {
}

.sub-items {
padding-left: 9px;
display: flex;
flex-direction: column;
gap: 1px;
padding-left: 8px;
}

.item-file {
margin-left: 20px;
.sub-items .item-file {
padding-left: 24px;
}

.item-file.selected {
Expand All @@ -80,7 +83,7 @@ a, a:hover {
display: flex;
align-items: center;
gap: 0.25em;
padding: 2px;
padding: 3px 6px;
}

.item-file:hover,
Expand Down