Skip to content

feat: [1/n] Add hook, helper & static config for new Workflows List rendering#1228

Open
adhityamamallan wants to merge 5 commits intocadence-workflow:masterfrom
adhityamamallan:pr1-column-infrastructure
Open

feat: [1/n] Add hook, helper & static config for new Workflows List rendering#1228
adhityamamallan wants to merge 5 commits intocadence-workflow:masterfrom
adhityamamallan:pr1-column-infrastructure

Conversation

@adhityamamallan
Copy link
Copy Markdown
Member

@adhityamamallan adhityamamallan commented Apr 1, 2026

Summary

Add hook, helper and static config for new Workflows List. This is 1/n in a stack of PRs.

  • New hook for column management:
    • Added useWorkflowsListColumns hook to fetch search attributes and manage column visibility/selection state
  • Column configuration and helpers:
    • Created workflows-list-columns.config.ts with matcher rules for system attributes (WorkflowID, CloseStatus, RunID, WorkflowType, StartTime, CloseTime) and datetime types
    • Added getWorkflowsListColumnFromSearchAttribute helper to convert search attributes into renderable columns with type-aware formatting
  • Type definitions and constants:
    • Defined WorkflowsListColumn and WorkflowsListColumnMatcher types, plus Props type for the list component
    • Established DEFAULT_WORKFLOWS_LIST_COLUMNS constant and DEFAULT_WORKFLOWS_LIST_COLUMN_WIDTH for layout

Test plan

Unit tests + tested in follow-up PRs.

@adhityamamallan adhityamamallan changed the title [1/n] Add hook, helper & static config for new Workflows List rendering feat: [1/n] Add hook, helper & static config for new Workflows List rendering Apr 1, 2026
@adhityamamallan adhityamamallan force-pushed the pr1-column-infrastructure branch from 68fba7f to 5c3978f Compare April 1, 2026 10:49
Add types, constants, column matchers config, search attribute resolver,
and useWorkflowsListColumns hook that will power the new workflows list.

Made-with: Cursor
Signed-off-by: Adhitya Mamallan <adhitya.mamallan@uber.com>
Signed-off-by: Adhitya Mamallan <adhitya.mamallan@uber.com>
Signed-off-by: Adhitya Mamallan <adhitya.mamallan@uber.com>
@adhityamamallan adhityamamallan force-pushed the pr1-column-infrastructure branch from 5c3978f to a7db81c Compare April 1, 2026 10:49
@adhityamamallan adhityamamallan marked this pull request as ready for review April 1, 2026 10:52
Signed-off-by: Adhitya Mamallan <adhitya.mamallan@uber.com>
Signed-off-by: Adhitya Mamallan <adhitya.mamallan@uber.com>
@gitar-bot
Copy link
Copy Markdown

gitar-bot bot commented Apr 1, 2026

Code Review ✅ Approved 2 resolved / 2 findings

Adds hook, helper, and static config infrastructure for the new Workflows List rendering, addressing useState initialization with readonly tuples and invalid date handling in DATETIME renderCell. No remaining issues found.

✅ 2 resolved
Bug: useState initialized with readonly tuple, resetColumns creates new array

📄 src/views/shared/workflows-list/hooks/use-workflows-list-columns.ts:27-29 📄 src/views/shared/workflows-list/hooks/use-workflows-list-columns.ts:61-63
In useWorkflowsListColumns, useState on line 28 is initialized with DEFAULT_WORKFLOWS_LIST_COLUMNS which is a readonly tuple (declared with as const satisfies Array<string>). This works because useState accepts readonly arrays, but resetColumns on line 62 creates a spread copy [...DEFAULT_WORKFLOWS_LIST_COLUMNS] while the initial state does not. This is a minor inconsistency — the initial state shares a reference to the constant while resetColumns creates a fresh copy. Since the array is never mutated this is functionally harmless, but for consistency consider spreading in both places (or neither).

Edge Case: DATETIME renderCell returns NaN FormattedDate for invalid dates

📄 src/views/shared/workflows-list/config/workflows-list-columns.config.ts:67
In the DATETIME type matcher (line 67), the condition if (timestamp && !isNaN(timestamp)) guards against NaN but also against timestamp === 0 (epoch zero), which is a valid date (1970-01-01T00:00:00Z). If a search attribute has the value "1970-01-01T00:00:00Z", Date.parse returns 0, which is falsy, and the code falls through to String(value ?? '') instead of rendering a FormattedDate. This is an unlikely edge case but worth noting.

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Showing less information.

Comment with these commands to change:

Auto-apply Compact
gitar auto-apply:on         
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant