Skip to content

Maintain consistent priority when using subject tags - #2272

Open
sjd210 wants to merge 3 commits into
mainfrom
hotfix/subject-tag-priority
Open

Maintain consistent priority when using subject tags#2272
sjd210 wants to merge 3 commits into
mainfrom
hotfix/subject-tag-priority

Conversation

@sjd210

@sjd210 sjd210 commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Pages are augmented with a subjectId when their tags are processed, however previously in cases of multiple subject tags (and for which there was no subject in the url), the ID would be whichever is the first in the doc's tag list. The order of this tag list should not matter (and indeed does not appear to be preserved when indexed) - instead we should use the subject priority that is already used for pageContext: [physics -> maths -> chemistry -> biology]

This was leading to mismatched page and title icon themes, although this could have also been avoided with a consistent order of pageContext?.subject ?? doc.subjectId (rather than the other way around), or by not re-stating the subject unnecessarily in the TitleAndBreadcrumb. To help avoid anything similar coming up again, these have both also been addressed.

@codecov

codecov Bot commented Jul 29, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 30.00000% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 43.20%. Comparing base (63b48ea) to head (4c99efc).

Files with missing lines Patch % Lines
src/app/services/tagsPhy.ts 14.28% 6 Missing ⚠️
src/app/components/pages/Concept.tsx 50.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##             main    #2272    +/-   ##
========================================
  Coverage   43.20%   43.20%            
========================================
  Files         601      601            
  Lines       25757    25757            
  Branches     8595     7657   -938     
========================================
  Hits        11128    11128            
- Misses      14572    14580     +8     
+ Partials       57       49     -8     

☔ View full report in Codecov by Harness.
📢 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.

@sjd210 sjd210 changed the title Use consistent ordering when using subject tags Maintain consistent priority when using subject tags Jul 29, 2026
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.

1 participant