Skip to content

feat(project-tree): basic search#30228

Merged
mariusandra merged 8 commits intomasterfrom
project-tree-search
Mar 21, 2025
Merged

feat(project-tree): basic search#30228
mariusandra merged 8 commits intomasterfrom
project-tree-search

Conversation

@mariusandra
Copy link
Collaborator

@mariusandra mariusandra commented Mar 20, 2025

Problem

The project tree search was working only client-side, which was a problem since you normally didn't have all the items loaded.

Changes

  • Move the search to the backend.
  • Create a flat search view
  • Remove the project name item from the project list
  • Adds a load more button and a loading spinner
  • Improves the highlighter to support multiple strings

2025-03-21 11 09 36

How did you test this code?

Clicked around in the UI

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 moves project tree search from client-side to server-side implementation, enabling search across all items rather than just loaded ones, with a new flat search view for results.

  • Added displayName prop to LemonTree component in /frontend/src/lib/lemon-ui/LemonTree/LemonTree.tsx for custom search result rendering
  • Implemented server-side search with pagination in /frontend/src/layout/panel-layout/ProjectTree/projectTreeLogic.tsx, removing Fuse.js client search
  • Added convertFileSystemEntryToFlatTreeDataItem in /frontend/src/layout/panel-layout/ProjectTree/utils.tsx for search result display with path highlighting
  • Modified fileSystem.list API in /frontend/src/lib/api.ts to support search parameter in backend requests

5 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile

replaySingle: (id: string): string => `/replay/${id}`,
replayFilePlayback: (): string => '/replay/file-playback',
replaySettings: (): string => '/replay/settings',
replaySettings: (sectionId?: string): string => `/replay/settings${sectionId ? `?sectionId=${sectionId}` : ''}`,
Copy link
Contributor

Choose a reason for hiding this comment

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

style: Template literal could be simplified to use URL parameters instead of string concatenation for better URL handling

@github-actions
Copy link
Contributor

github-actions bot commented Mar 20, 2025

Size Change: +43 B (0%)

Total Size: 9.75 MB

ℹ️ View Unchanged
Filename Size Change
frontend/dist/toolbar.js 9.75 MB +43 B (0%)

compressed-size-action

@mariusandra mariusandra requested a review from adamleithp March 21, 2025 10:15
Copy link
Contributor

@adamleithp adamleithp left a comment

Choose a reason for hiding this comment

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

beautiful

@mariusandra mariusandra enabled auto-merge (squash) March 21, 2025 10:25
@mariusandra mariusandra merged commit 0f0e8e6 into master Mar 21, 2025
104 of 105 checks passed
@mariusandra mariusandra deleted the project-tree-search branch March 21, 2025 10:31
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