Skip to content

Commit add2052

Browse files
committed
Changes PopMenu for GlPopover
1 parent 5cbb76b commit add2052

File tree

2 files changed

+58
-68
lines changed

2 files changed

+58
-68
lines changed

src/webviews/apps/plus/graph/GraphWrapper.tsx

Lines changed: 58 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1164,8 +1164,14 @@ export function GraphWrapper({
11641164
Create a branch from <i>{branchName}</i> and switch
11651165
</span>
11661166
</GlTooltip>
1167-
<GlTooltip placement="top" distance={7}>
1168-
<PopMenu position="right">
1167+
<GlPopover
1168+
className="popover"
1169+
placement="bottom-start"
1170+
trigger="focus"
1171+
arrow={false}
1172+
distance={0}
1173+
>
1174+
<GlTooltip placement="top" distance={7}>
11691175
<button
11701176
type="button"
11711177
className="action-button"
@@ -1177,64 +1183,56 @@ export function GraphWrapper({
11771183
aria-hidden="true"
11781184
></span>
11791185
</button>
1180-
<MenuList slot="content" id="create-branch">
1181-
<MenuLabel>Create branch options</MenuLabel>
1182-
<MenuItem>
1183-
<a href={createCommandLink(Commands.GitCommandsBranchCreate)}>
1184-
Create Branch...
1185-
</a>
1186-
</MenuItem>
1187-
<MenuItem>
1188-
<a
1189-
href={createCommandLink(Commands.GitCommandsBranch, {
1190-
args: {
1191-
command: 'branch',
1192-
confirm: false,
1193-
state: { flags: [], reference: branch, subcommand: 'create' },
1194-
} satisfies BranchGitCommandArgs,
1195-
})}
1196-
>
1197-
Create Branch from <i>{branchName}</i>
1198-
</a>
1199-
</MenuItem>
1200-
<MenuItem>
1201-
<a
1202-
href={createCommandLink(Commands.GitCommandsBranch, {
1203-
args: {
1204-
command: 'branch',
1205-
confirm: false,
1206-
state: {
1207-
flags: ['--switch'],
1208-
reference: branch,
1209-
subcommand: 'create',
1210-
},
1211-
} satisfies BranchGitCommandArgs,
1212-
})}
1213-
>
1214-
Create from <i>{branchName}</i> & Switch to Branch
1215-
</a>
1216-
</MenuItem>
1217-
<MenuItem>
1218-
<a
1219-
href={createCommandLink(Commands.GitCommandsBranch, {
1220-
args: {
1221-
state: {
1222-
subcommand: 'create',
1223-
flags: ['--worktree'],
1224-
reference: branch,
1225-
},
1226-
command: 'branch',
1227-
confirm: false,
1228-
} satisfies BranchGitCommandArgs,
1229-
})}
1230-
>
1231-
Create Branch from <i>{branchName}</i> in New Worktree
1232-
</a>
1233-
</MenuItem>
1234-
</MenuList>
1235-
</PopMenu>
1236-
<span slot="content">Create branch options</span>
1237-
</GlTooltip>
1186+
<span slot="content">Create branch options</span>
1187+
</GlTooltip>
1188+
<div slot="content">
1189+
<MenuLabel>Create branch options</MenuLabel>
1190+
<MenuItem href={createCommandLink(Commands.GitCommandsBranchCreate)}>
1191+
Create Branch...
1192+
</MenuItem>
1193+
<MenuItem
1194+
href={createCommandLink(Commands.GitCommandsBranch, {
1195+
args: {
1196+
command: 'branch',
1197+
confirm: false,
1198+
state: { flags: [], reference: branch, subcommand: 'create' },
1199+
} satisfies BranchGitCommandArgs,
1200+
})}
1201+
>
1202+
Create Branch from <i>{branchName}</i>
1203+
</MenuItem>
1204+
<MenuItem
1205+
href={createCommandLink(Commands.GitCommandsBranch, {
1206+
args: {
1207+
command: 'branch',
1208+
confirm: false,
1209+
state: {
1210+
flags: ['--switch'],
1211+
reference: branch,
1212+
subcommand: 'create',
1213+
},
1214+
} satisfies BranchGitCommandArgs,
1215+
})}
1216+
>
1217+
Create from <i>{branchName}</i> & Switch to Branch
1218+
</MenuItem>
1219+
<MenuItem
1220+
href={createCommandLink(Commands.GitCommandsBranch, {
1221+
args: {
1222+
state: {
1223+
subcommand: 'create',
1224+
flags: ['--worktree'],
1225+
reference: branch,
1226+
},
1227+
command: 'branch',
1228+
confirm: false,
1229+
} satisfies BranchGitCommandArgs,
1230+
})}
1231+
>
1232+
Create Branch from <i>{branchName}</i> in New Worktree
1233+
</MenuItem>
1234+
</div>
1235+
</GlPopover>
12381236
</span>
12391237
<GlTooltip placement="bottom">
12401238
<a

src/webviews/apps/plus/graph/graph.scss

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1197,14 +1197,6 @@ gl-feature-gate gl-feature-badge {
11971197
width: 1px;
11981198
}
11991199

1200-
menu-list#create-branch {
1201-
menu-item > a {
1202-
display: block;
1203-
color: var(--vscode-foreground);
1204-
text-decoration: none;
1205-
}
1206-
}
1207-
12081200
#opts-popover {
12091201
font-size: var(--vscode-font-size);
12101202
font-family: var(--vscode-font-family);

0 commit comments

Comments
 (0)