Feat/upgrade - #3
Open
Ahmedfurkhan wants to merge 2 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Along with the core functionality, I added a few small improvements to make the application more user-friendly and provide better feedback to users.
Files: frontend/js/prompts.js, frontend/js/create.js, frontend/css/main.css
showToast() function added to both pages
Fires after:
⭐ Rating submitted → "Rating saved!"
🗑 Prompt deleted → "Prompt deleted."
✅ Prompt created → "Prompt submitted!"
❌ Create failed → error toast in red
📋 Prompt copied → "Prompt copied to clipboard!"
Appears bottom-right, auto-dismisses after 2 seconds with fade-out
2. Moderator Queue Count
Files: db/promptDB.js, routes/mod_load.js, frontend/js/moderator.js, frontend/moderator.html, frontend/css/moderator.css
New countRecentlyDeleted() DB method
New GET /api/recently-deleted/count endpoint
Moderator page shows "Queue: 5 prompts pending review" on load
Count refreshes automatically after every load, delete, or approve action
Files: frontend/js/prompts.js, frontend/css/prompts.css
"Copy" button added to every prompt card
One click copies the full prompt text to clipboard
Button changes to "Copied!" for 2 seconds then resets
No backend needed uses browser navigator.clipboard API