Skip to content

Conversation

@snomiao
Copy link
Member

@snomiao snomiao commented Dec 3, 2025

Summary

  • Added delete publisher functionality with confirmation modal
  • Users must type the publisher ID to confirm deletion
  • Added dropdown menu next to Edit details button with delete option

Changes

  • Created DeletePublisherModal component with confirmation input requirement
  • Updated PublisherDetail component to include dropdown menu with delete option
  • Integrated useDeletePublisher API hook for deletion
  • Added analytics tracking for delete publisher action
  • Redirects to /nodes page after successful deletion

Test plan

  • Verify dropdown menu appears next to Edit details button for users with edit permissions
  • Click dropdown and verify Delete publisher option appears
  • Click delete option and verify modal appears with confirmation input
  • Test that delete button is disabled until correct publisher ID is typed
  • Verify successful deletion redirects to /nodes page and shows success toast
  • Test error handling with appropriate error messages

🤖 Generated with Claude Code

Added a dropdown menu next to the Edit details button on publisher detail pages with a delete option. The delete action triggers a confirmation modal that requires users to type the publisher ID to confirm deletion.

Changes:
- Created DeletePublisherModal component with confirmation input
- Added dropdown menu with delete option to PublisherDetail component
- Integrated useDeletePublisher hook from generated API
- Added analytics tracking for delete publisher action
- Redirects to /nodes page after successful deletion

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@vercel
Copy link

vercel bot commented Dec 3, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
registry-web Ready Ready Preview Comment Dec 3, 2025 9:58am

@snomiao snomiao marked this pull request as ready for review December 3, 2025 10:23
Copilot AI review requested due to automatic review settings December 3, 2025 10:23
@snomiao snomiao merged commit a02499a into main Dec 3, 2025
4 checks passed
@snomiao snomiao deleted the sno-publisher-delete branch December 3, 2025 10:23
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 adds the ability for users to delete publishers through a new confirmation modal. Users must type the publisher ID to confirm deletion, following the same pattern as node deletion. The implementation includes a dropdown menu next to the "Edit details" button that provides access to the delete functionality.

  • Added DeletePublisherModal component with confirmation input requirement and API integration
  • Updated PublisherDetail component with a dropdown menu containing the delete publisher option
  • Added comprehensive internationalization support across 9 locale files

Reviewed changes

Copilot reviewed 11 out of 13 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
components/publisher/DeletePublisherModal.tsx New modal component for publisher deletion with confirmation input validation
components/publisher/PublisherDetail.tsx Added dropdown menu with delete option and integrated delete modal
locales/en/common.json Added English translations for delete publisher functionality
locales/zh/common.json Added Chinese translations and removed duplicate entries
locales/tr/common.json Added Turkish translations and removed duplicate entries
locales/ru/common.json Added Russian translations and removed duplicate entries
locales/ko/common.json Added Korean translations and removed duplicate entry
locales/ja/common.json Added Japanese translations and removed duplicate entries
locales/fr/common.json Added French translations (contains translation errors)
locales/es/common.json Added Spanish translations (contains incorrect Chinese text)
locales/ar/common.json Added Arabic translations and removed duplicate entry
bun.lock Standard lockfile update
Comments suppressed due to low confidence (2)

components/publisher/DeletePublisherModal.tsx:25

  • Unused variable qc.
  const qc = useQueryClient()

components/publisher/PublisherDetail.tsx:33

  • Unused variable error.
    error,

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

"Failed to delete node": "Error al eliminar el nodo",
"Failed to delete node. {{message}}": "No se pudo eliminar el nodo. {{message}}",
"Failed to delete publisher": "Error al eliminar el editor",
"Failed to delete publisher. {{message}}": "删除发布者失败。{{message}}",
Copy link

Copilot AI Dec 3, 2025

Choose a reason for hiding this comment

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

This translation contains Chinese text instead of Spanish. The translation should be in Spanish, similar to "Error al eliminar el editor. {{message}}" to match the pattern at line 164.

