Skip to content

CLUE-343 Custom Labels for Problem Hierarchy#2736

Open
tealefristoe wants to merge 32 commits intomasterfrom
clue-343-naming-problems
Open

CLUE-343 Custom Labels for Problem Hierarchy#2736
tealefristoe wants to merge 32 commits intomasterfrom
clue-343-naming-problems

Conversation

@tealefristoe
Copy link
Contributor

@tealefristoe tealefristoe commented Jan 30, 2026

Jira story: https://concord-consortium.atlassian.net/browse/CLUE-343

This PR adds a few new features:

  • Problem hierarchy terms can now be relabeled. These terms appear in the "Show for" dropdown.
  • "Workspace" can now be relabeled. This term appears throughout the codebase.
  • Plurals can now be relabeled for several terms. Many of these are not used yet, but I think it's good to start maintaining a complete list of terms.
  • The way the "New Problem Workspace" button label is defined has changed (document-type-collection.tsx). This was a specific request in the Jira story.

I also refactored some code as part of this PR:

  • tagPrompt has mostly been removed from the codebase. Now, the override for "Strategy" will be used as the tag prompt, and Strategy will only appear in the "Sort by" dropdown if it has been overridden.
  • I eliminated translation-types.ts. Much of the content of this was sort specific, which I moved to sort-utils.ts. I moved the rest of the contents to translate.ts, which is nice because it's now possible to import these on one line with translate.
  • I rearranged imports in many files (because I'm OCD like that).
  • TERM_METADATA has been moved into term-overrides-settings.tsx, since that's the only place where it's used.
  • Terms are now sorted by their display labels in term-overrides-settings.tsx, rather than their translation keys.

UI changes to sort-work-settings.tsx:

  • Reordered position of UI elements to keep the Context Filter toggle close to the Filter Options.
  • Both the type and label are now listed for both sort and filter options. Previously, only the label was displayed, with an * if it differed from the type.
  • The types are now used instead of the labels throughout the UI. This is mostly just in aria labels, but also in the Default Primary Sort dropdown. I figured it would be good to use the unchanging types throughout the authoring UI. I'm not committed to this approach, though, and am happy to switch back if this is more confusing than using the labels throughout the UI.

@tealefristoe tealefristoe marked this pull request as draft January 30, 2026 18:44
@codecov
Copy link

codecov bot commented Jan 30, 2026

Codecov Report

❌ Patch coverage is 98.37838% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.79%. Comparing base (d1aa238) to head (16afaad).
⚠️ Report is 5 commits behind head on master.

Files with missing lines Patch % Lines
...c/components/document/document-scroller-header.tsx 90.00% 1 Missing ⚠️
src/components/document/document.tsx 90.00% 1 Missing ⚠️
src/models/stores/document-group.ts 88.88% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2736      +/-   ##
==========================================
- Coverage   86.81%   86.79%   -0.02%     
==========================================
  Files         829      828       -1     
  Lines       44549    44568      +19     
  Branches    11456    11449       -7     
==========================================
+ Hits        38675    38685      +10     
- Misses       5525     5534       +9     
  Partials      349      349              
Flag Coverage Δ
cypress ?
cypress-regression 77.92% <90.69%> (+1.10%) ⬆️
cypress-smoke 43.88% <62.79%> (+<0.01%) ⬆️
jest 49.88% <79.45%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

@cypress
Copy link

cypress bot commented Jan 30, 2026

collaborative-learning    Run #17637

Run Properties:  status check passed Passed #17637  •  git commit 16afaad99b: Remove redundant checks in document-scroller-header.tsx.
Project collaborative-learning
Branch Review clue-343-naming-problems
Run status status check passed Passed #17637
Run duration 03m 01s
Commit git commit 16afaad99b: Remove redundant checks in document-scroller-header.tsx.
Committer Teale Fristoe
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 4
View all changes introduced in this branch ↗︎

@tealefristoe tealefristoe marked this pull request as ready for review February 3, 2026 17:50
@tealefristoe
Copy link
Contributor Author

@scytacki I've asked for your review, but feel free to ignore most of this PR. I mostly want your opinion on new translation keys.

Copy link
Contributor

@emcelroy emcelroy left a comment

Choose a reason for hiding this comment

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

This is looking really good 👍 I left comments/questions about some minor things. There's at least one lint warning that should be addressed, and it looks like there are conflicts in src/components/document/document.tsx. Also, I think it'd be good to add a note to the PR description about how the use of tagPrompt in existing clue-curriculum code needs to be updated.

@tealefristoe tealefristoe marked this pull request as draft February 3, 2026 22:41
Copy link
Member

@scytacki scytacki left a comment

Choose a reason for hiding this comment

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

I'd guess any changes to keys would break the units where Leslie has customized terms. But since we haven't released this official yet, now seems like the best time to make the change.

The capitalization in the translation keys is starting to bother me. I suggest starting all the keys with lowercase.

I also think we should scope the Problem, Investigation, and Unit keys. These keys are all specific to the curriculum structure or hierarchy. "Problem" is a little tricky because it we also use it at least in the code for ProblemDocument, but I don't think we expose that anywhere intentional. And it kind of makes sense that Problem Document means a document associated with the lowest curriculum level.

How about a scope of contentLevel, so these keys would be contentLevel.problem, contentLevel.investigation, contentLevel.unit.

I think the approach of defining explicit plural keys is a good way to go. 👍

@tealefristoe tealefristoe marked this pull request as ready for review February 4, 2026 17:33
@tealefristoe
Copy link
Contributor Author

@emcelroy I ended up making more changes than I was hoping after your last review, so your followup review will probably be bigger than you were expecting. Sorry. Here are the high level changes that I made:

  • Translation keys have been changed at @scytacki's suggestion.
    • They have all been converted to starting lower case.
    • problem, investigation, and unit are now proceeded by contentLevel..
    • I also ended up making all of the default values lower case, which required upper casing the first letters in many contexts. This was a big change, but it felt weird to have the default for "workspace" be "Workspace", etc.
  • Since I already had to make major changes to the clue-curriculum repo with the above change, I decided to go ahead and simplify sortOptions. Previously, objects like { type, label? } were being saved here. But label was never used, so a simple type string is all that's necessary. It was painful to make this change, but I figured it would be better to make it now before many units use sortOptions. The change significantly simplifies the code, which should make it a lot easier for future engineers to understand what's going on.

Copy link
Contributor

@emcelroy emcelroy left a comment

Choose a reason for hiding this comment

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

Looks great 👍 Nice changes. The only comments I left are very minor. Also, this is a real nitpick, sorry, but I did wonder about the use of Term versus Word in some of the variable names (e.g., problemTerm and problemWord). It seems like at least in some cases it was an arbitrary choice which leads to some inconsistency. Not a big deal though if you leave those as is (especially if there's a good reason for it that I'm missing).

//if tagPrompt was posted to Firestore - for ex: SAS unit (where tagPrompt = "Select Student Strategy")
//our comment.tags should be [""]
const isTagPrompt = (comment.tags && comment.tags[0] === "") || (comment.tags === undefined);
//our comment.tags[0] should be [""]
Copy link
Contributor

Choose a reason for hiding this comment

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

Should the comment say `//our comment.tags[0] should be ""?

}
else {
const groupTerm = translate("studentGroup");
const groupTerm = groupWord;
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems unnecessary. Can't you simply use groupWord in the next line?

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.

3 participants