DOMjudge / domjudge

DOMjudge programming contest jury system
https://www.domjudge.org
GNU General Public License v2.0
739 stars 258 forks source link

Fix #2701: Do not show shortcut box when modifier key is pressed #2721

Closed mpsijm closed 1 month ago

mpsijm commented 2 months ago

The fix itself (first commit) was quite easy to add :smile:

While I was at it, I also implemented an additional quality-of-life feature, for the following scenario:

In this scenario, it used to be the case that the "shortcut box" would stay visible. With the second commit, I make sure that the shortcut state is reset before performing the redirect, to make sure that it does not linger when moving back to the previous page.

Tested locally with this diff, see #1072 and #2588 ```diff diff --git a/judge/create_cgroups.in b/judge/create_cgroups.in index 56d1338a3..a36eb8c00 100755 --- a/judge/create_cgroups.in +++ b/judge/create_cgroups.in @@ -16,8 +16,9 @@ cgroup_error_and_usage () { On modern distros (e.g. Debian bullseye and Ubuntu Jammy Jellyfish) which have cgroup v2 enabled by default, you need to add 'systemd.unified_cgroup_hierarchy=0' as well. 2. Run update-grub - 3. Reboot" >&2 - exit 1 + 3. Reboot + (ignoring for now, hehe)" >&2 + exit 0 } for i in cpuset memory; do ```
eldering commented 2 months ago
* Use the browser back button (or mouse button 4)
  It used to be the case that the "shortcut box" would stay visible. With the second commit, I make sure that the shortcut state is reset before performing the redirect, to make sure that it does not linger when moving back to the previous page.

Hmmm, could this have been related to the weird behaviour when using back/forward buttons and these keyboard shortcuts I saw in Astana, going to the wrong page @meisterT ?

meisterT commented 1 month ago

Use keyboard shortcuts to navigate to a specific entity (e.g. s42 for submission with ID 42)

This should have worked already, so I am wondering what you fixed in this regard.

mpsijm commented 1 month ago

In the second commit in this branch, I prevent the shortcut box from staying visible when going back in the browser history. Here are some screen recordings to show what happens. In both recordings, I press c and Enter, and click "Back".

Before d0a14d8 (the "c" reappears after clicking "back") After d0a14d8 (when clicking "back", the "c" is gone)
https://github.com/user-attachments/assets/cf61bcb2-31c1-46a9-a6be-ee7efea5665b https://github.com/user-attachments/assets/0f377e02-3202-409e-be8a-20107aaea839
meisterT commented 1 month ago

Beautiful, thanks!