Move criterion keyboard navigation into React components - #7989
Merged
Conversation
Shift+up/shift+down (criterion navigation) are now bound in MarksPanel's componentDidMount, removing the window.marksPanel global. Up/down/enter (rubric level navigation) are now bound in RubricCriterionInput via a useEffect, replacing jQuery DOM class mutation with a hoveredLevelIndex state value. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Mousetrap blocks all keybindings when a form input has focus. Override stopCallback to allow navigation combos (shift+up/down/left/right, ctrl+shift+right, alt+enter) through — these don't produce characters so suppression was incorrect. shift+n remains blocked while typing. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Collaborator
Coverage Report for CI Build 27080148407Coverage increased (+0.1%) to 90.304%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats💛 - Coveralls |
Mousetrap.init() creates an internal documentMousetrap instance and copies forwarding wrappers onto the constructor. At event time, stopCallback is resolved via prototype lookup on that instance, so patching the static wrapper had no effect. Patch Mousetrap.prototype.stopCallback instead. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Each criterion component now holds a ref to its root <li> and calls
scrollIntoView({ block: "nearest", behavior: "smooth" }) when its active
prop becomes true, so keyboard navigation keeps the selected criterion
visible without scrolling unnecessarily when it is already on screen.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…yDown Replaces all Mousetrap.trigger() calls in marks_panel tests with fireEvent.keyDown(), which fires real DOM events through Mousetrap's full pipeline including stopCallback. Moves the Mousetrap.prototype.stopCallback patch and a scrollIntoView stub into jest_after_env_setup.js so they apply globally. Removes workaround optional chaining (?.scrollIntoView and ?.preventDefault) from application code now that tests exercise the real path. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
david-yz-liu
force-pushed
the
criterion-navigation-keybindings
branch
from
June 6, 2026 17:51
37f1aa0 to
78dd85d
Compare
Naragod
added a commit
that referenced
this pull request
Jul 27, 2026
* Implement GET and PATCH /overall_comment API routes (#7963) Closes #7708 * build(deps): bump puma from 7.2.0 to 7.2.1 (#7994) Bumps [puma](https://github.com/puma/puma) from 7.2.0 to 7.2.1. - [Release notes](https://github.com/puma/puma/releases) - [Changelog](https://github.com/puma/puma/blob/main/History.md) - [Commits](puma/puma@v7.2.0...v7.2.1) --- updated-dependencies: - dependency-name: puma dependency-version: 7.2.1 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * build(deps): bump dompurify from 3.4.0 to 3.4.9 (#8005) Bumps [dompurify](https://github.com/cure53/DOMPurify) from 3.4.0 to 3.4.9. - [Release notes](https://github.com/cure53/DOMPurify/releases) - [Commits](cure53/DOMPurify@3.4.0...3.4.9) --- updated-dependencies: - dependency-name: dompurify dependency-version: 3.4.9 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Refactored SubmissionFilePanel subcomponents into functional style (#7969) * build(deps): bump net-imap from 0.6.4 to 0.6.4.1 (#7995) Bumps [net-imap](https://github.com/ruby/net-imap) from 0.6.4 to 0.6.4.1. - [Release notes](https://github.com/ruby/net-imap/releases) - [Commits](ruby/net-imap@v0.6.4...v0.6.4.1) --- updated-dependencies: - dependency-name: net-imap dependency-version: 0.6.4.1 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * build(deps): bump dompurify from 3.4.9 to 3.4.11 (#8009) Bumps [dompurify](https://github.com/cure53/DOMPurify) from 3.4.9 to 3.4.11. - [Release notes](https://github.com/cure53/DOMPurify/releases) - [Commits](cure53/DOMPurify@3.4.9...3.4.11) --- updated-dependencies: - dependency-name: dompurify dependency-version: 3.4.11 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Added missing NOT NULL db constraints and presence validations (#7965) Issues detected by active_record_doctor * build(deps): bump nokogiri from 1.19.3 to 1.19.4 (#8010) Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.19.3 to 1.19.4. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md) - [Commits](sparklemotion/nokogiri@v1.19.3...v1.19.4) --- updated-dependencies: - dependency-name: nokogiri dependency-version: 1.19.4 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * build(deps-dev): bump ws from 8.18.3 to 8.21.1 (#8058) Bumps [ws](https://github.com/websockets/ws) from 8.18.3 to 8.21.1. - [Release notes](https://github.com/websockets/ws/releases) - [Commits](websockets/ws@8.18.3...8.21.1) --- updated-dependencies: - dependency-name: ws dependency-version: 8.21.1 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Added case sensitivity to group search (#7938) This adds a new caseSensitiveTextFilter table component for doing case-sensitive search. * build(deps): bump concurrent-ruby from 1.3.6 to 1.3.7 (#8011) Bumps [concurrent-ruby](https://github.com/ruby-concurrency/concurrent-ruby) from 1.3.6 to 1.3.7. - [Release notes](https://github.com/ruby-concurrency/concurrent-ruby/releases) - [Changelog](https://github.com/ruby-concurrency/concurrent-ruby/blob/master/CHANGELOG.md) - [Commits](ruby-concurrency/concurrent-ruby@v1.3.6...v1.3.7) --- updated-dependencies: - dependency-name: concurrent-ruby dependency-version: 1.3.7 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Refactored group creation to set group_name and repo_name pre-validation (#7975) Also add NOT NULL constraint to groups.group_name column * Simplified Chart.js usage (#7987) * Migrated MarkingSchemesTable to React Table v8 (#7985) * Fixed merge commits being incorrectly attributed as latest submission (#7988) When an instructor cloned a student repo, made a local commit, then merged and pushed, the merge commit was treated as the latest submission for the student's files. This inflated late penalties and showed the instructor's name as author. `entry_changed?` returned true for a merge commit whenever the file differed from *any* parent — including the instructor's branch that simply didn't have the file yet. The fix: for merge commits (2+ parents), only return true when the result differs from *all* parents. If the merged content matches at least one parent the merge was trivial for that path and should not be counted as a new modification. Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> * Refactored criterion keyboard navigation (#7989) * Moved criterion and level keyboard handlers into React components (MarksPanel and RubricCrtierionInput) * Fixed keyboard criterion navigation when flexible/checkbox inputs were focused * Ensured criterion navigation causes selected criterion to scroll into view --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> * Fixed navbar MarkUs logo link URL on mobile (#7990) * Added confirmation when uploading scans for a template with no divisions (#7993) * Fixed tester spec upload when spec contains non-existent criterion (#7998) Closes #7528 * Migrated SummaryPanel marks chart modal to use react-modal (#7996) * Added release process automation scripts (#7914) * Fixed SVG rendering by converting base64 SVG data URIs to inline <svg> (#8001) * Added pagination to Admin Users table for performance (#7997) * Added confirm dialog when a student submits during late period (#8003) * Reorganized locale strings from config/locales/en.yml (#8012) * Used native HTML required validation on modal upload inputs (#8016) * Refactored group creation job updates to use websockets (#8020) * Updated database indexes (#8018) - Enforce model uniqueness validations - Remove redundant indexes These were detected by active_record_doctor:missing_unique_indexes and active_record_doctor:extraneous_indexes. * Migrated graders_manager.jsx tables to react-table v8 (#8014) * Support all annotation types in add_annotations API route (#8007) * Fixed result annotation links to display correct file (#8017) * Updated PDFViewer to persist PDF scroll across submissions (#8004) * Added assignment grades upload feature (#8008) * bump jwt from 2.10.3 to 3.2.0 (#8039) * Fix LTI test JWK fixture to use 2048-bit key for jwt 3.0 compatibility * Fixed selection column header checkbox in v8 tables (#8037) * Added migrations to add missing timestamp columns and foreign key constraints (#8040) * Fixed assignment dropdown menu redirection from Assignments#index (#8043) * Fixed escaping of HTML annotation start_node and end_node attributes (#8064) * update changelog with new release v2.10.1 [ci skip] * update markus version * Fix rubocop ArrayIntersect and spec path offenses * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Install postgresql-client-17 for CI pg_dump compatibility --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: philipkukulak <philip.kukulak@utoronto.ca> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: David Liu <david@cs.toronto.edu> Co-authored-by: Yanzhen Chen <yanzhenchen123@gmail.com> Co-authored-by: Muhammad <rafie.muhammad2007@gmail.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Co-authored-by: Daniel Rafailov <74218740+danielrafailov1@users.noreply.github.com> Co-authored-by: donny-wong <141858744+donny-wong@users.noreply.github.com> Co-authored-by: Aayush Karki <147123757+akarki2005@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.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.
Proposed Changes
Moves the grading page keyboard navigation bindings out of the global
keybinding.jsjQuery-based handlers and into the React components that own the relevant state.shift+up/shift+down(navigate between criteria) were previously implemented by exposing the entireMarksPanelclass instance aswindow.marksPaneland calling methods on it fromkeybinding.js. The global is eliminated:MarksPanelnow binds these keys directly incomponentDidMountand unbinds them incomponentWillUnmount.up/down/enter(navigate rubric levels within a criterion) were previously implemented with jQuery DOM queries ($(".active-rubric")) that mutated CSS classes directly, bypassing React.RubricCriterionInputnow tracks the highlighted level ashoveredLevelIndexstate and binds the three keys via Mousetrap while the criterion is active (and unbinds them on deactivation or unmount).Bug fixes: (1)
shift+up/shift+downwere silently suppressed whenever a flexible or checkbox criterion's<input>had focus, because Mousetrap blocks all keybindings on form elements by default. A targetedstopCallbackoverride inkeybinding.jsnow allows navigation combos. (2) Navigating between criteria now ensures the active criterion is scrolled into view.Type of Change
Checklist
Before opening your pull request:
After opening your pull request:
Questions and Comments
As a side effect, this work unblocks wrapping
MarksPanelwithReact.memoin a future PR, which would prevent the entire marks panel from re-rendering when unrelated state (e.g. the annotation dialog) changes in the parentResultcomponent.