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(knowledge): align connected-sources rows and move source chip left of filter/sort#5117
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
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
ce4d024
improvement(knowledge): align connected-sources rows and move source …
waleedlatif1 23ad1f3
improvement(resource): render options aside left of filter/sort
waleedlatif1 4a9a229
fix(resource): keep options aside grouped with filter/sort without a …
waleedlatif1 d92947e
docs(resource): clarify aside groups with filter/sort regardless of s…
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
126 changes: 65 additions & 61 deletions
126 ...kspace/[workspaceId]/components/resource/components/resource-options/resource-options.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 |
|---|---|---|
| @@ -83,11 +83,11 @@ interface ResourceOptionsProps { | ||
| filter?: FilterConfig | ||
| filterTags?: FilterTag[] | ||
| /** | ||
| * Supplementary right-aligned slot (pushed opposite the left-aligned | ||
| * filter/sort via `justify-between`) for lightweight status content — e.g. | ||
| * the knowledge list's connector badges or the table editor's run/stop | ||
| * control in embedded mode. Keep it to badges/status widgets; primary | ||
| * actions belong in the header's `actions`, not here. | ||
| * Lightweight control rendered immediately to the LEFT of the filter/sort | ||
| * cluster; the two form one right-aligned group, with or without a search — | ||
| * e.g. the knowledge view's connected-source badge or the table editor's | ||
| * embedded run/stop control. Keep it to badges/status widgets; primary actions | ||
| * belong in the header's `actions`. | ||
| */ | ||
| aside?: ReactNode | ||
| } | ||
| @@ -115,64 +115,68 @@ export const ResourceOptions = memo(function ResourceOptions({ | ||
| return ( | ||
| <div className={cn('border-[var(--border)] border-b py-2.5', search ? 'px-6' : 'px-4')}> | ||
| <div className='flex items-center justify-between'> | ||
| <div className='flex items-center'> | ||
| {search && <SearchSection search={search} />} | ||
| <div className='flex items-center'> | ||
| {filterTags?.map((tag) => ( | ||
| <Chip key={tag.label} rightIcon={X} onClick={tag.onRemove}> | ||
| {tag.label} | ||
| </Chip> | ||
| ))} | ||
| {isToggleFilter && filter.mode === 'toggle' ? ( | ||
| <Chip active={filter.active} leftIcon={ListFilter} onClick={filter.onToggle}> | ||
| Filter | ||
| </Chip> | ||
| ) : popoverFilter ? ( | ||
| <PopoverPrimitive.Root | ||
| open={openMenu === 'filter'} | ||
| onOpenChange={(open) => | ||
| setOpenMenu((current) => (open ? 'filter' : current === 'filter' ? null : current)) | ||
| } | ||
| > | ||
| <PopoverPrimitive.Anchor asChild> | ||
| <div className='flex items-center'> | ||
| <PopoverPrimitive.Trigger asChild> | ||
| <Chip active={popoverFilter.active} leftIcon={ListFilter}> | ||
| Filter | ||
| </Chip> | ||
| </PopoverPrimitive.Trigger> | ||
| {sort && ( | ||
| <SortDropdown | ||
| config={sort} | ||
| open={openMenu === 'sort'} | ||
| onOpenChange={(open) => | ||
| setOpenMenu((current) => | ||
| open ? 'sort' : current === 'sort' ? null : current | ||
| ) | ||
| } | ||
| /> | ||
| )} | ||
| </div> | ||
| </PopoverPrimitive.Anchor> | ||
| <PopoverPrimitive.Portal> | ||
| <PopoverPrimitive.Content | ||
| align='end' | ||
| alignOffset={RESOURCE_MENU_EDGE_OFFSET} | ||
| collisionPadding={6} | ||
| sideOffset={6} | ||
| className={cn( | ||
| POPOVER_ANIMATION_CLASSES, | ||
| 'z-50 w-fit origin-[--radix-popover-content-transform-origin] rounded-xl border border-[var(--border)] bg-[var(--bg)] shadow-sm' | ||
| )} | ||
| > | ||
| {popoverFilter.content} | ||
| </PopoverPrimitive.Content> | ||
| </PopoverPrimitive.Portal> | ||
| </PopoverPrimitive.Root> | ||
| ) : null} | ||
| {sort && (isToggleFilter || !popoverFilter) && <SortDropdown config={sort} />} | ||
| <div className='ml-auto flex shrink-0 items-center gap-1.5'> | ||
| {aside} | ||
| <div className='flex items-center'> | ||
| {filterTags?.map((tag) => ( | ||
| <Chip key={tag.label} rightIcon={X} onClick={tag.onRemove}> | ||
| {tag.label} | ||
| </Chip> | ||
| ))} | ||
| {isToggleFilter && filter.mode === 'toggle' ? ( | ||
| <Chip active={filter.active} leftIcon={ListFilter} onClick={filter.onToggle}> | ||
| Filter | ||
| </Chip> | ||
| ) : popoverFilter ? ( | ||
| <PopoverPrimitive.Root | ||
| open={openMenu === 'filter'} | ||
| onOpenChange={(open) => | ||
| setOpenMenu((current) => | ||
| open ? 'filter' : current === 'filter' ? null : current | ||
| ) | ||
| } | ||
| > | ||
| <PopoverPrimitive.Anchor asChild> | ||
| <div className='flex items-center'> | ||
| <PopoverPrimitive.Trigger asChild> | ||
| <Chip active={popoverFilter.active} leftIcon={ListFilter}> | ||
| Filter | ||
| </Chip> | ||
| </PopoverPrimitive.Trigger> | ||
| {sort && ( | ||
| <SortDropdown | ||
| config={sort} | ||
| open={openMenu === 'sort'} | ||
| onOpenChange={(open) => | ||
| setOpenMenu((current) => | ||
| open ? 'sort' : current === 'sort' ? null : current | ||
| ) | ||
| } | ||
| /> | ||
| )} | ||
| </div> | ||
| </PopoverPrimitive.Anchor> | ||
| <PopoverPrimitive.Portal> | ||
| <PopoverPrimitive.Content | ||
| align='end' | ||
| alignOffset={RESOURCE_MENU_EDGE_OFFSET} | ||
| collisionPadding={6} | ||
| sideOffset={6} | ||
| className={cn( | ||
| POPOVER_ANIMATION_CLASSES, | ||
| 'z-50 w-fit origin-[--radix-popover-content-transform-origin] rounded-xl border border-[var(--border)] bg-[var(--bg)] shadow-sm' | ||
| )} | ||
| > | ||
| {popoverFilter.content} | ||
| </PopoverPrimitive.Content> | ||
| </PopoverPrimitive.Portal> | ||
| </PopoverPrimitive.Root> | ||
| ) : null} | ||
| {sort && (isToggleFilter || !popoverFilter) && <SortDropdown config={sort} />} | ||
| </div> | ||
| </div> | ||
| {aside && <div className='flex shrink-0 items-center gap-1.5'>{aside}</div>} | ||
waleedlatif1 marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| </div> | ||
| </div> | ||
| ) | ||
2 changes: 1 addition & 1 deletion
2 ...rkspace/[workspaceId]/knowledge/[id]/components/connectors-section/connectors-section.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
6 changes: 3 additions & 3 deletions
6 apps/sim/app/workspace/[workspaceId]/tables/[tableId]/table.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 |
|---|---|---|
| @@ -640,9 +640,9 @@ export function Table({ | ||
| } | ||
| /> | ||
| )} | ||
| {/* Sort + filter render in both modes (left-aligned). In embedded (mothership) | ||
| mode there's no Resource.Header, so the run/stop control rides in the options | ||
| bar's right-aligned `aside` slot — opposite the left-aligned filter/sort. */} | ||
| {/* Sort + filter render in both modes. In embedded (mothership) mode there's no | ||
| Resource.Header, so the run/stop control rides in the options bar's `aside` | ||
| slot, just left of filter/sort. */} | ||
waleedlatif1 marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| <Resource.Options | ||
| sort={sortConfig} | ||
| filter={filterConfig} | ||
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.