Skip to content

Commit

Permalink
show selected-commit (right bar) only when a commit was clicked, and …
Browse files Browse the repository at this point in the history
…option to close by clicking either the X button or again on the same commit
  • Loading branch information
phil294 committed Apr 25, 2023
1 parent 44908ad commit b27a345
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
6 changes: 5 additions & 1 deletion web/src/views/MainView.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,11 @@ export default

commit_clicked = (###* @type {Commit} ### commit) =>
show_invisible_branches.value = false
selected_commit.value = commit
selected_commit.value =
if selected_commit.value == commit
null
else
commit

config_global_actions = ref []
do =>
Expand Down
18 changes: 14 additions & 4 deletions web/src/views/MainView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
summary Configure...
git-input :git_action="log_action" hide_result="" :action="run_log" ref="git_input_ref"
.row.flex-1
#left.col.flex-noshrink
#left.col
p v-if="!commits.length"
| No commits found
nav.row.align-center.justify-space-between.gap-10
Expand Down Expand Up @@ -53,8 +53,10 @@
span.grey {{ commit.stats.files_changed }}
progress.diff v-if="commit.stats" :value="(commit.stats.insertions / (commit.stats.insertions + commit.stats.deletions)) || 0" title="Ratio insertions / deletions"
.datetime.flex-noshrink {{ commit.datetime }}
#right.flex-1.col
selected-commit#selected-commit.active.flex-1.fill-w.padding v-if="selected_commit" :commit="selected_commit" @change="do_log()"
#right.col.flex-1 v-if="selected_commit"
selected-commit#selected-commit.active.flex-1.fill-w.padding :commit="selected_commit" @change="do_log()"
button#close-selected-commit.center @click="selected_commit=null" title="Close"
i.codicon.codicon-close
#resize-hint v-if="selected_commit"
| ← resize

Expand Down Expand Up @@ -90,7 +92,9 @@ details
background white !important
color red !important
#left
width calc(100% - 400px)
flex-shrink 1
width 100%
min-width 30%
resize horizontal
overflow auto
position relative
Expand Down Expand Up @@ -173,8 +177,14 @@ details
width 93px
#right
min-width 400px
position relative
#selected-commit
overflow auto
#close-selected-commit
position absolute
top 10px
right 10px
#resize-hint
color #555555
font-size small
Expand Down

0 comments on commit b27a345

Please sign in to comment.