Skip to content

Commit

Permalink
update expand to 200 ids (#2627)
Browse files Browse the repository at this point in the history
  • Loading branch information
jwlee64 authored Oct 10, 2024
1 parent 1e3f239 commit beae64e
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ import {isCustomWeaveTypePayload} from '../../typeViews/customWeaveType.types';
import {CustomWeaveTypeDispatcher} from '../../typeViews/CustomWeaveTypeDispatcher';
import {OBJECT_ATTR_EDGE_NAME} from '../wfReactInterface/constants';
import {WeaveCHTable, WeaveCHTableSourceRefContext} from './DataTableView';
import {ARRAY_TRUNCATION_LENGTH, ObjectViewer} from './ObjectViewer';
import {ObjectViewer} from './ObjectViewer';
import {getValueType, traverse} from './traverse';
import {ValueView} from './ValueView';

const EXPANDED_IDS_LENGTH = 200;

type Data = Record<string, any>;

type ObjectViewerSectionProps = {
Expand Down Expand Up @@ -156,9 +158,9 @@ const ObjectViewerSectionNonEmpty = ({
setTreeExpanded(true);
}
setMode('expanded');
if (getGroupIds().length > ARRAY_TRUNCATION_LENGTH) {
if (getGroupIds().length > EXPANDED_IDS_LENGTH) {
setExpandedIds(
getGroupIds().slice(0, expandedIds.length + ARRAY_TRUNCATION_LENGTH)
getGroupIds().slice(0, expandedIds.length + EXPANDED_IDS_LENGTH)
);
} else {
setExpandedIds(getGroupIds());
Expand Down Expand Up @@ -193,7 +195,7 @@ const ObjectViewerSectionNonEmpty = ({
icon="expand-uncollapse"
active={mode === 'expanded'}
onClick={onClickExpanded}
tooltip={`Expand next ${ARRAY_TRUNCATION_LENGTH} rows`}
tooltip={`Expand next ${EXPANDED_IDS_LENGTH} rows`}
/>
<Button
variant="quiet"
Expand Down

0 comments on commit beae64e

Please sign in to comment.