Show a success message after deleting a mirror

Open Beginner friendly
#525 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
next.js, typescript
Domain
frontend

Research direction

Start in src/app/[organizationId]/forks/[forkId]/page.tsx and follow how create/edit set and clear their success flash state through closeAllFlashes. Read handleOnDeleteMirror and deleteMirror to see where success is known, and only show the delete flash on success rather than refetching after an error. For the numberOfMirrorsOnPage === 1 case, replace window.location.reload() with navigating to the previous page so the flash survives. Done means deleting a mirror shows the same green confirmation as create/edit, including when it was the last mirror on the page.

Written by the indexing model from the issue text.

Description

enhancement
Is your feature request related to a problem?

Creating or editing a mirror shows a green success flash ("You have successfully created/updated…"), but deleting one shows nothing. The mirror just disappears from the list, or the page reloads if it was the last mirror on the page, so it's unclear whether the delete succeeded.

Describe the solution you'd like

Show a SuccessFlash after a successful delete, e.g. "You have successfully deleted mirror <org>/<name>.", consistent with create and edit:

  • Add delete success flash state alongside the create/edit ones in src/app/[organizationId]/forks/[forkId]/page.tsx and close it in closeAllFlashes
  • Only show it when deleteMirror succeeds. Today handleOnDeleteMirror refetches even after an error.
  • Handle the numberOfMirrorsOnPage === 1 path, where window.location.reload() would wipe the flash (e.g. go to the previous page instead of reloading)
Describe alternatives you've considered

Leaving it as is. The list refresh is the only confirmation today.

Additional context

Noticed while testing create/edit/delete for #521. Not a regression: delete has never had a success message.

Dominant language
TypeScript
Stars
203
Forks
42
Avg merge
1h 15m
Merged PRs (30d)
8

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from github-community-projects/private-mirrors

All issues in github-community-projects/private-mirrors

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.