-
Notifications
You must be signed in to change notification settings - Fork 478
[fix] Resolve broken folders #3684
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
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.
Pull request overview
Updates the sidebar and legacy app APIs to support folder-based app organization and selection, addressing issues where folder assignments were not reflected/maintained.
Changes:
- Reworks sidebar navigation to separate “project” vs “app” sections and adds an app selector dropdown that can display apps within folders.
- Adds
folder_idto legacy app conversion outputs and ensures app updates can persist folder changes. - Persists
folder_idduring artifact edits in the Postgres git DAO.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| web/oss/src/components/Sidebar/types.d.ts | Replaces header with isAppSection to split sidebar sections. |
| web/oss/src/components/Sidebar/hooks/useSidebarConfig/index.tsx | Marks app-scoped links with isAppSection and removes the old header entry. |
| web/oss/src/components/Sidebar/components/SidebarMenu.tsx | Removes rendering logic for the old header group item type. |
| web/oss/src/components/Sidebar/components/ListOfApps.tsx | New dropdown to select apps via folder tree structure. |
| web/oss/src/components/Sidebar/Sidebar.tsx | Renders project/app/bottom sections separately and inserts the app selector UI. |
| api/oss/src/services/legacy_adapter.py | Adds folder-aware update behavior and includes folder_id in legacy App conversion. |
| api/oss/src/dbs/postgres/git/dao.py | Writes folder_id into the artifact DB row during edits. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Closes #3694 |
mmabrouk
left a comment
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.
Thanks @jp-agenta
I think you mistakingly mixed two PRs in one. My comments are about the second PR, I did not check the UI yet, but expected an issue (which the AI confirmed).
I suggested cleaning up this one to solve the bug, and then have maybe Ashraf or Kaosi clean up the UI for the second one.
| label: ( | ||
| <div className="flex items-center gap-2"> | ||
| <FolderOpenOutlined style={{fontSize: 14}} /> | ||
| <span className="truncate">{node.name}</span> |
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.
The truncate class on folder and app names inside the ListOfApps dropdown doesn't actually truncate anything. Ant Design's Dropdown menu has no default max-width, so the menu just stretches to fit long names. The existing ListOfProjects component solves this with max-w-[300px] on the item wrapper. ListOfApps should do the same. I've proposed edits that add max-w-[300px] and title tooltips to both folder and app labels in the dropdown.
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.
How long names are handled
There are two places where long names appear: the dropdown trigger button and the dropdown menu items. They are handled differently, and the menu items have a gap.
The trigger button (the selected app name)
The button text is constrained by a hard max-width on the at ListOfApps.tsx:109:
<span className={clsx("truncate", collapsed ? "max-w-[52px]" : "max-w-[180px]")}>
{appLabel}
Tailwind's truncate applies overflow: hidden, text-overflow: ellipsis, and white-space: nowrap. Combined with max-w-[180px], any app name longer than about 180px of rendered text gets clipped with an ellipsis. Users can still see the full name via the native browser tooltip (title={appLabel} on line 110).
When the sidebar is collapsed, the cap drops to 52px.
The dropdown menu items (the problem)
Inside the dropdown, folder names (ListOfApps.tsx:47) and app names (ListOfApps.tsx:57) both use truncate on their elements. However, truncate alone does nothing unless the element has a constrained width. Ant Design's Dropdown menu does not enforce a max-width on its items. The menu will simply grow wider to fit the longest name.
Compare this with the existing ListOfProjects component in the same codebase, which wraps each item in a div with max-w-[300px] to make truncation work. ListOfApps does not do this.
So in practice: a very long app or folder name will cause the dropdown to stretch horizontally. The truncate class on the inner spans is effectively a no-op because nothing constrains their width.
Summary
Location Constrained? Truncation works?
Trigger button Yes (max-w-[180px]) Yes, with tooltip
Folder names in dropdown No No, menu stretches
App names in dropdown No No, menu stretches
To fix this, the dropdown menu items need a max-width on their container (similar to how ListOfProjects uses max-w-[300px]). Without it, the truncate class is decorative. Here is one way to fix it:
Edited ListOfApps.tsx(#1)
return {
key: folder:${node.id},
label: (
<FolderOpenOutlined style={{fontSize: 14}} />
{node.name}
{node.name}
),
children,
Edited ListOfApps.tsx(#2)
keyMap[key] = node.app_id
return {
key,
label: {node.app_name},
label: (
{node.app_name}
),
}
}
})
These edits add max-w-[300px] to both folder and app labels inside the dropdown (consistent with ListOfProjects), and add title attributes so users can hover to see the full name. Without the max-width constraint, the existing truncate classes were not doing anything.
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.
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.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
Uh oh!
There was an error while loading. Please reload this page.