Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
- Fix relation having changed `data` but missing from `AuthoringState` when the source or target entity becomes deleted then restored back.
- Fix grouped relation (`RelationGroup` item) does not updating its `data` when changed by `EditorController`.
- Fix `ConnectionsMenu` displaying no links when there is only a single incoming/outgoing relation type. (by @cristianvasquez)
- Restore scroll position in `ConnectionsMenu` when going back to relation types from instances list.
- Exclude collapsed `DropdownMenu` and `UnifiedSearch` content from Tab-navigation.
- Exclude canvas elements from Tab-navigation unless the element is only one selected.
- Block canvas interacton (including Tab-navigation) when displaying a blocking modal overlay i.e. an overlay task or viewport-centered dialog.
Expand Down
8 changes: 6 additions & 2 deletions src/widgets/connectionsMenu/connectionList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
CLASS_NAME, LINK_COUNT_PER_PAGE,
} from './menuCommon';

export function ConnectionsList(props: {
export function ConnectionList(props: {
data: ConnectionsData;
filterKey: string;
sortMode: SortMode;
Expand All @@ -27,7 +27,7 @@ export function ConnectionsList(props: {
onExpandLink: (chunk: LinkDataChunk) => void;
onMoveToFilter?: (chunk: LinkDataChunk) => void;

scrolledListRef?: React.RefObject<HTMLUListElement | null>;
scrolledListRef?: React.RefObject<HTMLDivElement | null>;
}) {
const {
data, filterKey, sortMode, suggestions,
Expand Down Expand Up @@ -99,6 +99,10 @@ export function ConnectionsList(props: {
'reactodia-scrollable',
entries.length === 0 ? `${CLASS_NAME}__links-list-empty` : undefined
)}
ref={
/* For compatibility with React 19 typings */
scrolledListRef as React.RefObject<HTMLDivElement>
}
tabIndex={-1}
>
<FocusGroup>
Expand Down
6 changes: 3 additions & 3 deletions src/widgets/connectionsMenu/connectionsMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import {
ConnectionCount, ObjectsData, LinkDataChunk, ObjectPlacingMode,
CLASS_NAME, LINK_COUNT_PER_PAGE, LoadingSpinner,
} from './menuCommon';
import { ConnectionsList } from './connectionList';
import { ConnectionList } from './connectionList';
import { EntityList } from './entityList';

/**
Expand Down Expand Up @@ -258,7 +258,7 @@ class ConnectionsMenuInner extends React.Component<ConnectionsMenuInnerProps, Me

private suggestionCancellation = new AbortController();

private linksScrolledListRef = React.createRef<HTMLUListElement>();
private linksScrolledListRef = React.createRef<HTMLDivElement>();
private linksScrollPosition: number | undefined;

constructor(props: ConnectionsMenuInnerProps) {
Expand Down Expand Up @@ -598,7 +598,7 @@ class ConnectionsMenuInner extends React.Component<ConnectionsMenuInnerProps, Me
commands.trigger('findCapabilities', event);

return (
<ConnectionsList
<ConnectionList
data={connections}
suggestions={connectionSuggestions}
filterKey={connectionSearch.value}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import { describe, expect, it } from 'vitest';
import { render } from 'vitest-browser-react';

import type { LinkTypeModel } from '../../src/data/model';
import { ConnectionsList } from '../../src/widgets/connectionsMenu/connectionList';
import { ConnectionList } from '../../src/widgets/connectionsMenu/connectionList';
import { WorkspaceProvider, createWorkspace } from '../../src/workspace/workspaceProvider';
import { blockingDefaultLayout } from '../../src/layout-sync';

describe('ConnectionsList', () => {
describe('ConnectionList', () => {
it('renders the only connection link', async () => {
const link: LinkTypeModel = {id: 'urn:test:single-link', label: []};
const workspace = createWorkspace({
Expand All @@ -16,7 +16,7 @@ describe('ConnectionsList', () => {

await render(
<WorkspaceProvider workspace={workspace}>
<ConnectionsList
<ConnectionList
data={{
links: [link],
counts: new Map([
Expand Down
Loading