Skip to content

Commit

Permalink
Updates ordering of minimap tooltip refs
Browse files Browse the repository at this point in the history
  • Loading branch information
eamodio committed Mar 7, 2023
1 parent 3a12cdf commit c27e235
Showing 1 changed file with 39 additions and 33 deletions.
72 changes: 39 additions & 33 deletions src/webviews/apps/plus/graph/minimap/minimap.ts
Expand Up @@ -333,6 +333,10 @@ const styles = css`
margin: 0.5rem 0;
max-width: fit-content;
}
.bb-tooltip .refs:empty {
margin: 0;
}
.bb-tooltip .refs .branch {
border-radius: 3px;
padding: 0 4px;
Expand Down Expand Up @@ -861,39 +865,41 @@ export class GraphMinimap extends FASTElement {
${
groups != null
? /*html*/ `
<div class="refs">
${
groups
?.get('branch')
?.sort((a, b) => (a.current ? -1 : 1) - (b.current ? -1 : 1))
.map(
m =>
/*html*/ `<span class="branch${m.current ? ' current' : ''}">${
m.name
}</span>`,
)
.join('') ?? ''
}
${
groups
?.get('remote')
?.sort((a, b) => (a.current ? -1 : 1) - (b.current ? -1 : 1))
?.map(
m =>
/*html*/ `<span class="remote${m.current ? ' current' : ''}">${
m.name
}</span>`,
)
.join('') ?? ''
}
${stashesCount ? /*html*/ `<span class="stash">${pluralize('stash', stashesCount, { plural: 'stashes' })}</span>` : ''}
${
groups
?.get('tag')
?.map(m => /*html*/ `<span class="tag">${m.name}</span>`)
.join('') ?? ''
}
</div>`
<div class="refs">${
stashesCount
? /*html*/ `<span class="stash">${pluralize('stash', stashesCount, {
plural: 'stashes',
})}</span>`
: ''
}${
groups
?.get('branch')
?.sort((a, b) => (a.current ? -1 : 1) - (b.current ? -1 : 1))
.map(
m =>
/*html*/ `<span class="branch${m.current ? ' current' : ''}">${
m.name
}</span>`,
)
.join('') ?? ''
}</div>
<div class="refs">${
groups
?.get('remote')
?.sort((a, b) => (a.current ? -1 : 1) - (b.current ? -1 : 1))
?.map(
m =>
/*html*/ `<span class="remote${m.current ? ' current' : ''}">${
m.name
}</span>`,
)
.join('') ?? ''
}${
groups
?.get('tag')
?.map(m => /*html*/ `<span class="tag">${m.name}</span>`)
.join('') ?? ''
}</div>`
: ''
}
</div>`;
Expand Down

0 comments on commit c27e235

Please sign in to comment.