Skip to content

Commit 8e9fe23

Browse files
authored
fix(web_common): lineage styling and border colors (#5494)
1 parent 9fc6a2e commit 8e9fe23

File tree

6 files changed

+40
-26
lines changed

6 files changed

+40
-26
lines changed

web/common/src/components/Lineage/LineageColumnLevel/FactoryColumn.tsx

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -202,10 +202,22 @@ export function FactoryColumn<
202202
className="FactoryColumn__Information"
203203
info={description}
204204
>
205-
<DisplayColumName name={name} />
205+
<DisplayColumName
206+
name={name}
207+
className={cn(
208+
isTriggeredColumn &&
209+
'text-lineage-model-column-active-foreground',
210+
)}
211+
/>
206212
</Information>
207213
) : (
208-
<DisplayColumName name={name} />
214+
<DisplayColumName
215+
name={name}
216+
className={cn(
217+
isTriggeredColumn &&
218+
'text-lineage-model-column-active-foreground',
219+
)}
220+
/>
209221
)}
210222
</HorizontalContainer>
211223
</LoadingContainer>
@@ -214,7 +226,7 @@ export function FactoryColumn<
214226
<NodeBadge className="FactoryColumn__NodeBadge">{type}</NodeBadge>
215227
}
216228
className={cn(
217-
'FactoryColumn__Metadata relative overflow-visible group p-0',
229+
'FactoryColumn__Metadata relative overflow-visible group',
218230
isDisabledColumn && 'cursor-not-allowed',
219231
className,
220232
)}
@@ -240,8 +252,8 @@ export function FactoryColumn<
240252
id={id}
241253
nodeId={nodeId}
242254
className={cn(
243-
'border-t border-lineage-divider first:border-t-0 px-2',
244-
isTriggeredColumn && 'bg-lineage-model-column-active',
255+
'border-t border-lineage-divider first:border-t-0',
256+
isTriggeredColumn && 'bg-lineage-model-column-active-background',
245257
)}
246258
>
247259
{renderColumn()}
@@ -252,11 +264,20 @@ export function FactoryColumn<
252264
})
253265
}
254266

255-
function DisplayColumName({ name }: { name: string }) {
267+
function DisplayColumName({
268+
name,
269+
className,
270+
}: {
271+
name: string
272+
className?: string
273+
}) {
256274
return (
257275
<span
258276
title={name}
259-
className="text-xs font-mono font-semibold w-full truncate"
277+
className={cn(
278+
'text-xs font-mono font-semibold w-full truncate',
279+
className,
280+
)}
260281
>
261282
{name}
262283
</span>

web/common/src/components/Lineage/LineageControlButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export function LineageControlButton({
2121
side="left"
2222
sideOffset={8}
2323
delayDuration={0}
24-
className="px-2 py-1 text-xs rounded-sm font-semibold bg-lineage-control-button-tooltip-background text-lineage-control-button-tooltip-foreground"
24+
className="px-2 py-1 text-xs rounded-sm font-semibold bg-lineage-control-button-tooltip-background text-lineage-control-button-tooltip-foreground border-2 border-lineage-control-button-tooltip-border"
2525
trigger={
2626
<div data-component="LineageControlButton">
2727
<ControlButton

web/common/src/components/Lineage/LineageLayoutBase.tsx

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -275,21 +275,6 @@ export function LineageLayoutBase<
275275
updateZoom(viewportZoom)
276276
}, [updateZoom, viewportZoom])
277277

278-
React.useEffect(() => {
279-
if (currentNode?.id) {
280-
setSelectedNodeId(currentNode.id)
281-
} else {
282-
const node = nodes.length > 0 ? nodes[nodes.length - 1] : null
283-
284-
if (node) {
285-
setCenter(node.position.x, node.position.y, {
286-
zoom: zoom,
287-
duration: 0,
288-
})
289-
}
290-
}
291-
}, [currentNode?.id, setSelectedNodeId, setCenter])
292-
293278
return (
294279
<ReactFlow<
295280
LineageNode<TNodeData, TNodeID>,
@@ -327,6 +312,7 @@ export function LineageLayoutBase<
327312
showInteractive={false}
328313
showFitView={false}
329314
position="top-right"
315+
className="m-1 border-2 border-lineage-control-border rounded-sm overflow-hidden"
330316
>
331317
{currentNode && (
332318
<LineageControlButton

web/common/src/components/Lineage/node/NodePort.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export const NodePort = React.memo(function NodePort<
5353
leftId={leftId}
5454
rightId={rightId}
5555
className={cn(
56-
'relative overflow-visible group p-0 bg-lineage-node-port-background h-auto',
56+
'relative overflow-visible group bg-lineage-node-port-background h-auto',
5757
className,
5858
)}
5959
handleClassName="absolute"

web/common/src/components/Lineage/stories/ModelLineage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ export const ModelLineage = ({
338338
} else {
339339
handleReset()
340340
}
341-
}, [handleReset, selectedModelName])
341+
}, [handleReset, selectedModelName, nodesMap])
342342

343343
// Cleanup worker on unmount
344344
React.useEffect(() => () => cleanupLayoutWorker(), [])

web/common/tailwind.lineage.config.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export default {
88
divider: 'var(--color-lineage-divider)',
99
border: 'var(--color-lineage-border)',
1010
control: {
11+
border: 'var(--color-lineage-control-border)',
1112
background: {
1213
DEFAULT: 'var(--color-lineage-control-background)',
1314
hover: 'var(--color-lineage-control-background-hover)',
@@ -18,6 +19,7 @@ export default {
1819
},
1920
button: {
2021
tooltip: {
22+
border: 'var(--color-lineage-control-button-tooltip-border)',
2123
background:
2224
'var(--color-lineage-control-button-tooltip-background)',
2325
foreground:
@@ -68,6 +70,12 @@ export default {
6870
},
6971
model: {
7072
column: {
73+
active: {
74+
background:
75+
'var(--color-lineage-model-column-active-background)',
76+
foreground:
77+
'var(--color-lineage-model-column-active-foreground)',
78+
},
7179
source: {
7280
background:
7381
'var(--color-lineage-model-column-source-background)',
@@ -81,7 +89,6 @@ export default {
8189
'var(--color-lineage-model-column-error-background)',
8290
icon: 'var(--color-lineage-model-column-error-icon)',
8391
},
84-
active: 'var(--color-lineage-model-column-active)',
8592
icon: {
8693
DEFAULT: 'var(--color-lineage-model-column-icon)',
8794
active: 'var(--color-lineage-model-column-icon-active)',

0 commit comments

Comments
 (0)