Skip to content

Commit 6eeced1

Browse files
committed
Moves switch repo action to the repo name
1 parent e606824 commit 6eeced1

File tree

1 file changed

+21
-15
lines changed

1 file changed

+21
-15
lines changed

src/webviews/apps/plus/home/components/active-work.ts

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ export class GlActiveWork extends SignalWatcher(LitElement) {
5252
.tooltip {
5353
text-transform: none;
5454
}
55+
.uppercase {
56+
text-transform: uppercase;
57+
}
5558
`,
5659
];
5760

@@ -109,7 +112,23 @@ export class GlActiveWork extends SignalWatcher(LitElement) {
109112

110113
return html`
111114
<gl-section ?loading=${isFetching}>
112-
<span slot="heading">${this.renderRepositoryIcon(repo.provider)} ${repo.name}</span>
115+
<span slot="heading">
116+
${this.renderRepositoryIcon(repo.provider)}
117+
${when(
118+
this._homeState.repositories.openCount > 1,
119+
() =>
120+
html`<gl-button
121+
aria-busy="${ifDefined(isFetching)}"
122+
?disabled=${isFetching}
123+
class="section-heading-action"
124+
appearance="toolbar"
125+
tooltip="Change Repository"
126+
@click=${(e: MouseEvent) => this.onChange(e)}
127+
><span class="uppercase">${repo.name}</span><code-icon icon="chevron-down"></code-icon
128+
></gl-button>`,
129+
() => html`${repo.name}`,
130+
)}
131+
</span>
113132
<span slot="heading-actions"
114133
><gl-button
115134
aria-busy="${ifDefined(isFetching)}"
@@ -132,20 +151,7 @@ export class GlActiveWork extends SignalWatcher(LitElement) {
132151
href=${createCommandLink('gitlens.home.fetch', undefined)}
133152
><code-icon icon="repo-fetch"></code-icon
134153
></gl-button>
135-
${when(
136-
this._homeState.repositories.openCount > 1,
137-
() =>
138-
html`<gl-button
139-
aria-busy="${ifDefined(isFetching)}"
140-
?disabled=${isFetching}
141-
class="section-heading-action"
142-
appearance="toolbar"
143-
tooltip="Change Repository"
144-
@click=${(e: MouseEvent) => this.onChange(e)}
145-
><code-icon icon="chevron-down"></code-icon
146-
></gl-button>`,
147-
)}</span
148-
>
154+
</span>
149155
${activeBranches.map(branch => {
150156
return this.renderRepoBranchCard(branch, repo.path, isFetching);
151157
})}

0 commit comments

Comments
 (0)