Skip to content

Feat : Add "Clear All History" button with confirmation to history/page.tsx#2002

Open
hrx01-dev wants to merge 1 commit into
RatLoopz:mainfrom
hrx01-dev:feat/Add-Clear-AllHistory-button-with-confirmation-to-history/page.tsx
Open

Feat : Add "Clear All History" button with confirmation to history/page.tsx#2002
hrx01-dev wants to merge 1 commit into
RatLoopz:mainfrom
hrx01-dev:feat/Add-Clear-AllHistory-button-with-confirmation-to-history/page.tsx

Conversation

@hrx01-dev

Copy link
Copy Markdown
Contributor

🛑 STOP: Assignment & File Scope Check

  • I am assigned to this issue.
  • I verified that this PR ONLY touches the required files.

Warning

PRs with unrelated files will not be reviewed and may be closed.

📋 PR Summary & Link

  • **Closes [FEATURE] Add "Clear All History" button with confirmation to history/page.tsx #1952 **
  • Summary:
    • The button is wrapped in a conditional check: {history.length > 0 && (...), ensuring it only renders when there are items in the history.
    • Clicking the "Clear All" button sets showClearConfirmation to true. This state variable then conditionally renders a dedicated div containing the "Are you sure?" message and confirmation buttons, rather than using window.confirm().
    • The "Confirm" button within the confirmation UI triggers handleClearAllHistory. This function calls await clearScanHistory(), which deletes all history entries, and then await loadHistory() to refresh the UI, effectively showing the empty state.

📸 Proof of Work (Screenshots / Logs)

Important

No Pull Request will be merged without proof of testing!

  • Frontend/UI changes: You MUST attach screenshots or screen recordings (GIFs/Videos) showing the UI changes.

Please drag & drop your screenshots/GIFs here:

🏷️ PR Type

  • 🐛 type: bug
  • type: feature
  • 📖 type: docs
  • 🧪 type: testing
  • 🔒 type: security
  • type: performance
  • 🎨 type: design
  • ♻️ type: refactor
  • 🛠️ type: devops
  • type: accessibility

✅ Checklist

  • My PR has a linked issue (Closes #123)
  • I have pulled the latest main and resolved any conflicts

@dipexplorer

Copy link
Copy Markdown
Member

Hey @hrx01-dev 👋, u used translation keys like t("clear_all_button"), t("clear_confirm_message"), t("clear_cancel_button"), and t("clear_confirm_button") in the code, but u didn't add these keys to the actual translation files (e.g., apps/web/messages/en.json).

Bcz of this, next-intl will fail to find the translations and will render the raw key names on the UI (like History.clear_all_button) instead of actual text.

update this PR by adding the missing keys to apps/web/messages/en.json under the correct namespace. Once added, I'll be happy to approve and merge it!

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

Labels

good first issue Good for newcomers gssoc:approved Approved for gssoc level:intermediate 35 pts quality:clean multiplier x1.2 type:feature New feature or request

Projects

Status: 📥 Backlog

Development

Successfully merging this pull request may close these issues.

[FEATURE] Add "Clear All History" button with confirmation to history/page.tsx

2 participants