-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
chore: update project tree scroll to current ID context menu, top bar #29427
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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 the project tree component with improved state persistence, context menus, and drag-and-drop functionality.
- Added context menu functionality to tree items using a new
ContextMenu
component based on Radix UI primitives - Implemented state persistence to maintain selected tree items across page refreshes and scroll to active items
- Replaced command key requirement for drag-and-drop with intuitive visual indicators and right-click context menu
- Added a dismissable help banner explaining navigation features and a top bar with edit/save/cancel controls
- Updated styling with new highlight variables and z-index settings to support context menus and visual feedback
8 file(s) reviewed, 4 comment(s)
Edit PR Review Bot Settings | Greptile
frontend/src/layout/navigation-3000/components/ProjectTree/ProjectTree.tsx
Outdated
Show resolved
Hide resolved
@@ -463,8 +504,10 @@ const LemonTree = forwardRef<HTMLDivElement, LemonTreeProps>( | |||
// Update focusedId when clicking | |||
setFocusedId(item?.id) | |||
|
|||
const isFolder = item?.children && item?.children?.length >= 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: The condition item?.children && item?.children?.length >= 0
will always be true if item.children exists, even if it's an empty array. Consider using item?.children !== undefined
instead for clarity.
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
…jectTree.tsx Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Size Change: 0 B Total Size: 9.73 MB ℹ️ View Unchanged
|
📸 UI snapshots have been updated2 snapshot changes in total. 0 added, 2 modified, 0 deleted:
Triggered by this commit. |
Problem
When an project tree/lemon tree item was clicked we went to that URL, but when we refreshed, we'd lose that context in the tree.
Also, drag and drop (currently) is initiated by holding command key/use context menu, which is not obvious, so I added a dismissable banner to help users know what's going on.
Changes
Does this work well for both Cloud and self-hosted?
It should
How did you test this code?
Locally