浏览代码

Updates PR actions bindings

main
Keith Daulton 1年前
父节点
当前提交
eeb3d6079d
共有 2 个文件被更改,包括 17 次插入3 次删除
  1. +4
    -0
      src/webviews/apps/plus/focus/components/focus-app.ts
  2. +13
    -3
      src/webviews/apps/plus/focus/components/gk-pull-request-row.ts

+ 4
- 0
src/webviews/apps/plus/focus/components/focus-app.ts 查看文件

@ -225,6 +225,10 @@ export class GlFocusApp extends LitElement {
html`<gk-pull-request-row
.rank=${rank}
.pullRequest=${state.pullRequest}
.isCurrentBranch=${state.isCurrentBranch}
.isCurrentWorktree=${state.isCurrentWorktree}
.hasWorktree=${state.hasWorktree}
.hasLocalBranch=${state.hasLocalBranch}
></gk-pull-request-row>`,
() => html`<gk-issue-row .rank=${rank} .issue=${state.issue}></gk-issue-row>`,
),

+ 13
- 3
src/webviews/apps/plus/focus/components/gk-pull-request-row.ts 查看文件

@ -278,11 +278,21 @@ export class GkPullRequestRow extends LitElement {
slot="trigger"
href="#"
tabindex="${this.hasWorktree || this.isCurrentBranch ? -1 : nothing}"
aria-label="${this.isCurrentBranch ? 'Already on this branch' : 'Switch to Branch...'}"
aria-label="${this.isCurrentBranch
? 'Already on this branch'
: this.hasWorktree
? 'This branch has a worktree'
: 'Switch to Branch...'}"
@click="${this.onSwitchBranchClick}"
><code-icon icon="gl-switch"></code-icon
></a>
<span>${this.isCurrentBranch ? 'Already on this branch' : 'Switch to Branch...'}</span>
<span
>${this.isCurrentBranch
? 'Already on this branch'
: this.hasWorktree
? 'This branch has a worktree'
: 'Switch to Branch...'}</span
>
</gk-tooltip>
</nav>
</gk-focus-item>
@ -304,7 +314,7 @@ export class GkPullRequestRow extends LitElement {
}
onSwitchBranchClick(e: Event) {
if (this.isCurrentBranch) {
if (this.isCurrentBranch || this.hasWorktree) {
e.preventDefault();
e.stopImmediatePropagation();
return;

正在加载...
取消
保存