Skip to content

Commit

Permalink
refactor: combine all history view tooltips in one
Browse files Browse the repository at this point in the history
  • Loading branch information
Vinzent03 committed Mar 3, 2024
1 parent 675cef5 commit 4397d86
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/gitManager/simpleGit.ts
Expand Up @@ -574,7 +574,7 @@ export class SimpleGit extends GitManager {
name: e.author_name,
email: e.author_email,
},
refs: e.refs.split(", "),
refs: e.refs.split(", ").filter((e) => e.length > 0),
diff: {
...e.diff!,
files:
Expand Down
22 changes: 7 additions & 15 deletions src/ui/history/components/logComponent.svelte
Expand Up @@ -39,6 +39,10 @@
<div class="tree-item nav-folder" class:is-collapsed={isCollapsed}>
<div
class="tree-item-self is-clickable nav-folder-title"
aria-label={`${log.refs.length > 0 ? log.refs.join(", ") + "\n" : ""}${log.author?.name}
${moment(log.date).format(plugin.settings.commitDateFormat)}
${log.message}`}
data-tooltip-position={side}
on:click={() => (isCollapsed = !isCollapsed)}
>
<div
Expand Down Expand Up @@ -66,31 +70,19 @@
</div>
{/if}
{#if plugin.settings.authorInHistoryView != "hide" && log.author?.name}
<div
class="git-author"
aria-label={log.author.name}
data-tooltip-position={side}
>
<div class="git-author">
{authorToString(log)}
</div>
{/if}
{#if plugin.settings.dateInHistoryView}
<div
class="git-date"
aria-label={log.date}
data-tooltip-position={side}
>
<div class="git-date">
{moment(log.date).format(
plugin.settings.commitDateFormat
)}
</div>
{/if}

<div
class="tree-item-inner nav-folder-title-content"
aria-label={log.message}
data-tooltip-position={side}
>
<div class="tree-item-inner nav-folder-title-content">
{log.message}
</div>
</div>
Expand Down

0 comments on commit 4397d86

Please sign in to comment.