Skip to content

Commit 15c1414

Browse files
committed
Some visualization improvements
1 parent 24c3d16 commit 15c1414

3 files changed

Lines changed: 36 additions & 4 deletions

File tree

frontend/src/components/pages/rp-connect/onboarding/add-secrets-dialog.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ export const AddSecretsDialog = ({
6060
</Alert>
6161
)}
6262
<QuickAddSecrets
63-
cardVariant="outlined"
6463
enableNewSecrets
6564
existingSecrets={existingSecrets}
65+
inline
6666
onError={handleError}
6767
onSecretsCreated={handleSecretsCreated}
6868
onUpdateEditorContent={onUpdateEditorContent}

frontend/src/components/pages/rp-connect/pipeline/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1030,8 +1030,8 @@ export default function PipelinePage() {
10301030
one.
10311031
</DialogDescription>
10321032
</DialogHeader>
1033-
<DialogBody>
1034-
<AddTopicStep className="border" hideTitle ref={topicStepRef} />
1033+
<DialogBody padding="none">
1034+
<AddTopicStep hideTitle ref={topicStepRef} />
10351035
</DialogBody>
10361036
<DialogFooter>
10371037
<Button onClick={topicDialog.close} variant="secondary-ghost">

frontend/src/components/pages/rp-connect/utils/pipeline-flow-parser.ts

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,6 +596,38 @@ const ROW_GAP = 8;
596596
const SECTION_GAP = 16;
597597
const ROOT_X = 8;
598598

599+
// Per-row addition when a leaf renders an extra chip / badge below its label
600+
// (label badge, topic list, missing-topic chip, missing-sasl chip). Must stay
601+
// in sync with TreeLeafNode's `gap-1.5` (6px) + chip/badge height (~24px).
602+
const LEAF_EXTRA_ROW_H = 28;
603+
// `mt-2` between the label row and the first extra row.
604+
const LEAF_EXTRA_TOP_GAP = 8;
605+
606+
function countLeafExtraRows(node: PipelineFlowNode): number {
607+
let n = 0;
608+
if (node.labelText) {
609+
n++;
610+
}
611+
if (node.topics && node.topics.length > 0) {
612+
n++;
613+
}
614+
if (node.missingTopic) {
615+
n++;
616+
}
617+
if (node.missingSasl) {
618+
n++;
619+
}
620+
return n;
621+
}
622+
623+
function leafHeight(node: PipelineFlowNode): number {
624+
const extras = countLeafExtraRows(node);
625+
if (extras === 0) {
626+
return NODE_H_LEAF;
627+
}
628+
return NODE_H_LEAF + LEAF_EXTRA_TOP_GAP + extras * LEAF_EXTRA_ROW_H;
629+
}
630+
599631
const NODE_TYPE_MAP: Record<FlowNodeKind, string> = {
600632
section: 'treeSection',
601633
group: 'treeGroup',
@@ -707,7 +739,7 @@ function layoutDfs(params: DfsParams, state: LayoutState): void {
707739
}
708740

709741
if (!hiddenByParent) {
710-
const nodeH = node.kind === 'leaf' ? NODE_H_LEAF : NODE_H_DEFAULT;
742+
const nodeH = node.kind === 'leaf' ? leafHeight(node) : NODE_H_DEFAULT;
711743
state.y += nodeH + ROW_GAP;
712744
}
713745

0 commit comments

Comments
 (0)