Skip to content

UI polish for #37901: View Request opens the tasks tab, Withdraw asks first, Workflows tabs - #38702

Merged
karthicksharan merged 2 commits into
feat/lifecycle-exitsfrom
ui-polish/lifecycle-exits
Nov 25, 2026
Merged

karthicksharan merged 2 commits into
feat/lifecycle-exitsfrom
ui-polish/lifecycle-exits

Conversation

@karthicksharan

@karthicksharan karthicksharan commented Nov 25, 2026 •

Copy link
Copy Markdown

Describe your changes:

Part of #37901. This is a UI-polish hand-off into feat/lifecycle-exits, not main. Merge it into that branch after review.
Counterpart Collate PR: open-metadata/openmetadata-collate#8973 (Transitions editor).

I polished the lifecycle request UX from #37901:

  • View Request now opens the asset's Activity Feeds & Tasks tab with that request already selected (…/activity_feed/tasks?taskId=<id>), in both classic and AI mode. Before, it opened the standalone /tasks/<id> page.
    • The tasks list opens the linked task once.
    • If the task isn't on the loaded page, the list fetches it by id.
    • After that, the user's own picks win.
  • Withdraw request asks for confirmation first. It uses the shared ConfirmationModal at 400px, with the title "Withdraw request?" and a message naming the requested and current stage. The confirm button shows a spinner while withdrawing.
  • ConfirmationModal takes an optional width. The default stays 520, so every other caller is unchanged.
  • The pending-request badge and menu moved from EntityStatusBadge into PendingRequestMenu. This kept complexity under the lint limit, and the test ids are unchanged.
  • The Workflows page filter (All / Lifecycle / Automation) uses core Tabs instead of ButtonGroup.
  • Two new text keys in all 21 languages.

Type of change:

  • Improvement

High-level design:

These are UI-only changes, with no backend or API changes. The task link uses the existing taskId query parameter that the inbox already reads (useLinkedTaskId).

Screenshots: before and after, light and dark

