Skip to content

fix/1986-tag-long-values-rendering#1995

Open
Sushmit360 wants to merge 1 commit into
Uninett:mainfrom
Sushmit360:fix/1986-tag-long-values-rendering
Open

fix/1986-tag-long-values-rendering#1995
Sushmit360 wants to merge 1 commit into
Uninett:mainfrom
Sushmit360:fix/1986-tag-long-values-rendering

Conversation

@Sushmit360

Copy link
Copy Markdown

Scope and purpose

Fixes #1986.

This PR fixes poor rendering of incident tags with long values (for example long URLs or long error messages). Previously, the tag badge used aggressive breaking that caused awkward mid-word wrapping and could squeeze the key into a narrow vertical strip while the value wrapped separately.

The change updates tag badge markup/styles so:

  • the key stays readable and does not collapse
  • long values wrap more naturally
  • badge width is constrained to a sensible maximum
  • full tag content is still available via hover title text

The same rendering is now reused on both the incident list and incident detail page, so behavior is consistent.

This pull request

  • does not add, change, or remove dependencies
  • does not change the database
  • does not change the API

Contributor Checklist

  • Added a changelog fragment for towncrier
  • Added/amended tests for new/changed code
  • Added/changed documentation, including updates to the user manual if feature flow or UI is considerably changed
  • Linted/formatted the code with ruff and djLint, easiest by using pre-commit
  • The first line of the commit message continues the sentence "If applied, this commit will ...", starts with a capital letter, does not end with punctuation and is 50 characters or less long
  • If applicable: Created new issues if this PR does not fix the issue completely/there is further work to be done
  • If this results in changes in the UI: Added screenshots of the before and after
  • If this results in changes to the database model: Updated the ER diagram

Notes:

  • No further follow-up issues are required for this specific fix.
  • Please attach before/after screenshots when opening the PR.

@github-actions

Copy link
Copy Markdown

Warning

2 of 2 new test names are missing convention keywords (given/when/then/it_should)

File Test name
tests/htmx/incident/test_tag_rendering.py test_incident_tags_partial_uses_non_squishing_layout_for_long_values
tests/htmx/incident/test_tag_rendering.py test_incident_detail_renders_shared_tags_partial
Why am I seeing this?

Test names should follow a loose given/when/then pattern with keywords like given, when, then, or it_should. This is a suggestion, not a blocker. The check runs on new test methods added in this PR.

Examples:

  • test_when_no_incidents_then_returns_empty_list
  • test_it_should_create_incident_with_set_description
  • test_given_expired_token_when_refreshing_then_raises_error

@sonarqubecloud

Copy link
Copy Markdown

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tags with long values render poorly (badge balloons, key gets squished)

1 participant