Skip to content

Feat/upgrade - #3

Open
Ahmedfurkhan wants to merge 2 commits into
clbarry:mainfrom
Ahmedfurkhan:feat/upgrade
Open

Feat/upgrade#3
Ahmedfurkhan wants to merge 2 commits into
clbarry:mainfrom
Ahmedfurkhan:feat/upgrade

Conversation

@Ahmedfurkhan

Copy link
Copy Markdown

Along with the core functionality, I added a few small improvements to make the application more user-friendly and provide better feedback to users.

  1. Toast Notifications
    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

  1. Copy Button
    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

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.

1 participant