diff --git a/src/vs/workbench/contrib/void/browser/react/src/void-command-bar-tsx/VoidCommandBar.tsx b/src/vs/workbench/contrib/void/browser/react/src/void-command-bar-tsx/VoidCommandBar.tsx index 97806775..a319e0b9 100644 --- a/src/vs/workbench/contrib/void/browser/react/src/void-command-bar-tsx/VoidCommandBar.tsx +++ b/src/vs/workbench/contrib/void/browser/react/src/void-command-bar-tsx/VoidCommandBar.tsx @@ -132,9 +132,8 @@ const VoidCommandBar = ({ uri, editor }: { uri: URI | null, editor: ICodeEditor - if (sortedCommandBarURIs.length === 0) return null // if there are absolutely no changes - - const navPanel =
setIsFocused(true)} onBlur={() => setIsFocused(false)} @@ -192,7 +191,7 @@ const VoidCommandBar = ({ uri, editor }: { uri: URI | null, editor: ICodeEditor
- + // accept/reject if current URI has changes const onAcceptAll = () => { if (!uri) return editCodeService.acceptOrRejectAllDiffAreas({ uri, behavior: 'accept', removeCtrlKs: false, _addToHistory: true }) @@ -238,8 +237,8 @@ const VoidCommandBar = ({ uri, editor }: { uri: URI | null, editor: ICodeEditor - return <> + return
{navPanel} {acceptRejectButtons} - +
} diff --git a/src/vs/workbench/contrib/void/browser/voidCommandBarService.ts b/src/vs/workbench/contrib/void/browser/voidCommandBarService.ts index 479cf8ac..091d87de 100644 --- a/src/vs/workbench/contrib/void/browser/voidCommandBarService.ts +++ b/src/vs/workbench/contrib/void/browser/voidCommandBarService.ts @@ -242,7 +242,7 @@ export class VoidCommandBarService extends Disposable implements IVoidCommandBar return sortedDiffIds; } - _getDiffZoneChanges(currentDiffZones: Iterable, oldDiffZones: Iterable) { + _getDiffZoneChanges(oldDiffZones: Iterable, currentDiffZones: Iterable) { // Find the added or deleted diffZones by comparing diffareaids const addedDiffZoneIds = new Set(); const deletedDiffZoneIds = new Set(); @@ -375,18 +375,19 @@ class AcceptRejectAllFloatingWidget extends Widget implements IOverlayWidget { // Mount command bar using mountVoidCommandBar this.instantiationService.invokeFunction(accessor => { + type Props = { uri: URI | null, editor: ICodeEditor } const uri = editor.getModel()?.uri || null - const res = mountVoidCommandBar(root, accessor, { uri, editor }) + const res = mountVoidCommandBar(root, accessor, { uri, editor } satisfies Props) if (!res) return const dispose = res.dispose - const rerender: (o: { uri: URI | null }) => void = res.rerender + const rerender: (o: Props) => void = res.rerender this._register(toDisposable(() => dispose?.())) this._register(editor.onDidChangeModel((model) => { const uri = model.newModelUrl - rerender({ uri }) + rerender({ uri, editor }) })) });