[Feature] Add seated arrow-key desk navigation and improve seating user experience

Đang mở
#121 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

@rishavvrajj đang làm issue này rồi.

Từ ngày 16/10/2026.

  • #122 của @rishavvrajj — đang mở

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
25/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
html, javascript
Lĩnh vực
frontend

Hướng nghiên cứu

Everything is in public/classroom_poc.html: the arrow-key handler belongs where isSeated is checked, keysPressed is reset on leave_seat and seat_left, renderDesks() holds the row spacing, and showToast is the toast to stub out. Pull request #122 is already open against this work, so check it before starting. Done means the seated arrow-key navigation, the keysPressed reset, the spacing change and the toast removal all work as the testing steps describe.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Overview

This proposal improves the virtual classroom seating experience in public/classroom_poc.html.

Currently, users can sit at a desk but cannot easily move to another desk while seated. This change adds arrow-key navigation between adjacent available desks, fixes movement state after standing up, improves row spacing, and removes intrusive toast notifications.

Proposed improvements

  • Allow seated users to move between adjacent available desks using ↑, ↓, ←, and →.
  • Prevent movement keys from becoming stuck after a user stands up by resetting keysPressed.
  • Increase vertical spacing between desk rows so username labels do not overlap desks or chairs above them.
  • Remove toast notifications for a cleaner classroom UI.
  • Prevent arrow keys from scrolling the page or interfering with chat input while navigating seats.

Expected behavior

When seated:

  • Pressing an arrow key attempts to move the user to the adjacent desk in that direction.
  • Movement is blocked if the target seat is occupied or out of bounds.
  • The client sends an update_seat event for valid seat changes.
  • Pressing E while seated lets the user stand up.
  • After standing up, normal character movement works immediately.

Implementation notes

Changes are limited to public/classroom_poc.html:

  • Add an arrow-key handler when isSeated === true.
  • Calculate the target desk row/column and validate it before sending update_seat.
  • Show a non-intrusive message when the target seat is already taken.
  • Reset keysPressed = {} on leave_seat and seat_left.
  • Update renderDesks() spacing using startTop = 20 and rowStep = 28.
  • Replace showToast with a no-op and remove the toast container.
  • Call preventDefault() for arrow keys and E when the user is not typing in an input field.

Testing steps

  1. Open /classroom_poc?autojoin=1&room=lobby while signed in.
  2. Walk to an available desk and press E to sit.
  3. Press ↑, ↓, ←, and → to move between adjacent available desks.
  4. Try moving into an occupied seat and confirm the move is blocked.
  5. Press E to stand up.
  6. Confirm that walking movement works immediately after standing.
  7. Confirm username labels no longer overlap desks in the row above.
  8. Confirm arrow keys do not scroll the page while seat navigation is active.

Screen recording

https://github.com/user-attachments/assets/9f3ff8c5-1074-4da6-b461-9017e9989fe6

  • Sitting at a desk with E
  • Moving between available desks with arrow keys
  • Attempting to move into an occupied seat
  • Standing up and immediately walking again
  • Improved spacing between desk rows

Acceptance criteria

  • Seated users can navigate to adjacent available desks with arrow keys.
  • Occupied and out-of-bounds seats cannot be selected.
  • keysPressed resets after standing up.
  • Arrow keys do not scroll the page or interfere with chat input.
  • Desk-row spacing prevents username-label overlap.
  • Toast notifications no longer appear.
Ngôn ngữ chính
HTML
Star
3
Fork
29
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của alphaonelabs/learn

Tất cả issue của alphaonelabs/learn

Issue tương tự

Thêm issue về Web Dev

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.