[PR #3126] [MERGED] chore: type and UX improvement for SmartTree #4245

Closed
opened 2026-03-17 01:47:50 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hoppscotch/hoppscotch/pull/3126
Author: @anwarulislam
Created: 6/8/2023
Status: Merged
Merged: 8/2/2023
Merged by: @AndrewBastin

Base: release/2023.8.0Head: chore/smart-tree-improvement


📝 Commits (3)

  • 2aa2423 chore: type and ux improvement for smarttree
  • d7a54e4 chore: update prop name
  • 10ee3ff chore: simplified isOnlyRootChild checking

📊 Changes

3 files changed (+48 additions, -67 deletions)

View changed files

📝 packages/hoppscotch-common/src/components/collections/Collection.vue (+38 -64)
📝 packages/hoppscotch-common/src/components/smart/Tree.vue (+1 -0)
📝 packages/hoppscotch-common/src/components/smart/TreeBranch.vue (+9 -3)

📄 Description

🤖 Generated by Copilot at ef9bd74

Summary

🛠️🎨

Improved the UX of the Collection and Tree components. Refactored some props and collapse/expand logic. Removed unnecessary code.

Previous: By default, we keep all collections collapsed.

Now: If there is only one single collection we will expand it by default.

Walkthrough

  • Add root-node-length prop to Tree component to control default expansion of root nodes (link)
  • Pass root-node-length prop from Tree to TreeBranch component (link)
  • Initialize childrenRendered, showChildren, and isNodeOpen refs in TreeBranch component based on root-node-length prop value (link)
  • Refactor props definition in Collection component to use withDefaults helper function (link)
  • Remove unused PropType import from Collection component (link)
  • Add null check for collectionMoveLoading prop in isCollLoading computed property in Collection component (link)

Closes HFE-94


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/hoppscotch/hoppscotch/pull/3126 **Author:** [@anwarulislam](https://github.com/anwarulislam) **Created:** 6/8/2023 **Status:** ✅ Merged **Merged:** 8/2/2023 **Merged by:** [@AndrewBastin](https://github.com/AndrewBastin) **Base:** `release/2023.8.0` ← **Head:** `chore/smart-tree-improvement` --- ### 📝 Commits (3) - [`2aa2423`](https://github.com/hoppscotch/hoppscotch/commit/2aa2423fff76d75ff2158bfee8666b1f97d04e7d) chore: type and ux improvement for smarttree - [`d7a54e4`](https://github.com/hoppscotch/hoppscotch/commit/d7a54e41d00dfda8623e1c3f13d6edd35474fdb7) chore: update prop name - [`10ee3ff`](https://github.com/hoppscotch/hoppscotch/commit/10ee3ffbfcb0c1a5187ee73e9d169f932ca9668d) chore: simplified isOnlyRootChild checking ### 📊 Changes **3 files changed** (+48 additions, -67 deletions) <details> <summary>View changed files</summary> 📝 `packages/hoppscotch-common/src/components/collections/Collection.vue` (+38 -64) 📝 `packages/hoppscotch-common/src/components/smart/Tree.vue` (+1 -0) 📝 `packages/hoppscotch-common/src/components/smart/TreeBranch.vue` (+9 -3) </details> ### 📄 Description <!-- copilot:all --> ### <samp>🤖 Generated by Copilot at ef9bd74</samp> ### Summary :sparkles::hammer_and_wrench::art: <!-- 1. :sparkles: - This emoji represents the addition of a new feature or enhancement, which is the case for the `root-node-length` prop that allows the user to pass the number of root nodes in the tree data and control the default expansion state of the tree. 2. :hammer_and_wrench: - This emoji represents a bug fix or improvement of existing code, which is the case for the refactoring of props definition and error handling in `Collection.vue`. This also implies some code maintenance and cleanup, which is also appropriate for this emoji. 3. :art: - This emoji represents an improvement of the UI or UX, which is the case for the prop added to `TreeBranch` component that makes the single root node case more user-friendly by rendering and expanding it by default. This also implies some aesthetic or design changes, which is also suitable for this emoji. --> Improved the UX of the `Collection` and `Tree` components. Refactored some props and collapse/expand logic. Removed unnecessary code. Previous: By default, we keep all collections collapsed. Now: If there is only one single collection we will expand it by default. ### Walkthrough * Add `root-node-length` prop to `Tree` component to control default expansion of root nodes ([link](https://github.com/hoppscotch/hoppscotch/pull/3126/files?diff=unified&w=0#diff-37f31bd418fb2714f7b03adc41f442e4d5f238e514f6f7686d3e36f9822eb3eeR13)) * Pass `root-node-length` prop from `Tree` to `TreeBranch` component ([link](https://github.com/hoppscotch/hoppscotch/pull/3126/files?diff=unified&w=0#diff-c610c01d2842bcdf7e4e76738ea233b1b93966c00c4bfe8350f76b01df6bf25dR88-R91)) * Initialize `childrenRendered`, `showChildren`, and `isNodeOpen` refs in `TreeBranch` component based on `root-node-length` prop value ([link](https://github.com/hoppscotch/hoppscotch/pull/3126/files?diff=unified&w=0#diff-c610c01d2842bcdf7e4e76738ea233b1b93966c00c4bfe8350f76b01df6bf25dL97-R104)) * Refactor `props` definition in `Collection` component to use `withDefaults` helper function ([link](https://github.com/hoppscotch/hoppscotch/pull/3126/files?diff=unified&w=0#diff-05cb9071e28b438c122f532071b3d08014b8e25633418ca0ae71615d8ad2b283L212-R241)) * Remove unused `PropType` import from `Collection` component ([link](https://github.com/hoppscotch/hoppscotch/pull/3126/files?diff=unified&w=0#diff-05cb9071e28b438c122f532071b3d08014b8e25633418ca0ae71615d8ad2b283L196-R196)) * Add null check for `collectionMoveLoading` prop in `isCollLoading` computed property in `Collection` component ([link](https://github.com/hoppscotch/hoppscotch/pull/3126/files?diff=unified&w=0#diff-05cb9071e28b438c122f532071b3d08014b8e25633418ca0ae71615d8ad2b283L451-R426)) Closes HFE-94 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-17 01:47:50 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#4245
No description provided.