Repository navigation
Fix bugs in the course pages that the frontend upgrade's reviews found - #35
Merged
Merged
Conversation
- A group page for a group that doesn't exist: load_group raised (a 500), and the page asked again on every render, nonstop. The server answers nothing, the page asks once, from an effect, and shows Not found. - Next Ticket, or any move from one ticket or group page to another, kept the previous page's state: its assignment and question (#24), a half-typed description, and a ticket that was never loaded. Each ticket and group now gets a new page. bootstrap-select chose its placeholder when it set up the new page's assignment menu, so SelectPicker chooses the value again. - A settings Save button stayed disabled after a failed save, since a failed request never calls its callback. makeRequest returns a promise that settles either way, and the form waits on that. - A ticket or group with no question showed "QNaN". - Party groups were sorted with a one-argument comparator, which leaves the order undefined; they're sorted by ID. - MagicWordDisplay set state while rendering. It fetches a timed magic word from an effect, right away rather than after the first ten seconds. Closes #24 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #35 +/- ##
==========================================
+ Coverage 77.55% 77.63% +0.07%
==========================================
Files 11 11
Lines 1368 1368
Branches 195 195
==========================================
+ Hits 1061 1062 +1
+ Misses 251 248 -3
- Partials 56 58 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
🚀 Staging Preview Deployed! |
- A group page whose request failed (the network down for a moment) stayed
on "loading..." for good: it asks again whenever the connection comes back.
- An ID that isn't a group's, such as /groups/abc, got an error back that was
stored as a group, so the page never said it isn't found. Only a group with
that ID counts as one.
- Only a question of digits is shown as a number ("Q3"), so "1e3" or
"Infinity" are shown as they are.
- A timed magic word is forgotten when the mode changes, so an old one isn't
shown if timed mode comes back.
- The empty question test waits for the group's card, and watch_requests can
fail only the first few requests to an endpoint.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Bugs on
mainthat the reviews of #27 found in code that PR touched, and left for a separate PR.Closes #24
Fixes
load_groupused.one()), and the page asked again on every render, so it sent requests nonstop with the offline banner showing. The server now answersnull(asload_ticketdoes), and the page asks once, from an effect (again if the request fails, once it's back online), then shows Not found. An ID that isn't a number, such as/groups/abc, also shows Not found.ByIDinapp.jsxkeys it by the URL's ID).SelectPickernow chooses the value again after setting it up.Socket.emitandmakeRequestnow return a promise of whether the request succeeded, settled either way, andConfigLinkedwaits on that. Callbacks still only run on success, since several use the response directly.(x) => x.id), which leaves the order up to the browser. They're sorted by ID.MagicWordDisplayset state while rendering. It's a function component that fetches a timed magic word from an effect, right away rather than after the first ten seconds, and stops when the mode changes.Testing
mainand passes here: a missing group's page asks once and shows Not found, asks again after a failed request, and/groups/abcshows Not found; a group with no question doesn't show "QNaN"; a failed save leaves the Save button usable; Next Ticket shows the next ticket's assignment and question, in bootstrap-select's menu too; staff see a timed magic word within five seconds. They use a newwatch_requestshelper intests/e2e/conftest.py, which counts the page's API requests and can make some fail.load_groupanswersnullfor a missing group.pytest(123),pytest tests/e2e(33),flake8,yarn lint,yarn typecheck,yarn build. The screenshots of every page are unchanged from before Build the frontend with Vite, and upgrade React and React Router #27 apart from relative times, except a missing group's page, which shows Not found.🤖 Generated with Claude Code