Skip to content

Conversation

@simonLeary42
Copy link
Collaborator

@simonLeary42 simonLeary42 commented Dec 11, 2025

demo: new random message is generated each refresh and persists across refreshes until the user clicks the X

Screen.Recording.2025-12-11.at.3.21.16.PM.mov

demo 2: error message on POST

Screen.Recording.2025-12-11.at.3.23.24.PM.mov

Copy link
Contributor

Copilot AI left a comment

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 implements AJAX-based deletion of user messages, allowing messages to persist across page refreshes until explicitly dismissed by clicking the X button. The implementation adds a new AJAX endpoint and supporting methods to the UnityHTTPD library.

Key Changes:

  • Added AJAX endpoint for deleting individual messages based on level, title, and body pattern matching
  • Implemented getMessage() and deleteMessage() methods in UnityHTTPD for message management
  • Modified message display template to call the AJAX endpoint instead of immediately hiding messages
  • Removed automatic message clearing and replaced test helper function with direct getMessage() calls

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
webroot/panel/ajax/delete_message.php New AJAX endpoint that handles POST requests to delete messages from session storage
resources/lib/UnityHTTPD.php Added getMessage(), deleteMessage(), and getMessageIndex() methods; refactored getPostData() with more explicit validation
resources/templates/header.php Modified message display to include AJAX call for deletion and removed automatic clearMessages() call
resources/lib/exceptions/UnityHTTPDMessageNotFoundException.php New exception class for when a message matching the criteria is not found
resources/autoload.php Added require statement for new exception class
test/phpunit-bootstrap.php Added require for new exception and removed assertMessageExists() helper function
test/functional/PIMemberRequestTest.php Replaced assertMessageExists() call with getMessage()

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

@simonLeary42 simonLeary42 marked this pull request as ready for review December 11, 2025 21:04
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