fix(kafka): restore message tab scrolling

This commit is contained in:
Lan-zk authored and GitHub committed 2026-08-15 14:41:42 +08:00
1 parent cd6f99fbc5
commit 356127f0e3
2 files changed
+30

No files matched your search

@@ -156,9 +156,23 @@ watch(selectedTopic, (topic) => emit("topicSelected", topic));
}
.kafka-messages-panel {
height: 100%;
min-height: 0;
box-sizing: border-box;
overflow: hidden;
padding: 16px;
}
.panel-toolbar {
flex-shrink: 0;
}
.kafka-messages-content {
flex: 1;
min-height: 0;
overflow-y: auto;
}
.kafka-topic-section,
.partition-overview {
padding: 14px;
@@ -152,4 +152,20 @@ describe("KafkaMessagesPanel", () => {
expect(panel.querySelector('[data-testid="message-browser"]')).not.toBeNull();
warning.mockRestore();
});
it("keeps the topic toolbar outside the scrolling content area (issue #6267)", async () => {
const panel = await mountPanel();
const panelRoot = panel.querySelector<HTMLElement>(".kafka-messages-panel");
const toolbar = panelRoot?.querySelector<HTMLElement>(".panel-toolbar");
const content = panelRoot?.querySelector<HTMLElement>(".kafka-messages-content");
expect(panelRoot).not.toBeNull();
expect(toolbar).not.toBeNull();
expect(content).not.toBeNull();
// The toolbar must not live inside the scroll container so topic refresh
// stays reachable after scrolling; it must also precede it in layout order.
expect(content!.contains(toolbar!)).toBe(false);
const children = [...panelRoot!.children].map((child) => child.className);
expect(children.indexOf("panel-toolbar")).toBeLessThan(children.indexOf("kafka-messages-content"));
});
});