Suggested change
"Failed to delete publisher. {{message}}": "删除发布者失败。{{message}}",
"Failed to delete publisher. {{message}}": "No se pudo eliminar el editor. {{message}}",

Copilot uses AI. Check for mistakes.
const { t } = useNextTranslation()
const mutation = useDeletePublisher({})
const router = useRouter()
const qc = useQueryClient()
Copy link

Copilot AI Dec 3, 2025

Choose a reason for hiding this comment

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

The qc (useQueryClient) variable is declared but never used. Unlike the similar NodeDeleteModal component which uses it to invalidate query cache (line 53-59), this modal doesn't perform any cache invalidation after deletion. Consider removing this unused variable or implementing cache invalidation if needed.

Copilot uses AI. Check for mistakes.
"Failed to delete publisher": "Error al eliminar el editor",
"Failed to delete publisher. {{message}}": "删除发布者失败。{{message}}",
"Failed to delete version": "Error al eliminar la versión",
"Failed to delete version: {{message}}": "无法删除版本:{{message}}",
Copy link

Copilot AI Dec 3, 2025

Choose a reason for hiding this comment

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

This translation contains Chinese text instead of Spanish. The translation should be in Spanish, similar to "Error al eliminar la versión: {{message}}" to match the pattern at line 166.

Suggested change
"Failed to delete version: {{message}}": "无法删除版本:{{message}}",
"Failed to delete version: {{message}}": "No se pudo eliminar la versión: {{message}}",

Copilot uses AI. Check for mistakes.
"Failed to delete publisher": "Échec de la suppression de l'éditeur",
"Failed to delete publisher. {{message}}": "Échec de la suppression de l'éditeur. {{message}}",
"Failed to delete version": "Échec de la suppression de la version",
"Failed to delete version: {{message}}": "无法删除版本:{{message}}",
Copy link

Copilot AI Dec 3, 2025

Choose a reason for hiding this comment

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

This translation contains Chinese text instead of French. The translation should be in French, similar to "Échec de la suppression de la version : {{message}}" to match the pattern at line 166.

Suggested change
"Failed to delete version: {{message}}": "无法删除版本:{{message}}",
"Failed to delete version: {{message}}": "Échec de la suppression de la version : {{message}}",

Copilot uses AI. Check for mistakes.
Comment on lines +106 to +108
"Delete Publisher": "Supprimer le publieur",
"Delete Version": "Supprimer la version",
"Delete publisher": "Supprimer le publieur",
Copy link

Copilot AI Dec 3, 2025

Choose a reason for hiding this comment

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

The French translation "publieur" is incorrect. The correct French word for "publisher" is "éditeur". This should be "Supprimer l'éditeur" to match the translation pattern used elsewhere in the file (e.g., line 294 "L'ID de l'éditeur").

Suggested change
"Delete Publisher": "Supprimer le publieur",
"Delete Version": "Supprimer la version",
"Delete publisher": "Supprimer le publieur",
"Delete Publisher": "Supprimer l'éditeur",
"Delete Version": "Supprimer la version",
"Delete publisher": "Supprimer l'éditeur",

Copilot uses AI. Check for mistakes.
"Delete Node": "Supprimer le nœud",
"Delete Publisher": "Supprimer le publieur",
"Delete Version": "Supprimer la version",
"Delete publisher": "Supprimer le publieur",
Copy link

Copilot AI Dec 3, 2025

Choose a reason for hiding this comment

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

The French translation "publieur" is incorrect. The correct French word for "publisher" is "éditeur". This should be "Supprimer l'éditeur" to match the translation pattern used elsewhere in the file.

Suggested change
"Delete publisher": "Supprimer le publieur",
"Delete publisher": "Supprimer l'éditeur",

Copilot uses AI. Check for mistakes.
@snomiao
Copy link
Member Author

snomiao commented Dec 3, 2025

@copilot open a new pull request to apply changes based on the review comments in this thread

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