Skip to content

Commit 96e923f

Browse files
authored
Record page styling update (#1300)
- More consistent font sizes and weights - More distinguished collapsible UI elements - Group all collapsible sections to bottom of category - Larger navigation panel - Updated "active section" highlighting in navigation panel - Updated click behavior for navigation panel links - Remove checkboxes from navigation panel - Remove enumeration from categories - Fixes to "scroll anchor" behavior (preventing page jumps as sections load) - Fix to linking between transcription summary and expression graphs sections
1 parent eab6fe7 commit 96e923f

File tree

37 files changed

+689
-681
lines changed

37 files changed

+689
-681
lines changed

packages/libs/coreui/src/components/Mesa/Ui/DataRow.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ class DataRow extends React.PureComponent {
110110
return (
111111
<>
112112
<tr
113+
id={getRowId ? 'row_id_' + getRowId(row) : undefined}
113114
className={className
114115
.concat(showChildRow ? ' _childIsExpanded' : '')
115116
.concat(hasExpansionColumn ? ' _isExpandable' : '')}

packages/libs/coreui/src/components/Mesa/Ui/ExpansionCell.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@ type Props = {
1111
heading: boolean;
1212
};
1313

14+
const EMPTY_ARRAY: Props['expandedRows'] = [];
15+
1416
export default function ExpansionCell({
1517
rows,
1618
row,
1719
onExpandedRowsChange,
18-
expandedRows,
20+
expandedRows = EMPTY_ARRAY,
1921
getRowId,
2022
inert,
2123
heading,

packages/libs/eda/src/lib/workspace/EDAWorkspace.scss

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@
1212
font-size: 0.9em;
1313
}
1414

15-
.wdk-RecordSidebarToggle,
16-
.wdk-RecordSidebar {
17-
background-color: #eaeaea;
18-
}
19-
2015
.wdk-RecordActions,
2116
.wdk-RecordHeading {
2217
display: none;

packages/libs/wdk-client/src/Actions/RecordActions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ export type SectionVisibilityAction = {
173173
type: typeof SECTION_VISIBILITY;
174174
payload: {
175175
name: string;
176-
isVisible: boolean;
176+
isVisible?: boolean;
177177
};
178178
};
179179

packages/libs/wdk-client/src/Components/CheckboxTree/CategoriesCheckboxTree.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { makeSearchHelpText } from '../../Utils/SearchUtils';
1212
import CheckboxTree, {
1313
LinksPosition,
1414
CheckboxTreeStyleSpec,
15+
CheckboxTreeProps,
1516
} from '@veupathdb/coreui/lib/components/inputs/checkboxes/CheckboxTree/CheckboxTree';
1617
import {
1718
getFilteredNodeChildren,
@@ -20,7 +21,7 @@ import {
2021

2122
const sharedCheckboxTreeContainerStyleSpec: React.CSSProperties = {
2223
position: 'relative',
23-
maxHeight: '75vh',
24+
maxHeight: 'calc(100vh - 2.5em - var(--page-offset-top, 0px))',
2425
overflow: 'hidden',
2526
display: 'flex',
2627
flexDirection: 'column',
@@ -67,6 +68,7 @@ type Props = {
6768
* If omitted, the container uses the sharedCheckboxTreeContainerStyleSpec default styles
6869
*/
6970
type?: 'headerMenu' | 'searchPane';
71+
additionalFilters?: CheckboxTreeProps<unknown>['additionalFilters'];
7072
};
7173

7274
let CategoriesCheckboxTree: FunctionComponent<Props> = (props) => {
@@ -98,6 +100,7 @@ let CategoriesCheckboxTree: FunctionComponent<Props> = (props) => {
98100
containerClassName = '',
99101
styleOverrides = {},
100102
type,
103+
additionalFilters,
101104
} = props;
102105

103106
if (tree.children.length == 0) {
@@ -119,6 +122,7 @@ let CategoriesCheckboxTree: FunctionComponent<Props> = (props) => {
119122
? {
120123
...sharedCheckboxTreeContainerStyleSpec,
121124
minWidth: '18.75em',
125+
maxHeight: 'none',
122126
}
123127
: {
124128
...sharedCheckboxTreeContainerStyleSpec,
@@ -164,6 +168,7 @@ let CategoriesCheckboxTree: FunctionComponent<Props> = (props) => {
164168
onExpansionChange={onUiChange}
165169
onSearchTermChange={onSearchTermChange}
166170
styleOverrides={styleOverrides}
171+
additionalFilters={additionalFilters}
167172
/>
168173
</div>
169174
</div>

packages/libs/wdk-client/src/Components/Display/CollapsibleSection.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
cursor: pointer;
33
position: relative;
44
display: flex;
5-
align-items: flex-start;
5+
align-items: center;
66
}
77

88
.wdk-CollapsibleSectionHeader:before {

packages/libs/wdk-client/src/Components/Display/CollapsibleSection.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@ function CollapsibleSection(props: Props) {
5757

5858
const handleCollapsedChange = useCallback(
5959
(event: React.MouseEvent<HTMLElement>) => {
60-
event.currentTarget.blur();
61-
event.stopPropagation();
6260
onCollapsedChange(!isCollapsed);
6361
},
6462
[isCollapsed, onCollapsedChange]

packages/libs/wdk-client/src/Core/routes.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ const routes: RouteEntry[] = [
142142

143143
{
144144
path: '/record/:recordClass/:primaryKey+',
145+
rootClassNameModifier: 'record',
145146
component: (
146147
props: RouteComponentProps<{ recordClass: string; primaryKey: string }>
147148
) => <RecordController {...props.match.params} />,

packages/libs/wdk-client/src/StoreModules/RecordStoreModule.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,10 @@ export function reduce(state: State = {} as State, action: Action): State {
160160
case SECTION_VISIBILITY: {
161161
let collapsedSections = updateList(
162162
action.payload.name,
163-
!action.payload.isVisible,
163+
!(
164+
action.payload.isVisible ??
165+
state.collapsedSections.includes(action.payload.name)
166+
),
164167
state.collapsedSections
165168
);
166169
return { ...state, collapsedSections };

packages/libs/wdk-client/src/Utils/CategoryUtils.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,7 @@ function makeComparator(
408408
questions: Dict<Question>
409409
) {
410410
return composeComparators(
411+
compareByTargetType,
411412
compareByChildren,
412413
compareBySortNumber,
413414
makeCompareBySortName(recordClasses, questions)
@@ -427,6 +428,14 @@ function composeComparators(...comparators: NodeComparator[]): NodeComparator {
427428
};
428429
}
429430

431+
function compareByTargetType(nodeA: CategoryTreeNode, nodeB: CategoryTreeNode) {
432+
const nodeATargetType = getTargetType(nodeA);
433+
const nodeBTargetType = getTargetType(nodeB);
434+
if (nodeATargetType === 'attribute' && nodeBTargetType === 'table') return -1;
435+
if (nodeATargetType === 'table' && nodeBTargetType === 'attribute') return 1;
436+
return 0;
437+
}
438+
430439
/**
431440
* Set subsections before leaves (tables,attributes or searches)
432441
* This makes the current record page section numbering system work

0 commit comments

Comments
 (0)