Skip to content

Commit b305c0b

Browse files
committed
Styles the "Create PR with AI" button
1 parent 0013ca9 commit b305c0b

File tree

1 file changed

+38
-8
lines changed

1 file changed

+38
-8
lines changed

src/webviews/apps/plus/home/components/branch-card.ts

Lines changed: 38 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -163,10 +163,34 @@ export const branchCardStyles = css`
163163
margin-inline-end: auto;
164164
}
165165
166+
.branch-item__row {
167+
display: flex;
168+
gap: 0.8rem;
169+
container-type: inline-size;
170+
contain: layout;
171+
}
172+
173+
.branch-item__row [full] {
174+
flex-grow: 1;
175+
}
176+
166177
.branch-item__missing {
167178
--button-foreground: inherit;
168179
}
169180
181+
.branch-item__is-narrow {
182+
display: none;
183+
}
184+
185+
@container (max-width: 280px) {
186+
.branch-item__is-narrow {
187+
display: block;
188+
}
189+
.branch-item__is-wide {
190+
display: none;
191+
}
192+
}
193+
170194
:host-context(.vscode-dark) .branch-item__missing,
171195
:host-context(.vscode-high-contrast) .branch-item__missing {
172196
--button-background: color-mix(in lab, var(--vscode-sideBar-background) 100%, #fff 3%);
@@ -715,22 +739,28 @@ export abstract class GlBranchCardBase extends GlElement {
715739
if (!this.pr) {
716740
if (this.branch.upstream?.missing === false && this.expanded) {
717741
return html`
718-
<gl-button
719-
class="branch-item__missing"
720-
appearance="secondary"
721-
full
722-
href="${this.createCommandLink('gitlens.home.createPullRequest')}"
723-
>Create a Pull Request</gl-button
724-
>
742+
<div class="branch-item__row">
743+
<gl-button
744+
class="branch-item__missing"
745+
appearance="secondary"
746+
full
747+
href="${this.createCommandLink('gitlens.home.createPullRequest')}"
748+
>Create a Pull Request</gl-button
749+
>
725750
<gl-button
726751
class="branch-item__missing"
752+
tooltip="Create a Pull Request with AI"
727753
appearance="secondary"
728754
href="${this.createCommandLink('gitlens.home.createPullRequest', {
729755
source: 'home',
730756
useAI: true,
731757
})}"
732-
>AI</gl-button
733758
>
759+
<code-icon class="branch-item__is-wide" icon="sparkle" slot="prefix"></code-icon>
760+
<code-icon class="branch-item__is-narrow" icon="sparkle"></code-icon>
761+
<span class="branch-item__is-wide">Create with AI</span>
762+
</gl-button>
763+
</div>
734764
`;
735765
}
736766
return nothing;

0 commit comments

Comments
 (0)