Skip to content

Add nav_top_level option for plugin nav items#67084

Open
stuart23 wants to merge 7 commits into
apache:mainfrom
stuart23:plugin-promote-to-toolbar
Open

Add nav_top_level option for plugin nav items#67084
stuart23 wants to merge 7 commits into
apache:mainfrom
stuart23:plugin-promote-to-toolbar

Conversation

@stuart23
Copy link
Copy Markdown
Contributor

@stuart23 stuart23 commented May 18, 2026

Allows plugin authors to set nav_top_level =True on external_views or react_apps nav items so the item always appears directly on the navigation toolbar instead of being grouped into the Plugins submenu.

Remaining non-promoted items follow the existing rule: 2+ items → submenu, 1 item → toolbar (no single-item submenu). Fully backwards compatible — omitting the field preserves the current behaviour exactly.


Was generative AI tooling used to co-author this PR?
  • Yes (Claude Code)

  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.

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.

We use the word "nav" already so let's rename the variable to something like nav_top_level

Comment thread airflow-core/src/airflow/api_fastapi/core_api/datamodels/plugins.py Outdated
stuart23 added 2 commits May 21, 2026 00:05
Allows plugin authors to set nav_top_level=True on external_views
or react_apps so the item always appears directly on the navigation
toolbar rather than being grouped into the Plugins submenu.

Remaining non-promoted items follow the existing rule: 2+ items go into
a submenu, a single item is also shown on the toolbar (no one-item
submenu). Backwards compatible — omitting the flag preserves the current
behaviour exactly.
The existing test did an exact equality check on external_view response
objects; now that nav_top_level (default False) is included in the
serialized output, each expected dict needs the field.
@stuart23 stuart23 force-pushed the plugin-promote-to-toolbar branch from 276b401 to 9517f82 Compare May 21, 2026 05:07
@stuart23 stuart23 changed the title Add promote_to_toolbar option for plugin nav items Add nav_top_level option for plugin nav items May 21, 2026
@bbovenzi bbovenzi added this to the Airflow 3.3.0 milestone May 21, 2026
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.

Code looks good. Let's rebase to make the CI happy.

@stuart23 stuart23 force-pushed the plugin-promote-to-toolbar branch 2 times, most recently from d2a22d6 to 49f01a2 Compare May 22, 2026 18:46
stuart23 added 2 commits May 28, 2026 18:49
Allows plugin authors to set nav_top_level=True on external_views
or react_apps so the item always appears directly on the navigation
toolbar rather than being grouped into the Plugins submenu.

Remaining non-promoted items follow the existing rule: 2+ items go into
a submenu, a single item is also shown on the toolbar (no one-item
submenu). Backwards compatible — omitting the flag preserves the current
behaviour exactly.
The existing test did an exact equality check on external_view response
objects; now that nav_top_level (default False) is included in the
serialized output, each expected dict needs the field.
@pierrejeambrun pierrejeambrun force-pushed the plugin-promote-to-toolbar branch from 49f01a2 to 67fddbb Compare May 28, 2026 16:49
@pierrejeambrun
Copy link
Copy Markdown
Member

Rebased the branch, lets see if CI is happy.

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

Labels

area:airflow-ctl area:API Airflow's REST/HTTP API area:plugins area:UI Related to UI/UX. For Frontend Developers. backport-to-airflow-ctl/v0-1-test kind:documentation ready for maintainer review Set after triaging when all criteria pass.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants