Skip to content

Concept page: special display for deprecated concepts#1918

Merged
osma merged 6 commits intomainfrom
issue1877-concept-page-deprecated
Feb 2, 2026
Merged

Concept page: special display for deprecated concepts#1918
osma merged 6 commits intomainfrom
issue1877-concept-page-deprecated

Conversation

@osma
Copy link
Member

@osma osma commented Jan 29, 2026

Reasons for creating this PR

This implements special display for deprecated concepts: there is a warning box indicating that the concept has been deprecated (with links to replacements if available), and the text within the concept card is shown in a greyish, muted color.

Here is how it looks:

image

Link to relevant issue(s), if any

Description of the changes in this PR

  • changes to the concept-card template: warning box for deprecated concepts + add some CSS classes for styling
  • main CSS file: define new color variables (--muted-color and --main-content-disabled), matching existing variable naming practice
  • Concept class: add getIsReplacedBy method so that the Twig template can directly query for replacements (in Skosmos 2 this was done using client-side javascript but I think this is better)
  • PHPUnit tests for getDeprecated (this was missing) and getIsReplacedBy

Known problems or uncertainties in this PR

I had to adjust the visual design because I found the original design problematic in many ways. Here are things I did:

  • The warning text is not bold, unlike in the design spec; only the replacement concept labels are set in bold. I think this is better in line with the rest of the UI and makes the replacement concepts stand out better.
  • The grey color used in the design spec was too light so it didn't follow accessibility requirements. I made it darker, so that it has a contrast rating slightly above 4.5:1.
  • I also used the grey color for other text elements on the concept cards, not just the headline as in the visual spec. I think this makes the deprecated status more obvious and better matches the display of deprecated concepts in Skosmos 2.

Checklist

  • phpUnit tests pass locally with my changes
  • I have added tests that show that the new code works, or tests are not relevant for this PR (e.g. only HTML/CSS changes)
  • The PR doesn't reduce accessibility of the front-end code (e.g. tab focus, scaling to different resolutions, use of .sr-only class, color contrast)
  • The PR doesn't introduce unintended code changes (e.g. empty lines or useless reindentation)

@osma osma added this to the 3.1 milestone Jan 29, 2026
@osma osma self-assigned this Jan 29, 2026
@joelit
Copy link
Contributor

joelit commented Jan 29, 2026

I am able to reproduce a consistent bug where the warning box is appended after the concept info during the first full page load. On refresh it is moved back to the correct position.
image

@joelit
Copy link
Contributor

joelit commented Jan 29, 2026

On further notice, I would consider dropping the bread crumb line, as it does not really offer anything useful here. Then again, this is only true in cases (like at NLF) where the deprecated concept is removed from the hierarchy. As this is not a requirement in the SKOS specification, it's probably safer to display the bread crumb section in case it makes sense for some other controlled vocabularies. Just a thought.

@codecov
Copy link

codecov bot commented Jan 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.03%. Comparing base (b9bf033) to head (3ef6d58).
⚠️ Report is 13 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1918      +/-   ##
============================================
+ Coverage     70.27%   71.03%   +0.75%     
- Complexity     1658     1694      +36     
============================================
  Files            34       34              
  Lines          4364     4502     +138     
============================================
+ Hits           3067     3198     +131     
- Misses         1297     1304       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@osma
Copy link
Member Author

osma commented Jan 29, 2026

@joelit

I am able to reproduce a consistent bug where the warning box is appended after the concept info during the first full page load. On refresh it is moved back to the correct position.

Good catch! Fixed in a91b494

On further notice, I would consider dropping the bread crumb line, as it does not really offer anything useful here. Then again, this is only true in cases (like at NLF) where the deprecated concept is removed from the hierarchy. As this is not a requirement in the SKOS specification, it's probably safer to display the bread crumb section in case it makes sense for some other controlled vocabularies. Just a thought.

Well, Skosmos 2 displays the breadcrumb and it's also shown in the Skosmos 3 visual design for deprecated concepts. So I think I'm leaving it in, even though it's a bit nonsensical for NLF vocabularies.

Added translations (had to adjust message keys, which led to some churn) and a Cypress test. I think this is now ready.

@osma osma marked this pull request as ready for review January 29, 2026 15:09
@osma osma moved this to Under review in Skosmos 3.x Backlog Jan 29, 2026
@osma osma requested a review from joelit January 29, 2026 15:09
Copy link
Contributor

@UnniKohonen UnniKohonen left a comment

Choose a reason for hiding this comment

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

I would remove the .alert-danger bootstrap class but otherwise looks good!

@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 2, 2026

@osma osma merged commit ea13b00 into main Feb 2, 2026
16 checks passed
@github-project-automation github-project-automation bot moved this from Under review to Issue/PR closed in Skosmos 3.x Backlog Feb 2, 2026
@osma osma deleted the issue1877-concept-page-deprecated branch February 2, 2026 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Show deprecated concepts on the concept page

3 participants