From 27c6bcb3b5a433bb6fb86f1936fc21bebe201096 Mon Sep 17 00:00:00 2001 From: Martin Mark Date: Mon, 23 Dec 2024 12:39:38 -0500 Subject: [PATCH 1/6] Update font-size --- .../Home/Browse3/pages/CallPage/ObjectViewerSection.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/CallPage/ObjectViewerSection.tsx b/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/CallPage/ObjectViewerSection.tsx index d02a2e881ca..6538faa5534 100644 --- a/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/CallPage/ObjectViewerSection.tsx +++ b/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/CallPage/ObjectViewerSection.tsx @@ -44,7 +44,7 @@ TitleRow.displayName = 'S.TitleRow'; const Title = styled.div` flex: 1 1 auto; font-family: Source Sans Pro; - font-size: 16px; + font-size: 14px; font-weight: 600; line-height: 32px; letter-spacing: 0px; From b3ab627d716764158732abb230b47832f58c4786 Mon Sep 17 00:00:00 2001 From: Martin Mark Date: Mon, 23 Dec 2024 13:01:28 -0500 Subject: [PATCH 2/6] Simplified ObjectViewer - size and spacing tweaks --- .../Browse3/pages/CallPage/CallDetails.tsx | 4 +- .../pages/CallPage/ObjectViewerSection.tsx | 51 +++++++++++-------- 2 files changed, 32 insertions(+), 23 deletions(-) diff --git a/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/CallPage/CallDetails.tsx b/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/CallPage/CallDetails.tsx index 03519960bf3..ac6afe35a6b 100644 --- a/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/CallPage/CallDetails.tsx +++ b/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/CallPage/CallDetails.tsx @@ -133,7 +133,7 @@ export const CallDetails: FC<{ sx={{ flex: '0 0 auto', maxHeight: `calc(100% - ${HEADER_HEIGHT_BUFFER}px)`, - p: 2, + padding: '4px 16px', }}> @@ -146,7 +146,7 @@ export const CallDetails: FC<{ maxHeight: `calc(100% - ${ multipleChildCallOpRefs.length > 0 ? HEADER_HEIGHT_BUFFER : 0 }px)`, - p: 2, + padding: '4px 16px', }}> {'traceback' in excInfo ? (
diff --git a/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/CallPage/ObjectViewerSection.tsx b/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/CallPage/ObjectViewerSection.tsx index 6538faa5534..a0d9b35a672 100644 --- a/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/CallPage/ObjectViewerSection.tsx +++ b/weave-js/src/components/PagePanelComponents/Home/Browse3/pages/CallPage/ObjectViewerSection.tsx @@ -22,6 +22,7 @@ import {WeaveCHTable, WeaveCHTableSourceRefContext} from './DataTableView'; import {ObjectViewer} from './ObjectViewer'; import {getValueType, traverse} from './traverse'; import {ValueView} from './ValueView'; +import {Icon} from '../../../../../Icon'; const EXPANDED_IDS_LENGTH = 200; @@ -49,6 +50,13 @@ const Title = styled.div` line-height: 32px; letter-spacing: 0px; text-align: left; + display: flex; + align-items: center; + cursor: pointer; + + &:hover { + opacity: 0.8; + } `; Title.displayName = 'S.Title'; @@ -172,6 +180,14 @@ const ObjectViewerSectionNonEmpty = ({ } }; + const onToggleExpansion = () => { + if (mode === 'expanded') { + onClickCollapsed(); + } else { + onClickExpanded(); + } + }; + // On first render and when data changes, recompute expansion state useEffect(() => { const isSimple = isSimpleData(data); @@ -187,21 +203,23 @@ const ObjectViewerSectionNonEmpty = ({ return ( - {title} -