Skip to content

Conversation

@MinCrohn
Copy link
Collaborator

This update enhances the Selection System to provide library users with more control over navigating nested object structures. Two new options, drillDown and deepSelect, have been added to the SelectionState configuration.

1. Drill-down Selection (drillDown)

  • Description: Allows users to "enter" nested groups step-by-step. When enabled, a double-click (or subsequent clicks) on a previously selected group will search for and select the specific child object located at the click point.

  • User Experience: Instead of always selecting the top-most group, users can repeatedly click to drill into the exact component they wish to modify.

2. Deep Select (deepSelect)

  • Description: Provides a shortcut to bypass standard selection units (like 'highestGroup'). When enabled, holding the Ctrl (Windows) or Meta/Cmd (Mac) key during a click will force the selection logic to target the lower-level 'grid' unit immediately.

  • User Experience: Users can quickly select specific items within complex layouts without needing to navigate the group hierarchy manually.


How to Activate

You can enable these features by passing them as options when setting the selection state via the stateManager.

// Example: Activating drillDown and deepSelect in your Patchmap instance
patchmap.stateManager.setState('selection', {
  draggable: true,
  selectUnit: 'highestGroup', // Default behavior: select the top group
  
  // New Options
  drillDown: true,  // Enable drilling into groups on double-click
  deepSelect: true, // Enable Ctrl/Cmd + click to select grids directly
  
  onClick: (target) => {
    console.log("Selected Object:", target?.id);
  }
});

@gemini-code-assist
Copy link

Summary of Changes

Hello @MinCrohn, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the Selection System by introducing two powerful new features: drillDown and deepSelect. These additions provide library users with greater control and flexibility when interacting with complex, nested object structures. The changes aim to streamline the user experience by allowing more precise and efficient selection of elements within a hierarchical layout, reducing the need for manual navigation through parent groups.

Highlights

  • Drill-down Selection: Introduced a drillDown option that allows users to navigate into nested groups step-by-step. When enabled, subsequent clicks on an already selected group will select deeper child objects at the click point.
  • Deep Select: Added a deepSelect option which enables users to bypass standard selection units and directly select lower-level 'grid' units by holding the Ctrl (Windows) or Meta/Cmd (Mac) key during a click.
  • Enhanced Selection Logic: Refactored the internal selection mechanism to support these new features, including modifications to object finding, parent traversal, and interaction state management.
  • Documentation Updates: The README.md and README_KR.md files have been updated to include detailed descriptions and usage examples for the new drillDown and deepSelect configuration options.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces drillDown and deepSelect functionalities to the selection system, which is a great enhancement for navigating complex object hierarchies. The implementation is well-structured, with good use of Symbols for states and a strategy pattern in getSelectObject. The refactoring of the SelectionState class, including the consolidation of clear methods and extraction of a default config, improves code clarity.

My main feedback is a critical point regarding the lifecycle management in SelectionState. The exit method now destroys _selectionBox, which could lead to runtime errors if state objects are reused. I've provided a suggestion to make the enter method more robust to handle this case.

Overall, this is a valuable feature addition with thoughtful implementation details.

@MinCrohn MinCrohn merged commit 00bb258 into main Dec 18, 2025
@MinCrohn MinCrohn deleted the feat/add-selection-drillDown branch December 18, 2025 09:18
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.

2 participants