Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[v4 beta] Include descendants in hierarchy delete confirmation counts

Open
#18,870 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@dharshni1518 is already working on this.

Since Oct 22, 2026.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
52/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Domain
backend, frontend

Research direction

Start with packages/ui/src/providers/DocumentSelection/index.tsx and packages/ui/src/elements/DeleteMany/index.tsx to trace how selected IDs reach the confirmation, then read packages/payload/src/hierarchy/hooks/collectionBeforeDelete.ts for cascade behavior. Check the single-document confirmation path and how Trash changes deletion behavior. Done means single and bulk confirmations report the unique total and descendant count using the server-side deletion rules, including when selected documents overlap.

Written by the indexing model from the issue text.

Description

Bug

Permanently deleting a hierarchy parent can also delete its children and deeper descendants. The Admin confirmation currently describes only the selected document, or the selected-document count for bulk deletion.

For example, selecting one parent with 12 descendants should warn that 13 documents will be permanently deleted. Showing only the parent or a count of 1 hides the full effect.

Cascade deletion is useful; its complete impact should be visible before confirmation.

Expected behavior

Show the total number of unique documents affected, including descendants at every depth:

Permanently delete 13 pages? This includes 1 selected page and 12 descendants.

This should:

  • Cover single-document and bulk deletion from collection and hierarchy views.
  • Count each document once when both a parent and its descendant are selected.
  • Distinguish permanent deletion from moving documents to Trash.
  • Distinguish deleted documents from related documents whose hierarchy reference is only cleared.
  • Calculate the count server-side using the same selection and cascade rules as deletion.
Suggested reproduction

Use a collection with hierarchy: { parentFieldName: 'parent' }, a required text title field, and trash: false.

  1. Create Parent → Child → Grandchild.
  2. Open Parent and choose Delete. Inspect the confirmation without confirming.
  3. Repeat by selecting only Parent in the hierarchy list and choosing Delete.
  4. The confirmation should explain that 3 documents, including 2 descendants, will be deleted.
Source evidence

Inspected 4.0.0-beta.3; the same selection-count and cascade logic remains on main as of October 20, 2026.

This report is based on source inspection. These steps have not yet been run in a local beta application.

Dominant language
TypeScript
Stars
45.5k
Forks
4.3k
Avg merge
1d 19h
Merged PRs (30d)
309

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

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 payloadcms/payload

All issues in payloadcms/payload

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.