Open the workflow page from a row click
Summary
A click on a row of a list opens the workflow page over the list, in a sheet from the right. This PR turns that overlay off: a row click opens the workflow page itself, as a plain link would. The maintainer asked for this PR so that the change can be judged here.
Carved from #3824, #3831, #3835 (SCcagg5), as part of the re-slice tracked in #4002.
Changes
This PR changes the product on purpose: a row click opens the workflow page instead of the peek overlay (OVERLAY_MOUNTED = false).
- The app no longer mounts the workflow overlay. A new constant
OVERLAY_MOUNTEDinui/src/features/peek/overlayMounted.tsdecides it;truemounts the overlay again. - Lists that used the overlay: Workflows (rows and cards), Runs (table and Grouped view), Activity lanes, Overview, Cockpit, Queues and Workers links.
- Before: a plain click opened the workflow page in a sheet over the list. The list stayed below, and Up and Down stepped through its rows.
- After: a plain click opens the workflow page in place of the list. Back returns to the list.
- Ctrl or Cmd click: before and after, it opens the workflow page in a new tab.
- The URL after a click is the same as before:
/dags/<name>with the same query. - The two E2E specs that waited for the overlay now expect the page.
- A workflow page whose code fails to load no longer blocks the list: Back or another link shows that page. Before, the error stayed until a reload. The overlay had its own error boundary, so this case only matters once the page opens in place of the list.
Core change
App.tsx wraps the routes in OverlayProvider. With the flag off, it is a Fragment, so useWorkflowOverlay() returns null. PeekHost then gives no controller, and usePeekOrOpen and PeekLink fall back to the full page. That fallback is already on main (it is what narrow windows use); this PR only stops mounting the provider.
ui/src/App.tsx:417
// Without the overlay, the host renders nothing and no list shows a peek.
const OverlayProvider = OVERLAY_MOUNTED
? WorkflowOverlayProvider
: React.Fragment;
ui/src/features/peek/PeekHost.tsx:36 (unchanged)
() => (open ? { open, isOpen, setSequence, shown } : null),
ui/src/features/peek/usePeekOrOpen.ts:62 (unchanged)
if (!newTab && showPeek(target)) return;
openPage(peekPageURL(target, node), event);
Testing
None of these were run locally; CI runs them.
ui/e2e/workflow-list-open.spec.ts, "opens a workflow from its row in the Workflows list": a row click opens/dags/<name>, and the filter of the list is gone. With the overlay, the list stays below and this check fails. Ctrl or Cmd opens a new tab; Back returns to the list; a card on a narrow window opens the page.ui/e2e/dag-run-history.spec.ts, "opens a run on its workflow page from the list / grouped / activity view": no longer waits for the overlay dialog or its Open workflow button. On this branch without that fix it would fail on every view.ui/src/__tests__/App.test.tsx: mocksOVERLAY_MOUNTEDtotrue, so the existing overlay tests keep covering the overlay.ui/src/__tests__/App.test.tsx, "shows the next page after a lazy route chunk fails": a page chunk fails, a link goes to the Workflows list, and the list renders. Without the reset of the error boundary, the error stays and this test fails.- The fallback to the full page without a host is covered by the existing
ui/src/features/peek/__tests__/usePeekOrOpen.test.tsxandPeekHost.test.tsx.
Performance
Lower cost per click. Before, the list kept rendering and kept its SSE subscriptions and refetches under the overlay while the workflow page also ran. Now only the workflow page runs. Back mounts the list again, which fetches it once, as any page change does. No new polling, request, ticker or stored data.
Out of scope
- The overlay code stays in place behind the flag:
WorkflowOverlayProvider,WorkflowOverlayHost, the resize handle, the step keys and their messages. It still ships in the bundle and its tests still run. Removing it, or keeping the flag, is for after this change is judged. - No per-list or per-user setting: the flag is a build-time constant.
Known limits
- Back to a list mounts it again. Filters held in the URL stay; the scroll position of the list may reset, and no row carries the mark of the last shown one.
- No unit test renders the app with the flag off; the Workflows list E2E is the check for the default.
Summary by cubic
A click on a row of a list now opens the workflow page itself, in place of the list, instead of the peek overlay that used to open in a sheet from the right.
- The overlay is disabled by a new build-time constant
OVERLAY_MOUNTEDinui/src/features/peek/overlayMounted.ts; setting it totruerestores the old behavior. - The overlay code and its tests stay in place behind the flag.
- A Ctrl or Cmd click still opens the page in a new tab, and the URL is unchanged.
- Back returns to the list, keeping URL filters but possibly resetting scroll position.
- A page that failed to load no longer sticks: Back or a link to another page clears the error and loads that page.
- The E2E specs for the Workflows list and run history no longer wait for the overlay, and check that the list is gone.
Summary by CodeRabbit
- Workflow Navigation
- Selecting a run from the run history or workflow list now opens the workflow page instead of an overlay. The workflow appears in the page’s main view, and the list’s overlay controls are no longer shown.
- Use Back to return from a run to the run list. Opening a run in a new tab leaves the original list open.