Skip to content

Conversation

@amoghrajesh
Copy link
Contributor

@amoghrajesh amoghrajesh commented May 15, 2025

closes: #50639

Previously, when the item count was maxItems + 1, the last visible item and "+1 more" were rendered without a separator, leading to formatting issues. This fixes the logic to include the separator in this specific edge case.

For 3 tags:

image

For 4 tags:

image

FOr 5 tags:

image


^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in airflow-core/newsfragments.

@boring-cyborg boring-cyborg bot added the area:UI Related to UI/UX. For Frontend Developers. label May 15, 2025
Copy link
Contributor

@shubhamraj-git shubhamraj-git left a comment

Choose a reason for hiding this comment

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

Looks good.
One comment : I can see 2 commas in case of 5 tags.

@amoghrajesh
Copy link
Contributor Author

@shubhamraj-git i realised that and pushed a fix for it now, updated the images too.

@bbovenzi
Copy link
Contributor

What are you trying to solve here?

The reason I had that logic before is because "+1 more" is just as long as just showing that one extra tag. So we should only use the overflow once it actually saves us space

@natesinger
Copy link

natesinger commented May 15, 2025

How much of a pain would it be to show the full list vertically stacked on hover over the + element? Suppose we can address in a subsequent pull but jw because in this case we have no access to the full list of tags once truncated. On a tooltip I mean.

@amoghrajesh
Copy link
Contributor Author

What are you trying to solve here?

The reason I had that logic before is because "+1 more" is just as long as just showing that one extra tag. So we should only use the overflow once it actually saves us space

@bbovenzi the current behaviour without this fix is a squash of MAX_LEN'th element in the tags.

image

My tags: tags=["events", "bronze", "download", "mlb"],

I guess we can either show a "+n more" in a more generic sense which is for n > MAX_LEN or just do something more better. We cannot have the last 2 tags concatenate.

Copy link
Member

@pierrejeambrun pierrejeambrun left a comment

Choose a reason for hiding this comment

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

Nice, I think as Brent mentioned we need a little bit of both. There's no point showing +1 more we might as well show the last tag at this point.

But indeed in that particular scenario we need a correct separator between the max and max + 1 tag. (not a concatenation the two tags as you highlighted)

@amoghrajesh
Copy link
Contributor Author

There's one thing though -- "+1 more" will be much much shorter than having a tag of max_len, defined as TAG_MAX_LEN = 100.

So should we have some logic that something in between? Show the min of the two?

Copy link
Member

@pierrejeambrun pierrejeambrun left a comment

Choose a reason for hiding this comment

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

Indeed +1 more will be shorter if the extra tag name is really long, but we don't have logic based on the tag length at all. And if we do that for the latest tag should also do it for previous tags.

I wouldn't bother going down that rabbit hole for now.

@amoghrajesh
Copy link
Contributor Author

Definitely yes

@amoghrajesh
Copy link
Contributor Author

@pierrejeambrun / @bbovenzi how do you suggest we proceed with this one?

@pierrejeambrun
Copy link
Member

pierrejeambrun commented May 19, 2025

I would only solve the current case of a missing , separator when there are max + 1 tags, between max and max + 1 items.

@amoghrajesh amoghrajesh changed the title Correctly handle rendering dag tags when tags are 1 more than max Correctly render dag tags when there are MAX_TAGS + 1 tags May 19, 2025
@amoghrajesh
Copy link
Contributor Author

Sounds fair, yeah.

I have handled that case and pushed a fix for it. Also updated PR desc and title.

@bbovenzi bbovenzi added this to the Airflow 3.0.2 milestone May 19, 2025
@pierrejeambrun pierrejeambrun merged commit d03fe27 into apache:main May 19, 2025
42 checks passed
@pierrejeambrun pierrejeambrun deleted the fix-tags-display branch May 19, 2025 16:55
amoghrajesh added a commit that referenced this pull request May 20, 2025
…ags (#50669)

* Correctly handle rendering dag tags when tags are 1 more than max

* Correctly handle rendering dag tags when tags are 1 more than max

* fixing tests

* comments from pierre
(cherry picked from commit d03fe27)

Co-authored-by: Amogh Desai <amoghrajesh1999@gmail.com>
kaxil pushed a commit that referenced this pull request May 20, 2025
…ags (#50669) (#50809)

* Correctly handle rendering dag tags when tags are 1 more than max

* Correctly handle rendering dag tags when tags are 1 more than max

* fixing tests

* comments from pierre
(cherry picked from commit d03fe27)
dadonnelly316 pushed a commit to dadonnelly316/airflow that referenced this pull request May 26, 2025
…50669)

* Correctly handle rendering dag tags when tags are 1 more than max

* Correctly handle rendering dag tags when tags are 1 more than max

* fixing tests

* comments from pierre
kaxil pushed a commit that referenced this pull request Jun 3, 2025
…ags (#50669) (#50809)

* Correctly handle rendering dag tags when tags are 1 more than max

* Correctly handle rendering dag tags when tags are 1 more than max

* fixing tests

* comments from pierre
(cherry picked from commit d03fe27)
sanederchik pushed a commit to sanederchik/airflow that referenced this pull request Jun 7, 2025
…50669)

* Correctly handle rendering dag tags when tags are 1 more than max

* Correctly handle rendering dag tags when tags are 1 more than max

* fixing tests

* comments from pierre
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DAG Labels are Improperly Displayed

5 participants