Last minute tree changes

Summary:
1. Greater spacing between levels
2. Align children when one has chevron and another doesnt
3. Allow searching of inline attribute values

Reviewed By: lblasa

Differential Revision: D41955235

fbshipit-source-id: aa6bce71810a32cd218db790287aaaf506df75b7
This commit is contained in:
Luke De Feo
2022-12-12 09:17:03 -08:00
committed by Facebook GitHub Bot
parent 6d192bc020
commit 5043e5292f

View File

@@ -200,13 +200,15 @@ const TreeAttributeContainer = styled(Text)({
}); });
function InlineAttributes({attributes}: {attributes: Record<string, string>}) { function InlineAttributes({attributes}: {attributes: Record<string, string>}) {
const highlightManager: HighlightManager = useHighlighter();
return ( return (
<> <>
{Object.entries(attributes ?? {}).map(([key, value]) => ( {Object.entries(attributes ?? {}).map(([key, value]) => (
<> <>
<TreeAttributeContainer key={key}> <TreeAttributeContainer key={key}>
<span style={{color: theme.warningColor}}>{key}</span> <span style={{color: theme.warningColor}}>{key}</span>
<span>={value}</span> <span>={highlightManager.render(value)}</span>
</TreeAttributeContainer> </TreeAttributeContainer>
</> </>
))} ))}
@@ -255,7 +257,7 @@ function ExpandedIconOrSpace(props: {
</div> </div>
); );
} else { } else {
return <div style={{width: '12px'}}></div>; return <div style={{width: '16px'}}></div>;
} }
} }
@@ -276,7 +278,7 @@ const DecorationImage = styled.img({
width: 12, width: 12,
}); });
const renderDepthOffset = 4; const renderDepthOffset = 8;
const ContextMenu: React.FC<{ const ContextMenu: React.FC<{
nodes: Map<Id, UINode>; nodes: Map<Id, UINode>;