Skip to content

fix(project-tree): search for product & project trees #32297

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 16 commits into
base: master
Choose a base branch
from

Conversation

adamleithp
Copy link
Contributor

@adamleithp adamleithp commented May 17, 2025

[waiting for this PR to merge, so i can rebase and clear stacked commits]

Problem

  • Product(s) tree wasn't searchable
  • Couldn't search go/revenue (searching go revenue revenue go worked though)
  • Couldn't key arrow down from panel search into ProductTree

problem: searching products
2025-05-17 23 03 19

problem: Searching go/revenue
2025-05-17 23 02 12

Changes

  • Added simple search to product tree
  • Added split to plain free text for / and searches for each part (regardless of order)
  • Added support for arrow down from panel search into ProductTree

changes: searching products
2025-05-17 23 04 06

changes: Searching go/revenue
2025-05-17 23 05 02

How did you test this code?

Manually

Copy link
Contributor

Size Change: -3.19 kB (-0.09%)

Total Size: 3.65 MB

Filename Size Change
frontend/dist/toolbar.js 3.65 MB -3.19 kB (-0.09%)

compressed-size-action

@adamleithp adamleithp marked this pull request as ready for review May 17, 2025 22:06
@adamleithp adamleithp requested a review from mariusandra May 17, 2025 22:06
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This PR enhances search functionality across product and project trees, adding search capability to the product tree and improving path-based searches to handle slashes correctly.

  • Added searchResults selector in frontend/src/layout/panel-layout/ProductTree/productTreeLogic.tsx to enable product tree searching
  • Modified _apply_search_to_queryset in posthog/api/file_system.py to split path tokens on '/' for better path-based searching
  • Moved tree-specific logic from projectTreeLogic into separate productTreeLogic and gameTreeLogic for better code organization
  • Added conditional rendering in ProductTree.tsx to switch between searchResults and productTreeItems based on search term
  • Relocated treeItemsCombined from projectTreeLogic to shortcutsLogic for improved separation of concerns

9 file(s) reviewed, 2 comment(s)
Edit PR Review Bot Settings | Greptile

Comment on lines +13 to +14
values: [featureFlagLogic, ['featureFlags'], projectTreeLogic, ['folderStates', 'users']],
actions: [],
Copy link
Contributor

Choose a reason for hiding this comment

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

style: No actions defined but connected to projectTreeLogic - consider if any actions need to be shared between trees

Comment on lines +40 to +43
(s) => [s.searchTerm, s.productTreeItems],
(searchTerm, productTreeItems): TreeDataItem[] => {
return productTreeItems.filter((item) => item.name.toLowerCase().includes(searchTerm.toLowerCase()))
},
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: Search implementation doesn't handle the slash-separated search terms mentioned in the PR description. Consider splitting searchTerm on '/' and matching each part independently to match the PR's stated goals.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no, this code is for Products not Project (which is described in PR)

@adamleithp adamleithp marked this pull request as draft May 17, 2025 22:09
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.

1 participant