+ if (!isADiffZoneInAnyFile) { // no changes for the user to accept
+ return null
+ }
+
+
+ const buttonsHTML = <>
+ >
-
+
+ const descriptionHTML = isADiffZoneInThisFile ?
+ <>
{currUriIdx !== null && sortedCommandBarURIs.length &&
- File {currUriIdx + 1} of {sortedCommandBarURIs.length}
+ {`File ${currUriIdx + 1} of ${sortedCommandBarURIs.length}`}
}
- {currDiffIdx !== null && sortedDiffIds?.length &&
- Diff {currDiffIdx + 1} of {sortedDiffIds?.length ?? 0}
-
}
-
-
+ {/*
+ {!isAChangeInThisFile ?
+ `(No changes)`
+ : `Diff ${(currDiffIdx ?? 0) + 1} of ${sortedDiffIds.length}`
+ }
+
*/}
+ >
+ : <>
+ {`${sortedCommandBarURIs.length} file${sortedCommandBarURIs.length === 1 ? '' : 's'}`}
+ >
+
+
// accept/reject if current URI has changes
@@ -276,13 +274,48 @@ const VoidCommandBar = ({ uri, editor, onChangeHeight }: VoidCommandBarProps) =>
- return
+ // const closeCommandBar = useCallback(() => {
+ // commandService.executeCommand('void.hideCommandBar');
+ // }, [commandService]);
+
+ // const hideButton =
+
+ // const actionButtons = currUriHasChanges && (
+ //
+ // {acceptAllButton}
+ // {rejectAllButton}
+ // {hideButton}
+ //
+ // );
+
+
+ // dummy container due to annoyances with VS Code mounting the widget
+ return
{currUriHasChanges && <>
{acceptAllButton}
{rejectAllButton}
>}
- {navPanel}
+
+
+ {buttonsHTML}
+
+
+ {descriptionHTML}
+
+
}
diff --git a/src/vs/workbench/contrib/void/browser/voidCommandBarService.ts b/src/vs/workbench/contrib/void/browser/voidCommandBarService.ts
index 28392bd5..2b01e37b 100644
--- a/src/vs/workbench/contrib/void/browser/voidCommandBarService.ts
+++ b/src/vs/workbench/contrib/void/browser/voidCommandBarService.ts
@@ -352,7 +352,6 @@ registerSingleton(IVoidCommandBarService, VoidCommandBarService, InstantiationTy
export type VoidCommandBarProps = {
uri: URI | null;
editor: ICodeEditor;
- onChangeHeight: (height: number) => void;
}
@@ -376,33 +375,17 @@ class AcceptRejectAllFloatingWidget extends Widget implements IOverlayWidget {
const { root } = dom.h('div@root');
// Style the container
+ // root.style.backgroundColor = 'rgb(248 113 113)';
+ root.style.height = '16rem'; // make a fixed size, and all contents go on the bottom right. this fixes annoying VS Code mounting issues
+ root.style.width = '16rem';
+ root.style.flexDirection = 'column';
+ root.style.justifyContent = 'flex-end';
+ root.style.alignItems = 'flex-end';
root.style.zIndex = '2';
root.style.padding = '4px';
- root.style.alignItems = 'center';
root.style.pointerEvents = 'none';
- // Mount command bar using mountVoidCommandBar
- // this.editor.getDomNode()?.appendChild(root)
-
- const onChangeHeight = (height: number) => {
- if (height === 0) return;
-
- this._height = height
- // editor.layoutOverlayWidget(this)
- // stupid hack because layoutOverlayWidget doesn't work
- editor.removeOverlayWidget(this)
- editor.addOverlayWidget(this)
- }
-
- // alternative to mount VoidCommandBar without the stupid widget
- // editor.getLayoutInfo()
- // this._register(
- // editor.onDidLayoutChange(e => {
- // // e.height
- // // e.width
- // })
- // )
-
-
+ root.style.display = 'flex';
+ root.style.overflow = 'hidden';
this._domNode = root;
@@ -412,14 +395,14 @@ class AcceptRejectAllFloatingWidget extends Widget implements IOverlayWidget {
const uri = editor.getModel()?.uri || null
- const res = mountVoidCommandBar(root, accessor, { uri, editor, onChangeHeight } satisfies VoidCommandBarProps)
+ const res = mountVoidCommandBar(root, accessor, { uri, editor } satisfies VoidCommandBarProps)
if (!res) return
this._register(toDisposable(() => res.dispose?.()))
this._register(editor.onDidChangeModel((model) => {
const uri = model.newModelUrl
- res.rerender({ uri, editor, onChangeHeight })
+ res.rerender({ uri, editor })
}))
});