Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

fix(data-warehouse): keep schema more-menu open during auto-refresh (#73274)

Tom Owers3a705db4902f
diff --git a/products/data_warehouse/frontend/scenes/SourceScene/tabs/SchemasTab.tsx b/products/data_warehouse/frontend/scenes/SourceScene/tabs/SchemasTab.tsx
index 93122ec94af8..622ae9594943 100644
--- a/products/data_warehouse/frontend/scenes/SourceScene/tabs/SchemasTab.tsx
+++ b/products/data_warehouse/frontend/scenes/SourceScene/tabs/SchemasTab.tsx
@@ -644,8 +644,16 @@ function SchemaBulkActions({
schemas: readonly ExternalDataSourceSchema[]
clearSelection: () => void
}): JSX.Element {
- const { bulkEnable, bulkDisable, bulkSetFrequency, bulkSyncNow, bulkResync, bulkDeleteData } =
- useActions(sourceSettingsLogic)
+ const {
+ bulkEnable,
+ bulkDisable,
+ bulkSetFrequency,
+ bulkSyncNow,
+ bulkResync,
+ bulkDeleteData,
+ pausePolling,
+ resumePolling,
+ } = useActions(sourceSettingsLogic)
const { bulkEnableLoading } = useValues(sourceSettingsLogic)
// Wrap every action so the selection clears once it's been kicked off.
@@ -726,6 +734,11 @@ function SchemaBulkActions({
</LemonButton>
<More
size="small"
+ // Pause the 5s source refresh while the menu is open — a poll re-renders the table
+ // and dismisses the menu out from under the user.
+ dropdown={{
+ onVisibilityChange: (visible) => (visible ? pausePolling() : resumePolling()),
+ }}
overlay={
<>
<LemonButton
@@ -792,11 +805,18 @@ function SchemaRowMore({
cancelSchema: (schema: ExternalDataSourceSchema) => void
deleteTable: (schema: ExternalDataSourceSchema) => void
}): JSX.Element {
+ const { pausePolling, resumePolling } = useActions(sourceSettingsLogic)
+
return (
<SourceEditorAction source={source}>
{({ disabledReason }) => (
<More
disabledReason={disabledReason}
+ // Pause the 5s source refresh while the menu is open — a poll re-renders the
+ // table and dismisses the menu out from under the user.
+ dropdown={{
+ onVisibilityChange: (visible) => (visible ? pausePolling() : resumePolling()),
+ }}
overlay={
<>
<Tooltip
diff --git a/products/data_warehouse/frontend/scenes/SourceScene/tabs/sourceSettingsLogic.ts b/products/data_warehouse/frontend/scenes/SourceScene/tabs/sourceSettingsLogic.ts
index 2ed53e5ac24b..168b9fdbe9e6 100644
--- a/products/data_warehouse/frontend/scenes/SourceScene/tabs/sourceSettingsLogic.ts
+++ b/products/data_warehouse/frontend/scenes/SourceScene/tabs/sourceSettingsLogic.ts
@@ -1297,6 +1297,13 @@ export const sourceSettingsLogic = kea<sourceSettingsLogicType>([
}, 'sourceRefreshTimeout')
}
},
+ pausePolling: () => {
+ // Cancel the refresh already scheduled by the last load. Skipping the *reschedule*
+ // isn't enough on its own — without this, one more poll would still fire within
+ // REFRESH_INTERVAL and re-render the table, dismissing anything open over it (e.g. a
+ // row's "more" menu).
+ cache.disposables.dispose('sourceRefreshTimeout')
+ },
resumePolling: () => {
// After the reducer runs we may have dropped to 0 — but no fresh load has been
// scheduled (the prior loadSourceSuccess fired while paused and skipped its