Repository navigation
Conversation
Optional follow-up from the audit (not a full schedule editor). The ramp
schedule textarea is taller (8 rows, 10rem) so a two-step schedule fits
without scrolling, and spellcheck is off for the JSON. Invalid JSON now
also leaves a message under the field ("Not valid JSON: <parser
message>", aria-invalid + aria-describedby via showFieldError) and moves
focus there; the existing toast stays.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 59 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This was referenced Oct 29, 2026
Collaborator
Author
|
Replaced by #1623: the same branch and commits, reopened from LeanerCloud/cloud-commitments-platform so it can be part of a native GitHub stack (cross-fork stacks aren't supported). Please review there. |
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.
The ladder config dialog's Ramp Schedule (JSON) field was four rows tall, so a pretty-printed schedule showed only its first step, and invalid JSON was reported only by a toast in the corner ("Ramp schedule is not valid JSON.") with nothing at the field and no hint of where the error was. This PR makes the field taller, turns spellcheck off for it, and also shows the parser's message under the field, marked invalid, with focus moved there. It is a small follow-up from the audit; the visual step editor is #1605.
Part of the UI modernization sweep.
What changed
frontend/src/ladder-config-modal.ts: the textarea isrows="8"(was 4) withspellcheck="false".frontend/src/styles/ladder-form.css: its minimum height is 10rem (was 6rem), with a 1.45 line height.frontend/src/ladder.ts(saveLadderConfig): whenJSON.parsefails, the existing toast still shows, and the field also getsshowFieldError(field, "Not valid JSON: <parser message>")fromlib/field-errors.ts(the shared helper: a.field-errornote after the field,aria-invalid="true", the note's id added toaria-describedby, cleared on the next edit). Focus moves to the field. Nothing is saved, as before.Why
The parser message gives a position ("at position 62 (line 2 column 20)"), which is what someone needs to fix a hand-edited schedule; the toast alone said only that something was wrong and disappeared. Putting the message on the field also makes it available to screen readers through
aria-describedby.Screenshots
Before = main at 43dd618, after = this branch. Headless Chromium at 1440x900 against a mocked API, Admin > Purchasing, ladder config Edit for the first account. The invalid-JSON pair was taken at 1440x1200 with a one-off script that types a schedule with a missing comma and presses Save Config (the shared tour does not reach that state); it uses the same mocked API.
Verification
Run on this branch's head
cb79608d, fromfrontend/:npm run typecheck: pass.npm run lint: 0 errors (141 warnings).npm run build: pass.e2e-local.sh): 276 passed.Notes for review
aria-invalidand the note, no save call) would be cheap to add if wanted.JSON.parseand differs between browsers.Overlaps
frontend/src/styles/ladder-form.css: ui(dialogs): one dialog chrome with a header close button #1598 (removes the dialog's private chrome block) and ui(settings): laddering and planned purchases section spacing #1607; both merge cleanly with this one.frontend/src/ladder.ts: ui(settings): laddering and planned purchases section spacing #1607.Note for the UI owner
This changes UI code that @cristim owns. IAmJSD reviewed the before/after screenshots and asked for these PRs; any design point you disagree with can be a follow-up.
🤖 Generated with Claude Code