[Rebrand] RE-107: section sign-in page → design-system components (React)#73377
Draft
levadadenys wants to merge 1 commit into
Draft
[Rebrand] RE-107: section sign-in page → design-system components (React)#73377levadadenys wants to merge 1 commit into
levadadenys wants to merge 1 commit into
Conversation
7921e1a to
a8c1a0e
Compare
a8c1a0e to
df85b8a
Compare
…omponents The student "sign in to a section" page (sections#show, /sections/:code) was server-rendered HAML (raw name/secret-picture tiles + jQuery reveal flow + .btn-primary login). Replace it with a React component (SectionSignIn) built from DSCO components: DSCO Chips (name selection, driven as single-select), MUI Typography, DSCO TextField (word login), DSCO Checkbox (pair-programming), MUI Button (login). The secret-picture tiles are an image grid with no DSCO equivalent, so they stay custom buttons styled with semantic tokens. The interactive flow is preserved in React state (pick name -> reveal secret picture/word + show login; pick secret -> enable login + show pairing checkbox), and submission stays a native POST to /sections/:code/log_in carrying the Rails CSRF token, so server-side authentication is unchanged. Translated copy, student/secret-picture data, CSRF token, and submit path are passed from the view; clientState.reset() still runs on submit. Mount is deferred to DOMContentLoaded since the entry script precedes the mount div. Removes the now-dead #signinsection block from application.scss. Reuses the existing sections/show webpack entry (name unchanged). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
df85b8a to
7cc1fea
Compare
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.
Summary
Rebuilds the student section sign-in page (
sections#show,/sections/:code)with design-system components. The page was server-rendered HAML (raw
name/secret-picture tiles driven by jQuery, a word-login text field, a
pair-programming checkbox, and a
.btn-primarylogin button); it's now a Reactcomponent (
SectionSignIn) built from DSCO components.What changed
SectionSignIn.jsx(new) — MUITypography(welcome + instructions),DSCO
TextField(word login), DSCOCheckbox(pair-programming), MUIButton(login). The name/secret-picture selection tiles have no DSCO equivalent,
so they're custom
<button>s styled with semantic tokens (neutraldefault/hover,
--background-brand-teal-lightselected).sections/show.js— the entry now mounts the React component (was jQuery);mount deferred to
DOMContentLoaded(the entry script precedes the mount div).sections/show.html.haml— replaced the form markup with a mount point +a
<script>carrying the data; kept the student-privacy footnoteserver-rendered (markdown + link).
application.scss— removed the now-dead#signinsectionblock.Interactive flow + submission preserved
React state replicates the legacy flow: pick a name → reveal the secret
picture grid / word field and show the (disabled) login; pick a secret → enable
login and show the pairing checkbox; picking a different name resets the secret.
The form is still a native POST to
/sections/:code/log_inwith the RailsCSRF token (hidden
user_id/secret_picture_id/secret_words/show_pairing_dialog), so server-side authentication is unchanged.clientState.reset()still runs on submit. Translated copy, student +secret-picture data (picture URLs via
image_path), CSRF token, and submit pathare passed from the view.
Links
Testing story
./tools/hooks/pre-commitclean;yarn buildsucceeds (reuses thesections/showentry).codeai+codeai-nextpink-audit brands): drovethe full flow on a picture-login section — name select reveals the 22-picture
grid with the login disabled and
user_idset; picture select enables login(brand-purple in prod, pink under audit), sets
secret_picture_id, and showsthe pairing checkbox; the form is a native
POST /sections/:code/log_inwiththe CSRF token. No console/page errors. Tiles resolve through DSCO tokens
(neutral in prod, pink under audit; selected = brand-teal-light).
Notes for reviewers
secret_wordsTextField) and the pairing checkboxare wired but I only had a picture-login section locally — worth a QA pass on a
word-login section and on actually completing a sign-in.
they use semantic tokens per the rebrand fallback rule.