Repository navigation
feat(category): cascade-select category tree via folder icon - #707
Merged
navneetkumar-pim-webkul merged 4 commits intoSep 15, 2026
Merged
navneetkumar-pim-webkul merged 4 commits into
navneetkumar-pim-webkul merged 4 commits into
Conversation
Clicking a category's folder icon in the product-edit category tree and the datagrid category filter now selects (or deselects) that category together with every descendant in one action, instead of requiring each subcategory to be ticked individually. The cascade resolves through a single nested-set query regardless of branch depth, guarded against oversized subtrees and against radio-input/navigate-on-select tree usages where a cascading select doesn't apply.
vipinkutthi-webkul
force-pushed
the
feat/category-tree-folder-select
branch
from
September 15, 2026 11:29
efd2481 to
b9e107c
Compare
Copilot started reviewing on behalf of
navneetkumar-pim-webkul
September 15, 2026 14:11
View session
There was a problem hiding this comment.
🟡 Changes recommended
Critical rendering and cascade concurrency issues, plus subtree synchronization defects, remain unresolved.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Adds folder-icon cascade selection for category trees, backed by a bounded descendant endpoint.
Changes:
- Adds descendant retrieval with a 5,000-node limit.
- Updates tree cascade selection and unsaved-change tracking.
- Adds localized messages and changelog documentation.
File summaries
| File | Description |
|---|---|
packages/Webkul/Category/src/Repositories/CategoryRepository.php |
Adds descendant counting and tree retrieval. |
packages/Webkul/Admin/src/Routes/catalog-routes.php |
Registers the descendants endpoint. |
packages/Webkul/Admin/src/Resources/views/components/tree/item.blade.php |
Implements folder cascade behavior. |
packages/Webkul/Admin/src/Resources/views/components/tree/category/view.blade.php |
Configures the endpoint and dirty tracking. |
packages/Webkul/Admin/src/Resources/views/catalog/products/edit/categories.blade.php |
Enables category unsaved-change tracking. |
packages/Webkul/Admin/src/Resources/lang/zh_TW/app.php |
Adds localized overflow messaging. |
packages/Webkul/Admin/src/Resources/lang/zh_CN/app.php |
Adds localized overflow messaging. |
packages/Webkul/Admin/src/Resources/lang/vi_VN/app.php |
Adds localized overflow messaging. |
packages/Webkul/Admin/src/Resources/lang/uk_UA/app.php |
Adds localized overflow messaging. |
packages/Webkul/Admin/src/Resources/lang/tr_TR/app.php |
Adds localized overflow messaging. |
packages/Webkul/Admin/src/Resources/lang/tl_PH/app.php |
Adds localized overflow messaging. |
packages/Webkul/Admin/src/Resources/lang/sv_SE/app.php |
Adds localized overflow messaging. |
packages/Webkul/Admin/src/Resources/lang/ru_RU/app.php |
Adds localized overflow messaging. |
packages/Webkul/Admin/src/Resources/lang/ro_RO/app.php |
Adds localized overflow messaging. |
packages/Webkul/Admin/src/Resources/lang/pt_PT/app.php |
Adds localized overflow messaging. |
packages/Webkul/Admin/src/Resources/lang/pt_BR/app.php |
Adds localized overflow messaging. |
packages/Webkul/Admin/src/Resources/lang/pl_PL/app.php |
Adds localized overflow messaging. |
packages/Webkul/Admin/src/Resources/lang/no_NO/app.php |
Adds localized overflow messaging. |
packages/Webkul/Admin/src/Resources/lang/nl_NL/app.php |
Adds localized overflow messaging. |
packages/Webkul/Admin/src/Resources/lang/mn_MN/app.php |
Adds localized overflow messaging. |
packages/Webkul/Admin/src/Resources/lang/ko_KR/app.php |
Adds localized overflow messaging. |
packages/Webkul/Admin/src/Resources/lang/ja_JP/app.php |
Adds localized overflow messaging. |
packages/Webkul/Admin/src/Resources/lang/it_IT/app.php |
Adds localized overflow messaging. |
packages/Webkul/Admin/src/Resources/lang/id_ID/app.php |
Adds localized overflow messaging. |
packages/Webkul/Admin/src/Resources/lang/hr_HR/app.php |
Adds localized overflow messaging. |
packages/Webkul/Admin/src/Resources/lang/hi_IN/app.php |
Adds localized overflow messaging. |
packages/Webkul/Admin/src/Resources/lang/fr_FR/app.php |
Adds localized overflow messaging. |
packages/Webkul/Admin/src/Resources/lang/fi_FI/app.php |
Adds localized overflow messaging. |
packages/Webkul/Admin/src/Resources/lang/es_VE/app.php |
Adds localized overflow messaging. |
packages/Webkul/Admin/src/Resources/lang/es_ES/app.php |
Adds localized overflow messaging. |
packages/Webkul/Admin/src/Resources/lang/en_US/app.php |
Adds localized overflow messaging. |
packages/Webkul/Admin/src/Resources/lang/en_NZ/app.php |
Adds localized overflow messaging. |
packages/Webkul/Admin/src/Resources/lang/en_GB/app.php |
Adds localized overflow messaging. |
packages/Webkul/Admin/src/Resources/lang/en_AU/app.php |
Adds localized overflow messaging. |
packages/Webkul/Admin/src/Resources/lang/de_DE/app.php |
Adds localized overflow messaging. |
packages/Webkul/Admin/src/Resources/lang/da_DK/app.php |
Adds localized overflow messaging. |
packages/Webkul/Admin/src/Resources/lang/ca_ES/app.php |
Adds localized overflow messaging. |
packages/Webkul/Admin/src/Resources/lang/ar_AE/app.php |
Adds localized overflow messaging. |
packages/Webkul/Admin/src/Http/Requests/CategoryDescendantsForm.php |
Validates and authorizes descendant requests. |
packages/Webkul/Admin/src/Http/Controllers/Catalog/CategoryController.php |
Serves bounded descendant trees. |
CHANGELOG.md |
Documents the feature. |
Review details
Suppressed comments (3)
packages/Webkul/Admin/src/Resources/views/components/tree/item.blade.php:560
- The cascade mutates
childrenand immediately emitschange-input, but the newly fetched descendant components do not mount (and therefore do not register their labels) until Vue's next render.v-product-categories.onTreeSelection()snapshotsthis.$refs.tree.labelsduring this event, so the newly selected codes are missing fromlabelByCodeand the category summary falls back to a count until another selection event occurs. Wait for the render tick before emitting, or register the fetched labels directly.
packages/Webkul/Admin/src/Resources/views/components/tree/item.blade.php:617 - The recursive sync also visits leaf nodes. For a mounted leaf,
childrenis empty, so settinghasFetchedChildrenandshowChildrenhere gives it a chevron and an empty expandable branch after a parent cascade. Only synchronize mounted descendants whenchildren.lengthis non-zero.
packages/Webkul/Admin/src/Resources/views/components/tree/item.blade.php:571 - This request sends only the category id, while the initial product category tree explicitly requests the active channel locale (
categories.blade.php:268).CategoryTreeResourceresolves labels from the request locale and otherwise uses the global requested locale, so when the editor falls back to a channel's first locale the newly fetched subtree can switch languages. Pass the active locale through this component and validate/use it in the descendants request.
- Files reviewed: 41/41 changed files
- Comments generated: 5
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…es, and stale locale - Add tree-wide cascadeInFlight guard so rapid folder clicks can't overlap - Guard leaf nodes from being marked expandable after a cascade fetch - Pass locale through to the descendants endpoint and resolve names in it - Add a11y: role="button", tabindex, aria-label, Enter/Space on folder icon - Await nextTick before emitting select-node/change-input so labels are ready - Add declare(strict_types=1) to CategoryDescendantsForm - Add descendants-endpoint test coverage: full subtree, locale, auth, 422 cap
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.