airflow icon indicating copy to clipboard operation
airflow copied to clipboard

UI: Alt+click on a task instance in Grid/Graph opens its extra link in a new tab

Open pedro-cf opened this issue 1 week ago • 2 comments

Description

Alt+click (Option+click on macOS) on a task instance in Grid or Graph should open its extra link (e.g. "Triggered DAG") in a new tab.

  • One extra link: open it directly.
  • Multiple extra links: show a small menu to pick one.
  • No extra links: behave like a normal click.
  • Tooltip hint when links exist, e.g. "Alt+click to open Triggered DAG".

Alt is free to use: task instances are anchors, so Ctrl/Cmd/Shift/middle-click already have standard meanings, but Alt+click currently just downloads the SPA's empty HTML shell as a file named after the task. The handler should preventDefault() and use window.open(url, "_blank", "noopener").

Use case/motivation

Getting from a TriggerDagRunOperator task to the triggered Dag run currently takes three clicks: task instance → Details tab → "Triggered DAG". When debugging chains of triggered Dags, this repeats for every hop. A one-click shortcut that opens in a new tab keeps the parent run open for reference.

Any operator with extra links (Databricks, dbt Cloud, EMR, BigQuery, etc.) benefits the same way.

Related issues

  • Discussion #34546 (Extra Links - More accessible)
  • PR #46074 (extra links section in the Airflow 3 task instance Details tab)
  • PR #40336 (Triggered DAG link points to the specific triggered run_id)

Are you willing to submit a PR?

  • [ ] Yes I am willing to submit a PR!

Code of Conduct

pedro-cf avatar Nov 20 '26 17:11 pedro-cf

Hello @pedro-cf !!! I'm interested in working on this issue .

Proposed approach:

  1. Fetch links lazily. Reuse the existing useTaskInstanceServiceGetExtraLinks hook (already used by the task-instance Details ExtraLinks tab) with each cell's dag/run/task IDs. Call it only on hover/Alt-press rather than on initial render, and let the query cache avoid a request per cell. Filter out null URLs.
  2. One shared hook for both views. Grid and Graph have separate click paths (Grid.handleCellClick → GridTI, and TaskLink/TaskNode), so I'd put the modifier-click logic in a small shared hook under src/hooks/ and wire it into both. It would check event.altKey, call preventDefault(), and open via window.open(url, "_blank", "noopener") as suggested. Existing Shift/Ctrl/Cmd selection and middle-click behavior stays untouched.
  3. One vs. many links. Single link opens directly. Multiple links show a small Chakra popover/menu to pick one. No links falls through to normal navigation.
  4. Safety + hint. Validate URLs with getSafeExternalUrl() and honor getLinkTarget() instead of opening arbitrary values. Append a hint such as "Alt+click to open Triggered DAG" to the existing TaskInstanceTooltip only when links are available.
  5. Tests. Cover the shared hook (one/many/none, null filtering, non-Alt passthrough, blocked URL schemes), plus rendering tests for the Grid and Graph click wiring.

If this issue is still available, would you please assign it to me? I’ll work on this issue and open a focused PR.

Ayushrawatcy009 avatar Nov 20 '26 19:11 Ayushrawatcy009

Hello @Ayushrawatcy009 thank you, but I don't have such permissions, I believe you can just make a PR if you'd like.

pedro-cf avatar Nov 21 '26 11:11 pedro-cf