Skip to content

Replace manual username input with Select dropdown for student remova…#21

Open
SillyNY wants to merge 1 commit into
softwareconstruction240:mainfrom
SillyNY:main
Open

Replace manual username input with Select dropdown for student remova…#21
SillyNY wants to merge 1 commit into
softwareconstruction240:mainfrom
SillyNY:main

Conversation

@SillyNY
Copy link
Copy Markdown

@SillyNY SillyNY commented Jun 4, 2026

Summary

Replaced the manual username text input in the "Remove Student" flow with a two-step dropdown-based interface. TAs
no longer need to type or copy/paste exact usernames.

What changed

  1. Clicking Remove Student now opens a Select dropdown listing all students currently in the queue, with their
    display name, queue position, and type (help/passoff)
  2. Selecting a student opens a confirmation modal showing the student's name, with an optional reason field
  3. Removal is performed by user_id instead of string-matching the username — no more failed matches from typos

Files modified

File Change
ui/modals.py Rewrote RemoveConfirmModal: removed the username TextInput; now receives user_id + display
name via constructor; removal uses user_id directly
ui/views/ta_view.py Added RemoveStudentView class (a discord.ui.View with a dynamically populated
Select); updated the "Remove Student" button callback to show the dropdown first

Test Plan

  • Queue is empty → "Queue is empty" message shown, no dropdown
  • Queue has 1+ students → dropdown lists all of them with correct labels and queue positions
  • Selecting a student → confirmation modal opens with the correct student name displayed
  • Confirming removal → student is removed from queue, receives a DM, queue display updates
  • Optional reason field → reason text appears in the DM sent to the student
  • Race condition: two TAs open the dropdown, one removes a student, the other selects the same student → "That
    student is no longer in the queue." message shown

Notes

  • Discord Select supports a maximum of 25 options. If the queue grows beyond that, entries[:25] should be
    used (not yet implemented — CS 240 queue sizes are typically under this limit)
  • The dropdown times out after 30 seconds

Fixes: #4

…l The Remove Student button now shows a dropdown list of all students currently in the queue, eliminates exact username matching.
@TwoLettuce
Copy link
Copy Markdown
Contributor

TwoLettuce commented Jun 4, 2026

Hey @SillyNY, this is great work! A few bugs small bugs I came across while testing:

  • If you use the dropdown to select a student, then cancel the Remove Confirmation modal, you are unable to select that student again until you select another student, then reselect the first student. That might be a limitation with discord, but it is a problem if there is only one student in the queue. I suggest that you could add a "None" option that you can click in the dropdown that doesn't do anything, but allows you to again select that student.
  • In other cases when a student becomes first in the queue, they receive a message to let them know they'll be helped soon. If you would implement that for when the first student in line gets removed, that would be super helpful.

And one small improvement to the Remove Student message that includes the dropdown: I'd like it to label each emoji so that the TAs can know what they mean. Something like ✅=Passoff, ❓=Question.

If you make those changes, I'll go ahead and merge your PR!

Copy link
Copy Markdown
Contributor

@TwoLettuce TwoLettuce left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Better interface for removing student

2 participants