diff --git a/src/vs/workbench/contrib/void/browser/react/src/void-editor-widgets-tsx/VoidCommandBar.tsx b/src/vs/workbench/contrib/void/browser/react/src/void-editor-widgets-tsx/VoidCommandBar.tsx index 5604749e..a4e961e3 100644 --- a/src/vs/workbench/contrib/void/browser/react/src/void-editor-widgets-tsx/VoidCommandBar.tsx +++ b/src/vs/workbench/contrib/void/browser/react/src/void-editor-widgets-tsx/VoidCommandBar.tsx @@ -33,16 +33,9 @@ export const VoidCommandBarMain = ({ uri, editor }: VoidCommandBarProps) => { } -const stepIdx = (currIdx: number | null, len: number, step: -1 | 1) => { - if (len === 0) return null - return ((currIdx ?? 0) + step + len) % len // for some reason, small negatives are kept negative. just add len to offset -} - - - -export const AcceptAllButtonWrapper = ({ text, onClick, className }: { text: string, onClick: () => void, className?: string }) => ( +export const AcceptAllButtonWrapper = ({ text, onClick, className, ...props }: { text: string, onClick: () => void, className?: string } & React.ButtonHTMLAttributes) => ( ) - -export const RejectAllButtonWrapper = ({ text, onClick, className }: { text: string, onClick: () => void, className?: string }) => ( +export const RejectAllButtonWrapper = ({ text, onClick, className, ...props }: { text: string, onClick: () => void, className?: string } & React.ButtonHTMLAttributes) => ( ) + export const VoidCommandBar = ({ uri, editor }: VoidCommandBarProps) => { const accessor = useAccessor() const editCodeService = accessor.get('IEditCodeService') @@ -189,14 +184,41 @@ export const VoidCommandBar = ({ uri, editor }: VoidCommandBarProps) => { const downKeybindLabel = editCodeService.processRawKeybindingText(_downKeybinding?.getLabel() || ''); const leftKeybindLabel = editCodeService.processRawKeybindingText(_leftKeybinding?.getLabel() || ''); const rightKeybindLabel = editCodeService.processRawKeybindingText(_rightKeybinding?.getLabel() || ''); - const acceptFileKeybindLabel = editCodeService.processRawKeybindingText(_acceptFileKeybinding?.getLabel() || ''); - const rejectFileKeybindLabel = editCodeService.processRawKeybindingText(_rejectFileKeybinding?.getLabel() || ''); - const acceptAllKeybindLabel = editCodeService.processRawKeybindingText(_acceptAllKeybinding?.getLabel() || ''); - const rejectAllKeybindLabel = editCodeService.processRawKeybindingText(_rejectAllKeybinding?.getLabel() || ''); + const acceptFileKeybindLabel = editCodeService.processRawKeybindingText(_acceptFileKeybinding?.getAriaLabel() || ''); + const rejectFileKeybindLabel = editCodeService.processRawKeybindingText(_rejectFileKeybinding?.getAriaLabel() || ''); + const acceptAllKeybindLabel = editCodeService.processRawKeybindingText(_acceptAllKeybinding?.getAriaLabel() || ''); + const rejectAllKeybindLabel = editCodeService.processRawKeybindingText(_rejectAllKeybinding?.getAriaLabel() || ''); if (!isADiffZoneInAnyFile) return null + // For pages without a current file index, show a simplified command bar + if (currFileIdx === null) { + return ( +
+
+
+ + {`${sortedCommandBarURIs.length} file${sortedCommandBarURIs.length === 1 ? '' : 's'} changed`} + +
+ +
+
+ ); + } + return (
@@ -207,11 +229,19 @@ export const VoidCommandBar = ({ uri, editor }: VoidCommandBarProps) => {
+ />
@@ -234,7 +264,7 @@ export const VoidCommandBar = ({ uri, editor }: VoidCommandBarProps) => { } }} data-tooltip-id="void-tooltip" - data-tooltip-content={`Previous diff ${upKeybindLabel ? `${upKeybindLabel}` : ''}`} + data-tooltip-content={`${upKeybindLabel ? `${upKeybindLabel}` : ''}`} data-tooltip-delay-show={500} > @@ -259,7 +289,7 @@ export const VoidCommandBar = ({ uri, editor }: VoidCommandBarProps) => { } }} data-tooltip-id="void-tooltip" - data-tooltip-content={`Next diff ${downKeybindLabel ? `${downKeybindLabel}` : ''}`} + data-tooltip-content={`${downKeybindLabel ? `${downKeybindLabel}` : ''}`} data-tooltip-delay-show={500} > @@ -281,7 +311,7 @@ export const VoidCommandBar = ({ uri, editor }: VoidCommandBarProps) => { } }} data-tooltip-id="void-tooltip" - data-tooltip-content={`Previous file ${leftKeybindLabel ? `${leftKeybindLabel}` : ''}`} + data-tooltip-content={`${leftKeybindLabel ? `${leftKeybindLabel}` : ''}`} data-tooltip-delay-show={500} > @@ -303,7 +333,7 @@ export const VoidCommandBar = ({ uri, editor }: VoidCommandBarProps) => { } }} data-tooltip-id="void-tooltip" - data-tooltip-content={`Next file ${rightKeybindLabel ? `${rightKeybindLabel}` : ''}`} + data-tooltip-content={`${rightKeybindLabel ? `${rightKeybindLabel}` : ''}`} data-tooltip-delay-show={500} > @@ -315,11 +345,19 @@ export const VoidCommandBar = ({ uri, editor }: VoidCommandBarProps) => { {showAcceptRejectAll && (