These were taken in Collate, because OpenMetadata shows the status badge only for Metrics. Each image is a 2×2 grid. Columns are Before (#37901 as is) and After. Rows are Light (classic mode) and Dark (AI mode).

Workflows page tabs
o1-workflows-tabs

Pending request menu
o2-request-menu

View Request → Activity Feeds & Tasks, request selected (before: standalone task page)
o3-view-request

Withdraw asks first (before: withdrew immediately)
o4-withdraw

Tests:

Use cases covered

  • View Request opens the asset's tasks tab with the request selected, including when the request isn't on the first page.
  • Withdraw asks first. Cancel keeps the request, and confirming withdraws it.
  • The Workflows tabs switch the list.

Unit tests

  • TaskListV1.component.test.tsx is new, with 7 cases: linked task, off-page fetch, fetch failure, later page, and the user's later pick.
  • EntityStatusBadge.test.tsx covers the confirm and cancel flow and the tasks-tab link.
  • WorkflowsPage.test.tsx now looks for tab roles.
  • Jest across ActivityFeed, EntityStatusBadge, ConfirmationModal and WorkflowsPage: all passed (343 at the last full run of these folders).
  • ESLint, Prettier and tsc are clean on changed files.

Backend integration tests

  • Not applicable: no backend changes.

Playwright (UI) tests

  • LifecycleRequest.spec.ts was updated so Withdraw confirms in the modal.
  • Not run green locally. My local stack is a Collate server, and the spec creates its domains before their lifecycle. That server doesn't enrol existing domains, so the request badge never appears. The failure happens before any code this PR changes. The spec needs an OpenMetadata server, so CI and the merge queue will run it.
  • The same flows were exercised by hand and in the screenshots, against a Data Product in Collate, which runs this same code.

Manual test steps

  1. Publish a Data Product lifecycle with an on-request "any stage → Deprecated" transition.
  2. On a data product, open the status badge, choose Deprecate, and enter a reason.
  3. Open the "Deprecation requested" badge and click View Request. Activity Feeds & Tasks opens with the request selected.
  4. Open the badge again and click Withdraw request. Check the modal, then Cancel, then confirm. The badge disappears.

Checklist:

  • Self-review: I reviewed 11284a3e014 against REVIEW.md.
    • Fixed in c91a1e50e7a: 🔴 View Request selected the wrong task when the request wasn't on the loaded page. It now fetches the task by id, and the link is used once.
    • Answered, not changed: 🟡 the withdraw message shows stage values as-is, which is how the status badge shows them everywhere.
    • Answered, not changed: 🟡 other TaskListV1 users, such as incidents, now honour ?taskId= too, which is harmless.
  • Tests added or updated.
  • Translations added for every language.

🤖 Generated with Claude Code

- View Request opens the asset's Activity Feeds & Tasks tab with the
  request selected (classic and AI mode), instead of the standalone task page
- Withdraw request asks for confirmation in a 400px modal
- ConfirmationModal takes an optional width (default unchanged, 520)
- Pending-request menu moved into PendingRequestMenu
- Workflows page filter uses core Tabs instead of ButtonGroup
- New locale keys in all 21 languages
@gitar-bot

gitar-bot Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Code Review ⚠️ Changes requested 🟡 Medium risk 0 closed / 1 findings

Lifecycle-request links now fetch and select tasks by ID, while withdrawal behavior changes; lookup fallbacks could show the wrong approval task.

Redirects View Request to the asset's Activity Feeds & Tasks tab with the request preselected, adds a confirmation modal before withdrawing, and swaps the Workflows filter to core Tabs.

Changes requested: a late getTaskById response in TaskListV1 can override the user's task selection or fire after unmount or an entity change, and the .catch branch uses a stale task list. The fetch result needs to be cancelled on cleanup or checked for currency before calling onTaskClick.

⚠️ Bug: Late getTaskById result overrides the user's pick and fires after unmount

📄 openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedList/TaskListV1.component.tsx:41-45 📄 openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedList/TaskListV1.component.tsx:72-86

When the linked task is not on the loaded page, openLinkedTask calls getTaskById(...).then(onTaskClick) and never checks whether that response is still wanted. If the fetch is slow and the user picks another task in the meantime, the response still calls onTaskClick(data) and replaces their pick. That contradicts the PR's rule that "the user's own picks win". The same happens if the user leaves the tab or the entity changes before the fetch settles: the stale callback sets the provider's active task to a task from the previous view. The .catch branch has the same problem, since it calls onTaskClick(taskList[0]) with a list captured before the fetch began. To fix this, cancel the fetch's result in the effect cleanup, or check that the response is still current (the link ref still matches, the component is still mounted, and the user has not picked another task) before calling onTaskClick.

Guard the async result with a request token cleared by user picks and on unmount
const pendingLinkRef = useRef<string>();
useEffect(() => () => { pendingLinkRef.current = undefined; }, []);
// in openLinkedTask's off-page path:
pendingLinkRef.current = linkedTaskId;
getTaskById(linkedTaskId, { fields: LINKED_TASK_FIELDS })
  .then(({ data }) => {
    if (pendingLinkRef.current === linkedTaskId) onTaskClick(data);
  })
  .catch(() => {
    if (pendingLinkRef.current === linkedTaskId) onTaskClick(taskList[0]);
  })
  .finally(() => { if (pendingLinkRef.current === linkedTaskId) pendingLinkRef.current = undefined; });
// and clear pendingLinkRef.current when selectedTask changes to a task the user picked
🤖 Prompt for agents
Code Review: Redirects View Request to the asset's Activity Feeds & Tasks tab with the request preselected, adds a confirmation modal before withdrawing, and swaps the Workflows filter to core Tabs.
  
  Changes requested: a late `getTaskById` response in `TaskListV1` can override the user's task selection or fire after unmount or an entity change, and the `.catch` branch uses a stale task list. The fetch result needs to be cancelled on cleanup or checked for currency before calling `onTaskClick`.

1. ⚠️ Bug: Late getTaskById result overrides the user's pick and fires after unmount
   Files: openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedList/TaskListV1.component.tsx:41-45, openmetadata-ui/src/main/resources/ui/src/components/ActivityFeed/ActivityFeedList/TaskListV1.component.tsx:72-86

   When the linked task is not on the loaded page, `openLinkedTask` calls `getTaskById(...).then(onTaskClick)` and never checks whether that response is still wanted. If the fetch is slow and the user picks another task in the meantime, the response still calls `onTaskClick(data)` and replaces their pick. That contradicts the PR's rule that "the user's own picks win". The same happens if the user leaves the tab or the entity changes before the fetch settles: the stale callback sets the provider's active task to a task from the previous view. The `.catch` branch has the same problem, since it calls `onTaskClick(taskList[0])` with a list captured before the fetch began. To fix this, cancel the fetch's result in the effect cleanup, or check that the response is still current (the link ref still matches, the component is still mounted, and the user has not picked another task) before calling `onTaskClick`.

   Fix (Guard the async result with a request token cleared by user picks and on unmount):
   const pendingLinkRef = useRef<string>();
   useEffect(() => () => { pendingLinkRef.current = undefined; }, []);
   // in openLinkedTask's off-page path:
   pendingLinkRef.current = linkedTaskId;
   getTaskById(linkedTaskId, { fields: LINKED_TASK_FIELDS })
     .then(({ data }) => {
       if (pendingLinkRef.current === linkedTaskId) onTaskClick(data);
     })
     .catch(() => {
       if (pendingLinkRef.current === linkedTaskId) onTaskClick(taskList[0]);
     })
     .finally(() => { if (pendingLinkRef.current === linkedTaskId) pendingLinkRef.current = undefined; });
   // and clear pendingLinkRef.current when selectedTask changes to a task the user picked

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@github-actions

Copy link
Copy Markdown
Contributor

UI browser tests

Ran: all test files (no impact map from main yet)

Result: ✅ 1070 passed · 154 skipped

Changed code executed by these browser tests: 3 / 37 lines (8%)

File Changed lines Executed %
src/components/Entity/EntityStatusBadge/PendingRequestMenu.tsx 17 1 6%
src/components/ActivityFeed/ActivityFeedList/TaskListV1.component.tsx 20 2 10%
Changed files no browser test loads
  • src/components/Modals/ConfirmationModal/ConfirmationModal.interface.ts
  • src/pages/WorkflowDefinitions/WorkflowsPage/WorkflowList.tsx

@karthicksharan
karthicksharan marked this pull request as ready for review November 25, 2026 14:53
@karthicksharan
karthicksharan requested a review from a team as a code owner November 25, 2026 14:53
@karthicksharan
karthicksharan requested review from shrabantipaul-collate and removed request for a team November 25, 2026 14:53
@github-actions

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically.

Maintainers can bypass this check by adding the skip-pr-checks label.

@karthicksharan
karthicksharan merged commit 45750b2 into feat/lifecycle-exits Nov 25, 2026
92 of 95 checks passed
@karthicksharan
karthicksharan deleted the ui-polish/lifecycle-exits branch November 25, 2026 14:55
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