Skip to content

Improve student activity registration system#2

Merged
Matt-J-H merged 3 commits into
mainfrom
accelerate-with-copilot
Jun 18, 2026
Merged

Improve student activity registration system#2
Matt-J-H merged 3 commits into
mainfrom
accelerate-with-copilot

Conversation

@Matt-J-H

Copy link
Copy Markdown
Owner

This pull request introduces multiple improvements and new features to the activity signup application, focusing on expanding backend functionality, enhancing the frontend user experience, and increasing code reliability through testing. The most significant changes are the addition of unregister functionality for activities, improved participant management in the UI, and the introduction of comprehensive backend tests.

Backend enhancements:

  • Added support for unregistering students from activities via a new DELETE /activities/{activity_name}/signup endpoint, including validation to ensure students are only removed if currently signed up.
  • Improved signup logic to prevent duplicate registrations by checking if a student is already signed up before adding them to the participant list.
  • Expanded the set of available activities with several new clubs and teams in the activities data structure.

Frontend improvements:

  • Updated the UI to display the list of participants for each activity, including a button next to each participant to allow unregistering them directly from the interface.
  • Enhanced user feedback by implementing a reusable message display function for success and error messages, and ensured the activity list refreshes after signup or unregister actions.

Styling and user experience:

  • Added new CSS styles for the participants section, including participant lists, delete buttons, and empty state messaging, to improve the clarity and usability of the participant management UI.

Testing and reliability:

  • Introduced a comprehensive test suite for the backend FastAPI service, covering activity retrieval, signup, unregister, and error cases, with test isolation to ensure reliability.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR expands the activity signup app with unregister support, participant management in the UI, and a new backend test suite to validate core API behavior.

Changes:

  • Added a DELETE /activities/{activity_name}/signup endpoint and duplicate-signup prevention in the FastAPI backend.
  • Updated the frontend to render participants per activity and allow unregistering via per-participant UI controls, with improved messaging and refresh behavior.
  • Introduced backend API tests and added pytest to dependencies.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/app.py Adds new activities, prevents duplicate registrations, and introduces an unregister endpoint.
src/static/app.js Renders participants with unregister buttons; adds reusable message UI and refreshes activity data after mutations.
src/static/styles.css Adds styling for the participants section and delete controls.
tests/test_app.py Adds API tests for listing activities, signup, unregister, and key error cases with state isolation.
requirements.txt Adds pytest to support the new test suite.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/static/app.js
Comment on lines +7 to +16
function showMessage(text, type) {
messageDiv.textContent = text;
messageDiv.className = type;
messageDiv.classList.remove("hidden");

// Hide message after 5 seconds
setTimeout(() => {
messageDiv.classList.add("hidden");
}, 5000);
}
Comment thread src/static/app.js
Comment on lines +35 to +43
const participantsMarkup =
details.participants.length > 0
? `<ul class="participants-list">${details.participants
.map(
(participant) =>
`<li><span class="participant-email">${participant}</span><button type="button" class="participant-delete" data-activity="${encodeURIComponent(name)}" data-email="${encodeURIComponent(participant)}" aria-label="Unregister ${participant}" title="Unregister participant">x</button></li>`
)
.join("")}</ul>`
: '<p class="participants-empty">No participants yet.</p>';
@Matt-J-H
Matt-J-H merged commit ad1bc64 into main Jun 18, 2026
4 checks passed
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.

2 participants