: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.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
refactor(frontend): remove defunct tabId from workflows scenes (#62026)
Paul D'Ambra58e8f530f8be
diff --git a/products/workflows/frontend/TemplateLibrary/messageTemplateSceneLogic.ts b/products/workflows/frontend/TemplateLibrary/messageTemplateSceneLogic.tsindex 67ee14324d00..0a6a84e7b1f0 100644--- a/products/workflows/frontend/TemplateLibrary/messageTemplateSceneLogic.ts+++ b/products/workflows/frontend/TemplateLibrary/messageTemplateSceneLogic.ts@@ -11,7 +11,6 @@ import type { messageTemplateSceneLogicType } from './messageTemplateSceneLogicTexport interface MessageTemplateSceneLogicProps {id: stringmessageId?: string | null- tabId?: string}export const messageTemplateSceneLogic = kea<messageTemplateSceneLogicType>([diff --git a/products/workflows/frontend/Workflows/WorkflowScene.tsx b/products/workflows/frontend/Workflows/WorkflowScene.tsxindex 6447047033ae..061db8adc232 100644--- a/products/workflows/frontend/Workflows/WorkflowScene.tsx+++ b/products/workflows/frontend/Workflows/WorkflowScene.tsx@@ -41,7 +41,6 @@ export function WorkflowScene(props: WorkflowSceneLogicProps): JSX.Element {const workflowSceneProps: WorkflowSceneLogicProps = {id: props.id || 'new',tab: props.tab || 'workflow',- tabId: props.tabId || 'default',}const sceneLogic = workflowSceneLogic(workflowSceneProps)const { currentTab } = useValues(sceneLogic)@@ -51,7 +50,7 @@ export function WorkflowScene(props: WorkflowSceneLogicProps): JSX.Element {const batchJobsLogic = batchWorkflowJobsLogic({ id: workflowSceneProps.id })- const logic = workflowLogic({ id: props.id, tabId: props.tabId, templateId, editTemplateId })+ const logic = workflowLogic({ id: props.id, templateId, editTemplateId })const { workflowLoading, originalWorkflow, lastSavedAt, isAutoSavePending, autoSaveEnabled } = useValues(logic)const { setAutoSaveEnabled } = useActions(logic)const showSaving = useDebouncedValue(isAutoSavePending || workflowLoading, 1000)@@ -103,7 +102,7 @@ export function WorkflowScene(props: WorkflowSceneLogicProps): JSX.Element {return (<SceneContent className="h-full flex flex-col grow" data-attr="workflow-scene">- <BindLogic logic={workflowLogic} props={{ id: props.id, tabId: props.tabId, templateId, editTemplateId }}>+ <BindLogic logic={workflowLogic} props={{ id: props.id, templateId, editTemplateId }}><WorkflowSceneHeader {...props} />{/* Only show Logs and Metrics tabs if the workflow has already been created */}{!props.id || props.id === 'new' ? (diff --git a/products/workflows/frontend/Workflows/WorkflowsTable.tsx b/products/workflows/frontend/Workflows/WorkflowsTable.tsxindex e6006a261ab5..dc3ccebc6108 100644--- a/products/workflows/frontend/Workflows/WorkflowsTable.tsx+++ b/products/workflows/frontend/Workflows/WorkflowsTable.tsx@@ -17,7 +17,6 @@ import { ProfilePicture } from 'lib/lemon-ui/ProfilePicture'import { capitalizeFirstLetter } from 'lib/utils'import { urls } from 'scenes/urls'-import { WorkflowsSceneProps } from '../WorkflowsScene'import { getHogFlowStep } from './hogflows/steps/HogFlowSteps'import { HogFlow } from './hogflows/types'import { newWorkflowLogic } from './newWorkflowLogic'@@ -90,7 +89,7 @@ function WorkflowActionsSummary({ workflow }: { workflow: HogFlow }): JSX.Elemen)}-export function WorkflowsTable(props: WorkflowsSceneProps): JSX.Element {+export function WorkflowsTable(): JSX.Element {const logic = workflowsLogic()const {filteredWorkflows,@@ -124,7 +123,6 @@ export function WorkflowsTable(props: WorkflowsSceneProps): JSX.Element {// We can't just reset state within the logic's unmount as that would trigger when switching tabsconst newWorkflowLogic = workflowLogic.findMounted({id: 'new',- tabId: props.tabId,})newWorkflowLogic?.unmount()diff --git a/products/workflows/frontend/Workflows/hogflows/filters/HogFlowPropertyFiltersSearch.test.tsx b/products/workflows/frontend/Workflows/hogflows/filters/HogFlowPropertyFiltersSearch.test.tsxindex ed3c1ace47aa..e0f711cb5a56 100644--- a/products/workflows/frontend/Workflows/hogflows/filters/HogFlowPropertyFiltersSearch.test.tsx+++ b/products/workflows/frontend/Workflows/hogflows/filters/HogFlowPropertyFiltersSearch.test.tsx@@ -53,7 +53,7 @@ describe('HogFlowPropertyFilters search', () => {groupsModel.mount()propertyDefinitionsModel.mount()recentTaxonomicFiltersLogic.mount()- mountedWorkflowLogic = workflowLogic({ id: 'new', tabId: 'default' })+ mountedWorkflowLogic = workflowLogic({ id: 'new' })unmountWorkflowLogic = mountedWorkflowLogic.mount()})diff --git a/products/workflows/frontend/Workflows/hogflows/hogFlowEditorLogic.tsx b/products/workflows/frontend/Workflows/hogflows/hogFlowEditorLogic.tsxindex 6333d540b5cb..76cf564cc995 100644--- a/products/workflows/frontend/Workflows/hogflows/hogFlowEditorLogic.tsx+++ b/products/workflows/frontend/Workflows/hogflows/hogFlowEditorLogic.tsx@@ -148,7 +148,7 @@ export type CreateActionType = Pick<HogFlowAction, 'type' | 'config' | 'name' |export const hogFlowEditorLogic = kea<hogFlowEditorLogicType>([props({} as WorkflowLogicProps),path((key) => ['scenes', 'hogflows', 'hogFlowEditorLogic', key]),- key((props) => `hog-flow-editor-${props.id}-${props.tabId}`),+ key((props) => `hog-flow-editor-${props.id}`),connect(() => ({values: [workflowLogic,diff --git a/products/workflows/frontend/Workflows/hogflows/steps/stepDelayLogic.test.ts b/products/workflows/frontend/Workflows/hogflows/steps/stepDelayLogic.test.tsindex d4242d979bd8..e81de8980ada 100644--- a/products/workflows/frontend/Workflows/hogflows/steps/stepDelayLogic.test.ts+++ b/products/workflows/frontend/Workflows/hogflows/steps/stepDelayLogic.test.ts@@ -20,7 +20,7 @@ describe('stepDelayLogic', () => {plugins: [testUtilsPlugin],})- wfLogic = workflowLogic({ id: 'new', tabId: 'default' })+ wfLogic = workflowLogic({ id: 'new' })wfLogic.mount()sdLogic = stepDelayLogic({ workflowLogicProps: wfLogic.props })diff --git a/products/workflows/frontend/Workflows/hogflows/steps/stepWaitUntilTimeWindowLogic.test.ts b/products/workflows/frontend/Workflows/hogflows/steps/stepWaitUntilTimeWindowLogic.test.tsindex 0bba4701389d..787efd30ce95 100644--- a/products/workflows/frontend/Workflows/hogflows/steps/stepWaitUntilTimeWindowLogic.test.ts+++ b/products/workflows/frontend/Workflows/hogflows/steps/stepWaitUntilTimeWindowLogic.test.ts@@ -21,7 +21,7 @@ describe('stepWaitUntilTimeWindowLogic', () => {plugins: [testUtilsPlugin],})- wfLogic = workflowLogic({ id: 'new', tabId: 'default' })+ wfLogic = workflowLogic({ id: 'new' })wfLogic.mount()logic = stepWaitUntilTimeWindowLogic({ workflowLogicProps: wfLogic.props })diff --git a/products/workflows/frontend/Workflows/workflowLogic.autosave.test.ts b/products/workflows/frontend/Workflows/workflowLogic.autosave.test.tsindex adfcfda96907..06888af7367b 100644--- a/products/workflows/frontend/Workflows/workflowLogic.autosave.test.ts+++ b/products/workflows/frontend/Workflows/workflowLogic.autosave.test.ts@@ -71,7 +71,7 @@ describe('workflowLogic auto-save', () => {describe('debouncing existing workflow', () => {beforeEach(async () => {initKeaTests()- logic = workflowLogic({ id: WORKFLOW_ID, tabId: 'default' })+ logic = workflowLogic({ id: WORKFLOW_ID })logic.mount()await expectLogic(logic).toDispatchActions(['loadWorkflowSuccess'])})@@ -122,7 +122,7 @@ describe('workflowLogic auto-save', () => {['template editing', { id: WORKFLOW_ID, editTemplateId: 'tpl-1' }],])('does not auto-save for %s', async (_label, props) => {initKeaTests()- logic = workflowLogic({ ...props, tabId: 'default' })+ logic = workflowLogic({ ...props })logic.mount()jest.useFakeTimers()@@ -134,7 +134,7 @@ describe('workflowLogic auto-save', () => {it('does not auto-save when there are validation errors', async () => {initKeaTests()- logic = workflowLogic({ id: WORKFLOW_ID, tabId: 'default' })+ logic = workflowLogic({ id: WORKFLOW_ID })logic.mount()await expectLogic(logic).toDispatchActions(['loadWorkflowSuccess'])@@ -149,7 +149,7 @@ describe('workflowLogic auto-save', () => {it('does not auto-save when nothing has changed', async () => {initKeaTests()- logic = workflowLogic({ id: WORKFLOW_ID, tabId: 'default' })+ logic = workflowLogic({ id: WORKFLOW_ID })logic.mount()await expectLogic(logic).toDispatchActions(['loadWorkflowSuccess'])@@ -162,7 +162,7 @@ describe('workflowLogic auto-save', () => {it('clears isAutoSavePending when auto-save is skipped', async () => {initKeaTests()- logic = workflowLogic({ id: WORKFLOW_ID, tabId: 'default' })+ logic = workflowLogic({ id: WORKFLOW_ID })logic.mount()await expectLogic(logic).toDispatchActions(['loadWorkflowSuccess'])@@ -193,7 +193,7 @@ describe('workflowLogic auto-save', () => {})initKeaTests()- logic = workflowLogic({ id: WORKFLOW_ID, tabId: 'default' })+ logic = workflowLogic({ id: WORKFLOW_ID })logic.mount()await expectLogic(logic).toDispatchActions(['loadWorkflowSuccess'])@@ -208,7 +208,7 @@ describe('workflowLogic auto-save', () => {describe('auto-save toggle', () => {beforeEach(async () => {initKeaTests()- logic = workflowLogic({ id: WORKFLOW_ID, tabId: 'default' })+ logic = workflowLogic({ id: WORKFLOW_ID })logic.mount()await expectLogic(logic).toDispatchActions(['loadWorkflowSuccess'])})@@ -259,7 +259,7 @@ describe('workflowLogic auto-save', () => {describe('navigation guard', () => {it('does not fire save on unmount (no silent flush)', async () => {initKeaTests()- logic = workflowLogic({ id: WORKFLOW_ID, tabId: 'default' })+ logic = workflowLogic({ id: WORKFLOW_ID })logic.mount()await expectLogic(logic).toDispatchActions(['loadWorkflowSuccess'])@@ -275,7 +275,7 @@ describe('workflowLogic auto-save', () => {// The beforeUnload guard skips when id is 'new', even if// the form has unsaved changes (e.g. freshly created draft).initKeaTests()- logic = workflowLogic({ id: 'new', tabId: 'default' })+ logic = workflowLogic({ id: 'new' })logic.mount()await expectLogic(logic).toDispatchActions(['loadWorkflowSuccess'])diff --git a/products/workflows/frontend/Workflows/workflowLogic.emailValidation.test.ts b/products/workflows/frontend/Workflows/workflowLogic.emailValidation.test.tsindex 62809cb41cf9..add341df0c3c 100644--- a/products/workflows/frontend/Workflows/workflowLogic.emailValidation.test.ts+++ b/products/workflows/frontend/Workflows/workflowLogic.emailValidation.test.ts@@ -116,7 +116,7 @@ describe('workflowLogic email step "from" validation', () => {},})initKeaTests()- logic = workflowLogic({ id: WORKFLOW_ID, tabId: 'default' })+ logic = workflowLogic({ id: WORKFLOW_ID })logic.mount()await expectLogic(logic).toDispatchActions(['loadWorkflowSuccess'])@@ -133,7 +133,7 @@ describe('workflowLogic email step "from" validation', () => {},})initKeaTests()- logic = workflowLogic({ id: WORKFLOW_ID, tabId: 'default' })+ logic = workflowLogic({ id: WORKFLOW_ID })logic.mount()await expectLogic(logic).toDispatchActions(['loadWorkflowSuccess'])@@ -150,7 +150,7 @@ describe('workflowLogic email step "from" validation', () => {},})initKeaTests()- logic = workflowLogic({ id: WORKFLOW_ID, tabId: 'default' })+ logic = workflowLogic({ id: WORKFLOW_ID })logic.mount()await expectLogic(logic).toDispatchActions(['loadWorkflowSuccess', 'loadHogFunctionTemplatesByIdSuccess'])@@ -167,7 +167,7 @@ describe('workflowLogic email step "from" validation', () => {},})initKeaTests()- logic = workflowLogic({ id: WORKFLOW_ID, tabId: 'default' })+ logic = workflowLogic({ id: WORKFLOW_ID })logic.mount()await expectLogic(logic).toDispatchActions(['loadWorkflowSuccess'])diff --git a/products/workflows/frontend/Workflows/workflowLogic.schedule.test.ts b/products/workflows/frontend/Workflows/workflowLogic.schedule.test.tsindex 0c2b437fa791..9e3e2f030a66 100644--- a/products/workflows/frontend/Workflows/workflowLogic.schedule.test.ts+++ b/products/workflows/frontend/Workflows/workflowLogic.schedule.test.ts@@ -22,7 +22,7 @@ describe('workflowLogic schedule reducers', () => {beforeEach(() => {initKeaTests()- logic = workflowLogic({ id: 'new', tabId: 'default' })+ logic = workflowLogic({ id: 'new' })logic.mount()})diff --git a/products/workflows/frontend/Workflows/workflowLogic.ts b/products/workflows/frontend/Workflows/workflowLogic.tsindex b9fae8cb9f01..01332adcf212 100644--- a/products/workflows/frontend/Workflows/workflowLogic.ts+++ b/products/workflows/frontend/Workflows/workflowLogic.ts@@ -50,7 +50,6 @@ import { workflowsLogic } from './workflowsLogic'export interface WorkflowLogicProps {id?: string- tabId?: stringtemplateId?: stringeditTemplateId?: string}@@ -136,10 +135,9 @@ export function sanitizeWorkflow(export const workflowLogic = kea<workflowLogicType>([path((key) => ['products', 'workflows', 'frontend', 'Workflows', 'workflowLogic', key]),- props({ id: 'new', tabId: 'default' } as WorkflowLogicProps),+ props({ id: 'new' } as WorkflowLogicProps),key(- (props) =>- `workflow-${props.id || 'new'}-${props.tabId || 'default'}-${props.templateId || 'default'}-${props.editTemplateId || 'default'}`+ (props) => `workflow-${props.id || 'new'}-${props.templateId || 'default'}-${props.editTemplateId || 'default'}`),connect(() => ({values: [userLogic, ['user'], projectLogic, ['currentProjectId']],diff --git a/products/workflows/frontend/Workflows/workflowSceneLogic.ts b/products/workflows/frontend/Workflows/workflowSceneLogic.tsindex dd45018663d1..dc3ea563fc4f 100644--- a/products/workflows/frontend/Workflows/workflowSceneLogic.ts+++ b/products/workflows/frontend/Workflows/workflowSceneLogic.ts@@ -14,13 +14,12 @@ export type WorkflowTab = (typeof WorkflowTabs)[number]export interface WorkflowSceneLogicProps {id?: stringtab?: WorkflowTab- tabId?: string}export const workflowSceneLogic = kea<workflowSceneLogicType>([path(['products', 'workflows', 'frontend', 'workflowSceneLogic']),- props({ id: 'new', tabId: 'default' } as WorkflowSceneLogicProps),- key((props) => `workflow-scene-${props.id || 'new'}-${props.tabId || 'default'}`),+ props({ id: 'new' } as WorkflowSceneLogicProps),+ key((props) => `workflow-scene-${props.id || 'new'}`),actions({setCurrentTab: (tab: WorkflowTab) => ({ tab }),}),diff --git a/products/workflows/frontend/WorkflowsScene.tsx b/products/workflows/frontend/WorkflowsScene.tsxindex 0856b23ba400..0a7b42f0acfd 100644--- a/products/workflows/frontend/WorkflowsScene.tsx+++ b/products/workflows/frontend/WorkflowsScene.tsx@@ -36,7 +36,6 @@ export type WorkflowsSceneTab = (typeof WORKFLOW_SCENE_TABS)[number]export type WorkflowsSceneProps = {tab?: WorkflowsSceneTab- tabId?: string}export const workflowsSceneLogic = kea<workflowsSceneLogicType>([@@ -143,7 +142,7 @@ export function WorkflowsScene(props: WorkflowsSceneProps = {}): JSX.Element {{label: 'Workflows',key: 'workflows',- content: <WorkflowsTable {...props} />,+ content: <WorkflowsTable />,link: urls.workflows(),},{