Skip to content

Let a student filter their classroom by class - #1238

Merged
mircealungu merged 1 commit into
masterfrom
wt/classroom-class-filter
Aug 31, 2026
Merged

mircealungu merged 1 commit into
masterfrom
wt/classroom-class-filter

Conversation

@mircealungu

@mircealungu mircealungu commented Aug 31, 2026

Copy link
Copy Markdown
Member

Follow-on from the class tags (#1235, #1236). The tags say which class a text is from; this lets you show one class at a time.

Why

With several classes the classroom is a merge, and a term's reading from each adds up — 49 texts across five classes for the first person to try it. Reading the label on every row to find one course's work is not a list, it's a search.

Same chips the teacher gets on My Texts, shown only to a student who has more than one class — invisible to the 2,484 who have exactly one.

Reuse

The filter helpers move out of teacher/myTextsPage/textFilters.js to utils/misc/classFilters.js, because both sides ask the same question of the same shape: the teacher's list carries shared_with (the classes they gave a text to), the student's carries from_classes (the classes it reached them through). One classesOf reads either.

Also

Fixes the filter bar flinging its last chip across the row. The push-right was on :last-child — correct on My Texts, where that's the sort control; wrong on a bar that is only chips. It's an explicit .trailing class now.

A per-class colour, tried and removed

Worth recording since the commits are in the history. Each class got a hue from the categorical palette already in colors.js, keyed off the class id so it wouldn't reshuffle, shared between the chip and the row tags.

It didn't survive contact with a real screen. At the size a chip actually renders, the 14% wash flattened the palette — three of five classes came out the same teal, the last a washed-out salmon — so the colour said nothing the name hadn't already said, while adding five hues to a page whose accent is orange. Reverted; the names were doing the work all along.

Verified

Both themes, in the browser, through the real ClassroomArticles rather than the component in isolation — clicking a chip leaves exactly that class's texts. 51 tests, build clean.

With several classes the classroom is a merge, and a term's reading from each
adds up -- 49 texts across five classes for the first person to try it. The
same chips the teacher gets on My Texts, shown only to a student who has more
than one class.

The filter helpers move out of teacher/myTextsPage to utils/misc/classFilters,
since both sides ask the same question of the same shape: the teacher's list
carries `shared_with` (the classes they gave a text to), the student's carries
`from_classes` (the classes it reached them through).

Each class gets a colour, from the categorical palette already in colors.js
(matplotlib's tab10), keyed off the class id rather than its position -- a
colour that reshuffles when the list is filtered is worse than no colour. The
chip and the tag on every row share it, which is what lets you skim for one
class instead of reading each label. Pruned to six hues that stay legible as
small text on both grounds: no grey (a class is never "the other one"), no red
(reads as an error), no olive, pink or cyan (too pale), no orange (the app's
own accent). Beyond six they repeat, which is honest -- the colour is a hint
on top of the name, never the only signal.

Also fixes the filter bar flinging its last chip across the row: the
push-right was on :last-child, which is the sort control on My Texts and a
plain chip on a bar that has only chips. Marked with a class instead.

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 05ff198
🔍 Latest deploy log https://app.netlify.com/projects/voluble-nougat-015dd1/deploys/6a95a767898a7400086d3d18
😎 Deploy Preview https://deploy-preview-1238--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 da38344 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