chore(workflows): Use single table with status filter instead of three separate tables#52006
Open
chore(workflows): Use single table with status filter instead of three separate tables#52006
Conversation
Contributor
|
Size Change: -1.19 kB (0%) Total Size: 110 MB ℹ️ View Unchanged
|
Contributor
Author
|
@greptileai review |
Contributor
Prompt To Fix All With AIThis is a comment left during a code review.
Path: products/workflows/frontend/Workflows/WorkflowsTable.tsx
Line: 205-210
Comment:
**`statusConfig` recreated per row render**
`statusConfig` is a static mapping that is declared inside the column `render` callback, meaning a new object is instantiated for every row on every render pass. Since this never changes, it should be defined outside the component (or at minimum outside `columns`):
```typescript
const STATUS_CONFIG: Record<string, { label: string; type: 'success' | 'default' | 'muted' }> = {
active: { label: 'Active', type: 'success' },
draft: { label: 'Draft', type: 'default' },
archived: { label: 'Archived', type: 'muted' },
}
```
Then reference it inside the render callback: `const config = STATUS_CONFIG[item.status] || STATUS_CONFIG.draft`.
How can I resolve this? If you propose a fix, please make it concise.Reviews (1): Last reviewed commit: "chore(workflows): Use single table with ..." | Re-trigger Greptile |
Contributor
Prompt To Fix All With AIThis is a comment left during a code review.
Path: products/workflows/frontend/Workflows/WorkflowsTable.tsx
Line: 22-27
Comment:
**`STATUS_CONFIG` declared between import groups**
The `STATUS_CONFIG` constant is placed between two import groups (after the `WorkflowsScene` import but before the `hogflows` imports on lines 27–31). While ESM `import` declarations are hoisted so this works at runtime, it's poor code organisation and will likely trip the project's ESLint `import/order` rule. The constant should be placed after all imports.
```suggestion
import { WorkflowsSceneProps } from '../WorkflowsScene'
import { getHogFlowStep } from './hogflows/steps/HogFlowSteps'
import { HogFlow } from './hogflows/types'
import { newWorkflowLogic } from './newWorkflowLogic'
import { workflowLogic } from './workflowLogic'
import { WorkflowStatusFilter, workflowsLogic } from './workflowsLogic'
const STATUS_CONFIG: Record<string, { label: string; type: 'success' | 'default' | 'muted' }> = {
active: { label: 'Active', type: 'success' },
draft: { label: 'Draft', type: 'default' },
archived: { label: 'Archived', type: 'muted' },
}
```
How can I resolve this? If you propose a fix, please make it concise.
---
This is a comment left during a code review.
Path: products/workflows/frontend/Workflows/WorkflowsTable.tsx
Line: 238-244
Comment:
**Status column redundant when a specific status is filtered**
When a user has filtered to e.g. "Active", every row in the table will show the "Active" tag in the Status column — the column conveys no additional information in that case. Other PostHog list pages (feature flags, surveys) follow the same pattern, so this may be an intentional trade-off, but it's worth considering hiding the Status column (or making its header indicate it's a filter) when `filters.status !== 'all'` to reduce visual noise.
How can I resolve this? If you propose a fix, please make it concise.Reviews (2): Last reviewed commit: "Add back bulk selection and delete for a..." | Re-trigger Greptile |
7c2d13a to
12af585
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The workflows list page used three separate tables (Active, Draft, Archived) with a segmented button filter, which is inconsistent with how every other list page in PostHog works. Feature flags, surveys, and experiments all use a single table with a status dropdown filter. Internal feedback flagged this as an unnecessary deviation from the standard pattern.
Changes
LemonTable, with Status shown as a columnLemonSegmentedButtonwith aLemonSelectdropdown for the status filter, matching the pattern used by feature flags and surveysScreenshots
Before::

After:

How did you test this code?
Tested locally by navigating the workflows list, filtering by status (All/Active/Draft/Archived), searching, and filtering by creator. Compared layout visually against feature flags and surveys pages for consistency.
Publish to changelog?
No