Skip to content

UI: Update browser tab title dynamically with DAG name#67169

Open
Subham-KRLX wants to merge 2 commits into
apache:mainfrom
Subham-KRLX:fix/ui-browser-tab-title
Open

UI: Update browser tab title dynamically with DAG name#67169
Subham-KRLX wants to merge 2 commits into
apache:mainfrom
Subham-KRLX:fix/ui-browser-tab-title

Conversation

@Subham-KRLX
Copy link
Copy Markdown
Contributor

The browser tab title always showed Airflow in the new React UI because BaseLayout.tsx set it synchronously on every render.

We wrapped the default title logic in a useEffect hook so that it only sets the fallback title on mount. We also added a useDocumentTitle hook and called it in the DAG detail page to show the DAG name dynamically.

closes: #67145

Was generative AI tooling used to co-author this PR?
Yes — Claude (For PR description)

Copy link
Copy Markdown
Contributor

@bbovenzi bbovenzi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call.

We probably want to expand this to every page. But that can be a follow-up PR

Comment thread airflow-core/src/airflow/ui/src/layouts/BaseLayout.tsx Outdated
@Subham-KRLX Subham-KRLX force-pushed the fix/ui-browser-tab-title branch from a6a0c23 to ddb08df Compare May 20, 2026 03:43
@Subham-KRLX
Copy link
Copy Markdown
Contributor Author

Good call.

We probably want to expand this to every page. But that can be a follow-up PR

Agreed. Let's handle expanding this to all other pages in a follow up PR.

Copy link
Copy Markdown
Member

@choo121600 choo121600 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool :)

@bbovenzi bbovenzi added the backport-to-v3-2-test Mark PR with this label to backport to v3-2-test branch label May 20, 2026
@bbovenzi bbovenzi added this to the Airflow 3.2.2 milestone May 20, 2026
@choo121600
Copy link
Copy Markdown
Member

choo121600 commented May 20, 2026

I think there may be an effect ordering issue here between BaseLayout and Header.

On a hard refresh of /dags/<dag_id>, both useDocumentTitle() hooks mount in the same commit, and React runs effects child → parent:

  1. Header sets "examole Dag - Airflow"
  2. BaseLayout overwrites it with "Airflow"
Screen.Recording.2026-05-20.at.11.30.26.PM.mov

Could you double-check the hard-refresh case?

Comment thread airflow-core/src/airflow/ui/src/pages/Dag/Header.tsx Outdated
@Subham-KRLX
Copy link
Copy Markdown
Contributor Author

I think there may be an effect ordering issue here between BaseLayout and Header.

On a hard refresh of /dags/<dag_id>, both useDocumentTitle() hooks mount in the same commit, and React runs effects child → parent:

  1. Header sets "examole Dag - Airflow"
  2. BaseLayout overwrites it with "Airflow"

Screen.Recording.2026-05-20.at.11.30.26.PM.mov
Could you double-check the hard-refresh case?

I removed the hook from BaseLayout to fix the effect ordering issue and simplify the logic

@bbovenzi
Copy link
Copy Markdown
Contributor

looks good. Let's fix the static checks

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

Labels

area:UI Related to UI/UX. For Frontend Developers. backport-to-v3-2-test Mark PR with this label to backport to v3-2-test branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Browser tab title always shows "Airflow" in v3 UI — DAG name no longer reflected

4 participants