Skip to content

CLUE-589: enable custom comment tags on QA unit - #2932

Open
scytacki wants to merge 1 commit into
masterfrom
CLUE-589-qa-custom-comment-tags
Open

CLUE-589: enable custom comment tags on QA unit#2932
scytacki wants to merge 1 commit into
masterfrom
CLUE-589-qa-custom-comment-tags

Conversation

@scytacki

Copy link
Copy Markdown
Member

Enables the teacher-created custom comment tags feature on the QA demo unit so it can be exercised in testing.

What changed

Added "allowCustomCommentTags": true to src/public/demo/units/qa/content.json. The QA unit already sets showCommentTag: true and defines commentTags, so this is the one flag needed to turn on teacher-added custom tags.

Why

Teachers can add their own comment tags only when a unit sets both showCommentTag and allowCustomCommentTags (the latter defaults to false so legacy units are unaffected). No bundled unit set allowCustomCommentTags, so the feature could not be tested from any unit.

Gating logic: src/components/document/sort-work-add-tag.tsxcanAdd = showCommentTag && allowCustomCommentTags && user.isTeacher.

Testing

Log in as a teacher against the QA unit and confirm a custom tag can be added and that it merges with the config commentTags. Custom tags are stored per class + unit in Firestore at commentTags/{classHash}/units/{unit}/tags.

Jira: CLUE-589

🤖 Generated with Claude Code

Add allowCustomCommentTags to the QA demo unit so the teacher
custom comment tag feature can be exercised in testing.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@codecov

codecov Bot commented Jul 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.32%. Comparing base (4fc50e8) to head (f061a4c).

❗ There is a different number of reports uploaded between BASE (4fc50e8) and HEAD (f061a4c). Click for more details.

HEAD has 22 uploads less than BASE
Flag BASE (4fc50e8) HEAD (f061a4c)
cypress-regression 15 0
cypress 7 0
Additional details and impacted files
@@             Coverage Diff             @@
##           master    #2932       +/-   ##
===========================================
- Coverage   85.86%   69.32%   -16.55%     
===========================================
  Files         957      952        -5     
  Lines       54527    54503       -24     
  Branches    14357    14355        -2     
===========================================
- Hits        46822    37785     -9037     
- Misses       7687    16684     +8997     
- Partials       18       34       +16     
Flag Coverage Δ
cypress ?
cypress-regression ?
cypress-smoke 41.54% <ø> (-0.01%) ⬇️
jest 55.84% <ø> (ø)

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

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cypress

cypress Bot commented Jul 25, 2026

Copy link
Copy Markdown

collaborative-learning    Run #19536

Run Properties:  status check passed Passed #19536  •  git commit f061a4cbf0: CLUE-589: enable custom comment tags on QA unit
Project collaborative-learning
Branch Review CLUE-589-qa-custom-comment-tags
Run status status check passed Passed #19536
Run duration 03m 36s
Commit git commit f061a4cbf0: CLUE-589: enable custom comment tags on QA unit
Committer Scott Cytacki
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 ↗︎

@scytacki
scytacki requested a review from dougmartin July 27, 2026 11:15

@dougmartin dougmartin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good 👍

Config key is valid (allowCustomCommentTags is declared in src/models/stores/unit-configuration.ts:105 and src/authoring/types.ts:49), configuration-manager.ts:54-55 already forces it false unless showCommentTag is set, and the QA unit exposes the sort-work tab, so the control is reachable manually.

A few non-blocking notes (take or leave):

  • src/public/demo/units/qa/content.json (line 122): the flag is enabled on the qa unit, but every sort-work E2E spec drives qa-config-subtabs (cypress.config.ts:40 clueTestqaConfigSubtabsUnitTeacher6, cypress.config.ts:31 qaConfigSubtabsUnitTeacher1, and visitQaSubtabsUnit in cypress/support/visit_params.js:8), and no spec using a qa-unit teacher URL opens the sort-work tab. Since SortWorkAddTag only renders in Sort Work under the Strategy sort (src/components/document/sort-work-view.tsx:211), the control stays unreachable from every existing automated path. Consider also setting "allowCustomCommentTags": true in src/public/demo/units/qa-config-subtabs/content.json (it already has showCommentTag, commentTags, and "Strategy" in sortWorkConfig.sortOptions) so the existing sort-work fixtures can cover it.

  • src/public/demo/units/qa/content.json (line 122): src/models/stores/comment-tags.ts has addTag (line 52) but no remove/delete counterpart, and the QA unit runs against a fixed fakeClass=5, so any tag a tester adds persists at commentTags/{classHash}/units/{unit}/tags and merges into the sort sections of every later session on that class. Worth documenting the Firestore cleanup path in the test plan, or adding a cleanup spec alongside cypress/e2e/cleanup/remove_teacher_comment_spec.js, before section-label assertions like sortWork.checkSectionHeaderLabelsExist([...]) (teacher_sort_work_view_4_spec.js:126) start seeing leftover tags.

Not a code issue: the failing codecov/project check is a coverage-upload artifact (the cypress and cypress-regression flags uploaded 0 reports on this head vs 22 on base). codecov/patch, Build, Jest, and the Cypress smoke run all pass, and the PR contains no code lines.

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.

2 participants