Skip to content

Commit d013132

Browse files
authored
improvement(home): position @ mention popup at caret and fix icon consistency (#3831)
* improvement(home): position @ mention popup at caret and fix icon consistency * fix(home): pin mirror div to document origin and guard button anchor * chore(auth): restore hybrid.ts to staging
1 parent 7b0ce80 commit d013132

File tree

4 files changed

+224
-155
lines changed

4 files changed

+224
-155
lines changed

apps/sim/app/workspace/[workspaceId]/home/components/mothership-view/components/resource-registry/resource-registry.tsx

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ function WorkflowDropdownItem({ item }: DropdownItemRenderProps) {
5252
return (
5353
<>
5454
<div
55-
className='mr-[0px] h-[14px] w-[14px] flex-shrink-0 rounded-[3px] border-[2px]'
55+
className='h-[14px] w-[14px] flex-shrink-0 rounded-[3px] border-[2px]'
5656
style={{
5757
backgroundColor: color,
5858
borderColor: `${color}60`,
@@ -72,7 +72,16 @@ function FileDropdownItem({ item }: DropdownItemRenderProps) {
7272
const DocIcon = getDocumentIcon('', item.name)
7373
return (
7474
<>
75-
<DocIcon className='mr-2 h-[14px] w-[14px] text-[var(--text-icon)]' />
75+
<DocIcon className='h-[14px] w-[14px] flex-shrink-0 text-[var(--text-icon)]' />
76+
<span className='truncate'>{item.name}</span>
77+
</>
78+
)
79+
}
80+
81+
function IconDropdownItem({ item, icon: Icon }: DropdownItemRenderProps & { icon: ElementType }) {
82+
return (
83+
<>
84+
<Icon className='h-[14px] w-[14px] flex-shrink-0 text-[var(--text-icon)]' />
7685
<span className='truncate'>{item.name}</span>
7786
</>
7887
)
@@ -104,7 +113,7 @@ export const RESOURCE_REGISTRY: Record<MothershipResourceType, ResourceTypeConfi
104113
renderTabIcon: (_resource, className) => (
105114
<TableIcon className={cn(className, 'text-[var(--text-icon)]')} />
106115
),
107-
renderDropdownItem: (props) => <DefaultDropdownItem {...props} />,
116+
renderDropdownItem: (props) => <IconDropdownItem {...props} icon={TableIcon} />,
108117
},
109118
file: {
110119
type: 'file',
@@ -123,7 +132,7 @@ export const RESOURCE_REGISTRY: Record<MothershipResourceType, ResourceTypeConfi
123132
renderTabIcon: (_resource, className) => (
124133
<Database className={cn(className, 'text-[var(--text-icon)]')} />
125134
),
126-
renderDropdownItem: (props) => <DefaultDropdownItem {...props} />,
135+
renderDropdownItem: (props) => <IconDropdownItem {...props} icon={Database} />,
127136
},
128137
} as const
129138

apps/sim/app/workspace/[workspaceId]/home/components/user-input/components/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export type WindowWithSpeech = Window & {
3434
}
3535

3636
export interface PlusMenuHandle {
37-
open: () => void
37+
open: (anchor?: { left: number; top: number }) => void
3838
}
3939

4040
export const TEXTAREA_BASE_CLASSES = cn(

0 commit comments

Comments
 (0)