Skip to content

Commit

Permalink
fix(Designer): Add Ctrl to our hotkeys bindings (#4678)
Browse files Browse the repository at this point in the history
* fix(designer): fix issue where scope nodes didn't get focused when they were jumped to

* small pr

---------

Co-authored-by: Travis Harris <travisharris@microsoft.com>
Co-authored-by: Travis Harris <hartra344@users.noreply.github.com>
  • Loading branch information
3 people committed Apr 23, 2024
1 parent 5676b12 commit 851c9b6
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion libs/designer-ui/src/lib/card/scopeCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export const ScopeCard: React.FC<ScopeCardProps> = ({
<Icon
className={css('panel-card-v2-badge', 'active', darkBackground && 'darkBackground')}
{...iconProps}
ariaLabel={`${title}: ${content}`}
aria-label={`${title}: ${content}`}
tabIndex={0}
/>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { DynamicCallStatus } from '@microsoft/designer-ui';
import type { SerializedParameter } from '../serializer';
import { constructInputValues } from '../serializer';
import { describe, vi, beforeEach, afterEach, beforeAll, afterAll, it, test, expect } from 'vitest';
Expand Down Expand Up @@ -213,7 +214,7 @@ describe('constructInputValues', () => {
const rootArrayWithComplexObjectOpenApiParametersBase = [
{
dynamicData: {
status: 2,
status: DynamicCallStatus.SUCCEEDED,
},
editor: 'combobox',
editorOptions: {
Expand Down
2 changes: 1 addition & 1 deletion libs/designer/src/lib/ui/CustomNodes/OperationCardNode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ const DefaultNode = ({ targetPosition = Position.Top, sourcePosition = Position.
const resubmitClick = useCallback(() => {
WorkflowService().resubmitWorkflow?.(runInstance?.name ?? '', [id]);
}, [runInstance, id]);
const ref = useHotkeys('meta+c', copyClick, { preventDefault: true });
const ref = useHotkeys(['meta+c', 'ctrl+c'], copyClick, { preventDefault: true });
const contextMenuItems: JSX.Element[] = useMemo(
() => [
<DeleteMenuItem key={'delete'} onClick={deleteClick} showKey />,
Expand Down
2 changes: 1 addition & 1 deletion libs/designer/src/lib/ui/CustomNodes/ScopeCardNode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ const ScopeCardNode = ({ data, targetPosition = Position.Top, sourcePosition = P
WorkflowService().resubmitWorkflow?.(runInstance?.name ?? '', [id]);
}, [runInstance, id]);

const ref = useHotkeys('meta+c', copyClick, { preventDefault: true });
const ref = useHotkeys(['meta+c', 'ctrl+c'], copyClick, { preventDefault: true });
const contextMenuItems: JSX.Element[] = useMemo(
() => [
<DeleteMenuItem key={'delete'} onClick={deleteClick} showKey />,
Expand Down
2 changes: 1 addition & 1 deletion libs/designer/src/lib/ui/connections/dropzone.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ export const DropZone: React.FC<DropZoneProps> = ({ graphId, parentId, childId,
}, [dispatch, graphId, parentId]);

const ref = useHotkeys(
'meta+v',
['meta+v', 'ctrl+v'],
async () => {
const copiedNode = await retrieveClipboardData();
const pasteEnabled = !!copiedNode;
Expand Down

0 comments on commit 851c9b6

Please sign in to comment.