Skip to content

Actually pass showClassNames to the classroom's ArticlePreview - #1236

Merged
mircealungu merged 4 commits into
masterfrom
wt/wire-class-tags
Aug 31, 2026
Merged

mircealungu merged 4 commits into
masterfrom
wt/wire-class-tags

Conversation

@mircealungu

Copy link
Copy Markdown
Member

The class tags from #1235 shipped dead. ClassroomArticles computed inMoreThanOneClass and then never handed it to ArticlePreview, so from_classes was fetched from the API, serialised, and dropped on the floor.

One line to fix. Two process failures behind it, both mine:

A silent no-op replace. The edit meant to add the prop matched against <ArticlePreview key article dontShowSourceIcon /> — but master had since changed that call site to spread browsingModeProps(...). Every other replacement in that script asserted its match; this one didn't, so it changed nothing and reported success.

A scaffold that tested the wrong thing. I verified with a preview that rendered ArticlePreview directly and passed showClassNames={true} itself. That proved the component rendered tags — while the only seam that was broken sat one level up, untouched. This time the scaffold renders the real ClassroomArticles with a fake API, and the tags appear through the actual path.

Needs a web redeploy; the API side is already live and correct.

mircealungu and others added 4 commits August 31, 2026 09:50
A student in more than one class gets one merged classroom list, and until now
it was a pile of texts with no way to tell whose lesson was whose. Each text
now carries its class as a tag in the metadata strip, suppressed for the 2,484
students who have exactly one class and would see the same answer on every row.

ArticlePreview renders two layouts and both have their own MetaStrip, so the
tags are built once next to the other tag slots rather than inside either
branch. Putting them in only one is a silent no-op for the classroom, which is
exactly what happened first time.

The class page also tells the teacher when it holds texts in a language its
students are not learning -- those texts are invisible to the whole class, and
the teacher is the only person who can do anything about it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Review follow-ups.

- `cohort.language` is null for a class whose language was never set, and every
  language then failed the "is this off-language?" test, so the banner claimed
  the whole list was unreachable and left a hole in its own sentence where the
  language name should be. Both halves were false: the student filter compares
  the *article's* language to the *student's* learned language and never
  consults the class's. Six such classes exist; none holds a text yet, which is
  the only reason this was not already visible.

- The classroom waited for getStudent before choosing an empty-state message
  but not before rendering the list, so the class tags -- which need to know
  whether the student has more than one class -- rendered absent and then
  appeared when that request landed. It waits in both paths now.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The cohort id is a number in every payload now (api#719), but useParams()
always hands back a string, so the two places that matched one against the
other were relying on the API's odd stringification to work at all.

Adds the regression this closes: a class shared during a session (ids from
/cohorts_info) and the same class after a reload (ids from /teacher_texts)
used to build two separate filter chips.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The tags shipped dead. ClassroomArticles computed inMoreThanOneClass and never
handed it to ArticlePreview, so from_classes was fetched, serialised, and
dropped on the floor.

Two things let that through, both mine:

- The edit that was meant to add the prop was a string replace against a call
  site that no longer existed -- master had since replaced dontShowSourceIcon
  with a browsingModeProps spread. Every other replace in that script asserted
  its match; this one did not, so it silently changed nothing.

- The scaffold I checked it with rendered ArticlePreview directly, passing
  showClassNames itself. It proved the component worked and never touched the
  one seam that was broken. Verified through ClassroomArticles this time.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@netlify

netlify Bot commented Aug 31, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for voluble-nougat-015dd1 ready!

Name Link
🔨 Latest commit abc8e09
🔍 Latest deploy log https://app.netlify.com/projects/voluble-nougat-015dd1/deploys/6a9566ca08572200087538f1
😎 Deploy Preview https://deploy-preview-1236--voluble-nougat-015dd1.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@mircealungu
mircealungu merged commit 8a8b670 into master Aug 31, 2026
4 checks passed
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