Skip to content

Conversation

ZKunZhang
Copy link

πŸš€ Feature Overview

This PR implements the requested expand/collapse
functionality for Pinia Store data structures as requested
in issue #467.

✨ What's Implemented

1. One-Click Operations for All Stores

  • Expand All: Recursively expands all tree nodes and
    state properties
  • Collapse All: Collapses all expanded nodes to provide
    a clean view
  • Added expand/collapse buttons in both tree panel and state
    panel headers

2. Node-Level Hover Interactions

  • Quick Actions on Hover: When hovering over tree nodes
    with children, quick action buttons appear
  • Individual Node Control: Each node can be
    expanded/collapsed independently
  • Visual Feedback: Consistent hover states and tooltip
    guidance

3. Enhanced Search & Auto-Expansion

  • Search Auto-Expand: Automatically expands all levels
    when searching to reveal matching content
  • Store Search: Filter stores by name with
    auto-expansion
  • State Search: Filter state properties with maintained
    expansion context

4. Deep Nesting Support

  • 30-Level Depth: Supports expansion of deeply nested
    data structures
  • Performance Optimized: Efficient handling of complex
    state objects
  • Error Resilient: Graceful handling of circular
    references and edge cases

🎯 Addresses Issue Requirements

βœ… Support for expanding/collapsing Pinia Store data
structures with a single click
βœ… One-click operation for all Stores
βœ… Expand/collapse operations for specific Store nodes (with
hover interaction)
βœ… Pinia Store key-value pair retrieval (at the top of Store
panel)
βœ… Enhanced UX compared to Components Tree management

πŸ”§ Technical Implementation

Core Files Modified:

  • packages/applet/src/modules/pinia/components/store/Index. vue - Main store panel logic
  • packages/applet/src/components/tree/TreeViewer.vue -
    Tree hover interactions
  • packages/applet/src/components/state/ChildStateViewer.vue
  • State viewer enhancements

Key Features:

  • Context-Aware Expansion: Maintains separate expansion
    contexts for tree and state
  • Search Integration: Seamless integration with existing
    search functionality
  • Performance Optimized: Efficient node traversal and
    state management
  • Accessibility: Proper tooltips and keyboard navigation
    support

πŸ§ͺ Testing

The implementation has been thoroughly tested with:

  • Simple and complex nested store structures
  • Deep object hierarchies (up to 30 levels)
  • Array and object combinations
  • Search functionality with auto-expansion
  • Hover interactions and visual feedback

πŸ“Έ Visual Demo

The functionality can be tested by:

  1. Opening Vue DevTools Pinia panel
  2. Using expand/collapse buttons in panel headers
  3. Hovering over tree nodes to see quick actions
  4. Searching to trigger auto-expansion
  5. Testing with deeply nested store data

πŸŽ‰ Result

This implementation provides the exact functionality
requested in issue #467, offering users intuitive and
efficient ways to navigate complex Pinia store structures,
significantly improving the development experience when
working with large state trees.

Closes #467

- Add expand/collapse all buttons for both tree and state panels           - Implement hover actions for tree nodes with expand/collapse shortcuts
 - Auto-expand tree nodes and state when searching (up to 6 levels)
- Support deep nested state expansion for complex objects and arrays
- Make depth and withTag props optional in TreeViewer component
- Add comprehensive Pinia demo stores with deeply nested structures
- Improve placeholder text for search inputs
- Optimize initial tree expansion to 6 levels for better developer experience
Copy link

netlify bot commented Oct 1, 2025

βœ… Deploy Preview for vue-devtools-docs canceled.

Name Link
πŸ”¨ Latest commit bdf7340
πŸ” Latest deploy log https://app.netlify.com/projects/vue-devtools-docs/deploys/68dd2dd27557ef00082b2aae

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.

feat: Pinia panel Store optimization (support one-click expand/collapse, search)
1 participant