Let a student filter their classroom by class - #1238
Merged
Merged
Conversation
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>
✅ Deploy Preview for voluble-nougat-015dd1 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.jstoutils/misc/classFilters.js, because both sides ask the same question of the same shape: the teacher's list carriesshared_with(the classes they gave a text to), the student's carriesfrom_classes(the classes it reached them through). OneclassesOfreads 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.trailingclass 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
ClassroomArticlesrather than the component in isolation — clicking a chip leaves exactly that class's texts. 51 tests, build clean.