浏览代码

Fixes lack of remote button from breaking layout

Adds protection for undefined rows (seen in logs)
main
Eric Amodio 1年前
父节点
当前提交
73b07c4253
共有 4 个文件被更改,包括 11 次插入3 次删除
  1. +1
    -1
      src/plus/webviews/graph/graphWebview.ts
  2. +5
    -1
      src/webviews/apps/plus/graph/GraphWrapper.tsx
  3. +4
    -0
      src/webviews/apps/plus/graph/graph.scss
  4. +1
    -1
      src/webviews/apps/plus/graph/graph.tsx

+ 1
- 1
src/plus/webviews/graph/graphWebview.ts 查看文件

@ -1385,7 +1385,7 @@ export class GraphWebviewProvider implements WebviewProvider {
);
}
@debug()
@debug({ args: false })
private async notifyDidChangeRowsStats(graph: GitGraph) {
if (graph.rowsStats == null) return;

+ 5
- 1
src/webviews/apps/plus/graph/GraphWrapper.tsx 查看文件

@ -1048,7 +1048,11 @@ export function GraphWrapper({
return (
<>
<header className="titlebar graph-app__header">
<div className={`titlebar__row titlebar__row--wrap${allowed ? '' : ' disallowed'}`}>
<div
className={`titlebar__row titlebar__row--wrap${
!allowed ? ' disallowed' : repo && branchState?.provider?.url ? '' : ' no-remote-provider'
}`}
>
{repo && branchState?.provider?.url && (
<a
href={branchState.provider.url}

+ 4
- 0
src/webviews/apps/plus/graph/graph.scss 查看文件

@ -820,6 +820,10 @@ button:not([disabled]),
justify-content: start;
grid-template-columns: repeat(5, min-content) minmax(min-content, 1fr);
&.no-remote-provider {
grid-template-columns: repeat(4, min-content) minmax(min-content, 1fr);
}
&.disallowed {
grid-template-columns: repeat(1, min-content) minmax(min-content, 1fr);
}

+ 1
- 1
src/webviews/apps/plus/graph/graph.tsx 查看文件

@ -682,7 +682,7 @@ export class GraphApp extends App {
}
private onSelectionChanged(rows: GraphRow[]) {
const selection = rows.map(r => ({ id: r.sha, type: r.type as GitGraphRowType }));
const selection = rows.filter(r => r != null).map(r => ({ id: r.sha, type: r.type as GitGraphRowType }));
this.sendCommand(UpdateSelectionCommandType, {
selection: selection,
});

正在加载...
取消
保存