Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 3.8k
improvement(ui): sidebar#3832
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
Merged
Uh oh!
There was an error while loading. Please reload this page.
Merged
improvement(ui): sidebar #3832
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
48c654d
improvement(ui): sidebar
emir-karabeg 0872895
merge: resolve conflicts with staging for improvement/ui
waleedlatif1 dd76308
fix(sidebar): restore collapse button removed during conflict resolution
waleedlatif1 a8edee2
fix(sidebar): remove no-op gap-2 from single-child collapsed menu button
waleedlatif1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
4 changes: 2 additions & 2 deletions
4 ...paceId]/w/components/sidebar/components/collapsed-sidebar-menu/collapsed-sidebar-menu.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2 ...space/[workspaceId]/w/components/sidebar/components/settings-sidebar/settings-sidebar.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2 ...space/[workspaceId]/w/components/sidebar/components/workspace-header/workspace-header.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 31 additions & 35 deletions
66 apps/sim/app/workspace/[workspaceId]/w/components/sidebar/sidebar.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -102,8 +102,9 @@ const logger = createLogger('Sidebar') | ||
| function SidebarItemSkeleton() { | ||
| return ( | ||
| <div className='sidebar-collapse-hide mx-0.5 flex h-[30px] items-center px-2'> | ||
| <Skeleton className='h-[24px] w-full rounded-sm' /> | ||
| <div className='sidebar-collapse-hide mx-0.5 flex h-[30px] items-center gap-2 rounded-lg px-2'> | ||
| <Skeleton className='h-[16px] w-[16px] flex-shrink-0 rounded-sm' /> | ||
| <Skeleton className='h-[14px] w-full rounded-sm' /> | ||
| </div> | ||
| ) | ||
| } | ||
| @@ -1030,7 +1031,7 @@ export const Sidebar = memo(function Sidebar() { | ||
| const workflowsCollapsedIcon = useMemo( | ||
| () => ( | ||
| <div | ||
| className='h-[16px] w-[16px] flex-shrink-0 rounded-[3px] border-[2px]' | ||
| className='h-[16px] w-[16px] flex-shrink-0 rounded-sm border-[2.5px]' | ||
| style={workflowIconStyle} | ||
| /> | ||
| ), | ||
| @@ -1056,6 +1057,14 @@ export const Sidebar = memo(function Sidebar() { | ||
| // Stable no-op for collapsed workflow context menu delete (never changes) | ||
| const noop = useCallback(() => {}, []) | ||
| const handleExpandSidebar = useCallback( | ||
| (e: React.MouseEvent) => { | ||
| e.preventDefault() | ||
| toggleCollapsed() | ||
| }, | ||
| [toggleCollapsed] | ||
| ) | ||
| // Stable callback for the "New task" button in expanded mode | ||
| const handleNewTask = useCallback( | ||
| () => navigateToPage(`/workspace/${workspaceId}/home`), | ||
| @@ -1198,51 +1207,38 @@ export const Sidebar = memo(function Sidebar() { | ||
| <div className='flex h-full flex-col pt-3'> | ||
| {/* Top bar: Logo + Collapse toggle */} | ||
| <div className='flex flex-shrink-0 items-center pr-2 pb-2 pl-2.5'> | ||
| <div className='relative flex h-[30px] items-center'> | ||
| <Link | ||
| href={`/workspace/${workspaceId}/home`} | ||
| className='sidebar-collapse-hide sidebar-collapse-remove flex h-[30px] items-center rounded-[8px] px-1.5 hover-hover:bg-[var(--surface-hover)]' | ||
| tabIndex={isCollapsed ? -1 : 0} | ||
| > | ||
| {brand.logoUrl ? ( | ||
| <Image | ||
| src={brand.logoUrl} | ||
| alt={brand.name} | ||
| width={16} | ||
| height={16} | ||
| className='h-[16px] w-[16px] object-contain' | ||
| unoptimized | ||
| /> | ||
| ) : ( | ||
| <Wordmark className='h-[16px] w-auto text-[var(--text-body)]' /> | ||
| )} | ||
| </Link> | ||
| <div className='flex h-[30px] items-center'> | ||
| <Tooltip.Root> | ||
| <Tooltip.Trigger asChild> | ||
| <button | ||
| type='button' | ||
| onClick={toggleCollapsed} | ||
| className='sidebar-collapse-show group absolute left-0 flex h-[30px] w-[30px] items-center justify-center rounded-[8px] hover-hover:bg-[var(--surface-hover)]' | ||
| aria-label='Expand sidebar' | ||
| tabIndex={isCollapsed ? 0 : -1} | ||
| <Link | ||
| href={`/workspace/${workspaceId}/home`} | ||
| onClick={isCollapsed ? handleExpandSidebar : undefined} | ||
| className='group flex h-[30px] items-center rounded-[8px] px-1.5 hover-hover:bg-[var(--surface-hover)]' | ||
| aria-label={isCollapsed ? 'Expand sidebar' : brand.name} | ||
| > | ||
| {brand.logoUrl ? ( | ||
| <Image | ||
| src={brand.logoUrl} | ||
| alt={brand.name} | ||
| width={16} | ||
| height={16} | ||
| className='h-[16px] w-[16px] object-contain group-hover:hidden' | ||
| className={cn( | ||
| 'h-[16px] w-[16px] flex-shrink-0 object-contain', | ||
| isCollapsed && 'group-hover:hidden' | ||
| )} | ||
| unoptimized | ||
| /> | ||
| ) : isCollapsed ? ( | ||
| <Sim className='h-[16px] w-[16px] flex-shrink-0 group-hover:hidden' /> | ||
| ) : ( | ||
| <Sim className='h-[16px] w-[16px] text-[var(--text-icon)] group-hover:hidden' /> | ||
| <Wordmark className='h-[16px] w-auto text-[var(--text-body)]' /> | ||
| )} | ||
| {isCollapsed && ( | ||
| <PanelLeft className='hidden h-[16px] w-[16px] flex-shrink-0 rotate-180 text-[var(--text-icon)] group-hover:block' /> | ||
| )} | ||
| <PanelLeft className='hidden h-[16px] w-[16px] rotate-180 text-[var(--text-icon)] group-hover:block' /> | ||
| </button> | ||
| </Link> | ||
waleedlatif1 marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| </Tooltip.Trigger> | ||
| {isCollapsed && ( | ||
| {showCollapsedTooltips && ( | ||
| <Tooltip.Content side='right'> | ||
| <p>Expand sidebar</p> | ||
| </Tooltip.Content> | ||
| @@ -1272,7 +1268,7 @@ export const Sidebar = memo(function Sidebar() { | ||
| </div> | ||
| {/* Workspace Header */} | ||
| <div className='flex-shrink-0 px-2.5'> | ||
| <div className='flex-shrink-0 pr-2.5 pl-[9px]'> | ||
| <WorkspaceHeader | ||
| activeWorkspace={activeWorkspace} | ||
| workspaceId={workspaceId} | ||
Oops, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.