Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

fix(soup): file dropzone covering preview panel preventing block drop actions (#4658)

dev-rb3ab14fe9a1f5
diff --git a/js/app/packages/app/component/next-soup/soup-view/soup-view.tsx b/js/app/packages/app/component/next-soup/soup-view/soup-view.tsx
index dd526a5fad..7ecfb9e89b 100644
--- a/js/app/packages/app/component/next-soup/soup-view/soup-view.tsx
+++ b/js/app/packages/app/component/next-soup/soup-view/soup-view.tsx
@@ -763,9 +763,7 @@ export const SoupView = (props: SoupViewProps) => {
<div class="relative grow min-h-1 flex max-sm:flex-col flex-row size-full">
<Suspense>
<Show when={!isBoardMode()} fallback={<CompanyKanban />}>
- <SoupViewFileDropzone>
- <SoupViewList />
- </SoupViewFileDropzone>
+ <SoupViewList />
</Show>
</Suspense>
<Show when={isMobile()}>
@@ -1256,178 +1254,203 @@ export const SoupViewList = (props: SoupViewListProps) => {
minSize={200}
maxSize={paneVisible() ? 840 : undefined}
>
- <div
- class={cn(
- '@container/u-list size-full unified-list-root flex flex-col relative',
- paneVisible() && 'border-r border-edge-muted'
- )}
- >
- <Show when={isMobile() && source.isPlaceholderData()}>
- <MobileTabLoadingBar />
- </Show>
- <StaticMarkdownContext>
- <Switch>
- <Match when={source.isFetching() && !rows().length}>
- {/* Non-list states pad the chrome top themselves — the
+ <SoupViewFileDropzone>
+ <div
+ class={cn(
+ '@container/u-list size-full unified-list-root flex flex-col relative',
+ paneVisible() && 'border-r border-edge-muted'
+ )}
+ >
+ <Show when={isMobile() && source.isPlaceholderData()}>
+ <MobileTabLoadingBar />
+ </Show>
+ <StaticMarkdownContext>
+ <Switch>
+ <Match when={source.isFetching() && !rows().length}>
+ {/* Non-list states pad the chrome top themselves — the
panel leaves list views unpadded so rows can
under-scroll the status bar. */}
- <div class="flex-1 min-h-0 flex flex-col mobile:pt-(--mobile-content-inset-top) mobile:pb-(--mobile-content-inset-bottom)">
- <LoadingBlock />
- </div>
- </Match>
- <Match
- when={
- (isSearchServiceLoading() || isLocalSearchSettling()) &&
- !rows().length
- }
- >
- <div class="flex items-center gap-2 p-3 text-xs text-text-muted mobile:mt-(--mobile-content-inset-top) mobile:mb-(--mobile-content-inset-bottom)">
- <Spinner class="size-3 animate-spin" />
- Searching...
- </div>
- </Match>
- <Match
- when={
- (!source.isFetching() && !rows().length) ||
- forceEmptyState()
- }
- >
- <div class="flex-1 min-h-0 flex flex-col mobile:pt-(--mobile-content-inset-top) mobile:pb-(--mobile-content-inset-bottom)">
- <EmptyState
- listView={currentView()}
- search={!!searchText()}
- hasRefinementsFromBase={hasActiveRefinements()}
- hasHiddenItems={hasHiddenItems()}
- onClearFilters={resetToTabDefaults}
- />
- </div>
- </Match>
- <Match when={rows().length}>
- <ListLayoutProvider ref={localEntityListRef}>
- <Show when={currentView() === 'tasks' && !isMobile()}>
- <ResponsiveTaskListHeader class="shrink-0" />
- </Show>
- <Show when={currentView() === 'companies' && !isMobile()}>
- <ResponsiveCompanyListHeader class="shrink-0" />
- </Show>
- <EntityRowProvider
- container={localEntityListRef}
- canSwipeLeft={(entityId) => {
- const entity = entityById().get(entityId);
- if (!entity) return false;
-
- const tab = activeTab();
-
- if (
- !isListViewID(contentId) ||
- (tab && !canExecuteMarkDoneOnView(contentId, tab))
- )
- return false;
-
- return markDoneAction.canExecute(entity.original);
- }}
- onSwipeLeft={(entityId) => {
- const entity = entityById().get(entityId);
- if (!entity) return;
- markDoneAction.executeWithSoup(
- [entity.original],
- soup
- );
- }}
- setCollapseEntity={soup.collapseEntity.set}
- >
- <SoupList
- cache={readListEntryState()?.virtualCache}
- ref={(el) => {
- setLocalEntityListRef(el);
- soupNavigationTouchHighlight(el);
+ <div class="flex-1 min-h-0 flex flex-col mobile:pt-(--mobile-content-inset-top) mobile:pb-(--mobile-content-inset-bottom)">
+ <LoadingBlock />
+ </div>
+ </Match>
+ <Match
+ when={
+ (isSearchServiceLoading() || isLocalSearchSettling()) &&
+ !rows().length
+ }
+ >
+ <div class="flex items-center gap-2 p-3 text-xs text-text-muted mobile:mt-(--mobile-content-inset-top) mobile:mb-(--mobile-content-inset-bottom)">
+ <Spinner class="size-3 animate-spin" />
+ Searching...
+ </div>
+ </Match>
+ <Match
+ when={
+ (!source.isFetching() && !rows().length) ||
+ forceEmptyState()
+ }
+ >
+ <div class="flex-1 min-h-0 flex flex-col mobile:pt-(--mobile-content-inset-top) mobile:pb-(--mobile-content-inset-bottom)">
+ <EmptyState
+ listView={currentView()}
+ search={!!searchText()}
+ hasRefinementsFromBase={hasActiveRefinements()}
+ hasHiddenItems={hasHiddenItems()}
+ onClearFilters={resetToTabDefaults}
+ />
+ </div>
+ </Match>
+ <Match when={rows().length}>
+ <ListLayoutProvider ref={localEntityListRef}>
+ <Show when={currentView() === 'tasks' && !isMobile()}>
+ <ResponsiveTaskListHeader class="shrink-0" />
+ </Show>
+ <Show
+ when={currentView() === 'companies' && !isMobile()}
+ >
+ <ResponsiveCompanyListHeader class="shrink-0" />
+ </Show>
+ <EntityRowProvider
+ container={localEntityListRef}
+ canSwipeLeft={(entityId) => {
+ const entity = entityById().get(entityId);
+ if (!entity) return false;
+
+ const tab = activeTab();
+
+ if (
+ !isListViewID(contentId) ||
+ (tab && !canExecuteMarkDoneOnView(contentId, tab))
+ )
+ return false;
+
+ return markDoneAction.canExecute(entity.original);
}}
- virtualizerClass={'scrollbar-hidden space-y-2'}
- class="overflow-hidden flex min-w-0"
- virtualizerRef={registerVirtualizerHandler}
- onScrollBottom={debouncedFetchMore}
- scrollBottomOffset={300}
- rows={rows()}
+ onSwipeLeft={(entityId) => {
+ const entity = entityById().get(entityId);
+ if (!entity) return;
+ markDoneAction.executeWithSoup(
+ [entity.original],
+ soup
+ );
+ }}
+ setCollapseEntity={soup.collapseEntity.set}
>
- {(row, i) => {
- const timestamp = () => {
- if (row.original.sortTs)
- return row.original.sortTs;
-
- const sort_ = soup.sort.active();
- if (!sort_.length) return;
-
- switch (sort_[0].id) {
- case 'viewed_at':
- return row.original.viewedAt;
- case 'created_at':
- return row.original.createdAt;
- case 'updated_at':
- return row.original.updatedAt;
- default:
- return row.original.createdAt;
- }
- };
-
- return (
- <>
- <Show when={i() === 0 && featuredCount() > 0}>
- <SoupSectionHeader>
- <span class="truncate">
- Featured Results
- </span>
- </SoupSectionHeader>
- </Show>
- <Show
- when={
- i() === featuredCount() &&
- featuredCount() > 0
- }
- >
- <SoupSectionHeader>
- <span class="truncate">More Results</span>
- </SoupSectionHeader>
- </Show>
-
- <Switch>
- {/* Group header row */}
- <Match when={row.getIsGrouped() && row.group}>
- {(group) => (
- <Dynamic
- component={
- group().renderHeader ??
- groupHeaderComponent()
- }
- group={group()}
- highlighted={row.isFocused()}
- />
- )}
- </Match>
-
- {/* Load more row */}
- <Match
+ <SoupList
+ cache={readListEntryState()?.virtualCache}
+ ref={(el) => {
+ setLocalEntityListRef(el);
+ soupNavigationTouchHighlight(el);
+ }}
+ virtualizerClass={'scrollbar-hidden space-y-2'}
+ class="overflow-hidden flex min-w-0"
+ virtualizerRef={registerVirtualizerHandler}
+ onScrollBottom={debouncedFetchMore}
+ scrollBottomOffset={300}
+ rows={rows()}
+ >
+ {(row, i) => {
+ const timestamp = () => {
+ if (row.original.sortTs)
+ return row.original.sortTs;
+
+ const sort_ = soup.sort.active();
+ if (!sort_.length) return;
+
+ switch (sort_[0].id) {
+ case 'viewed_at':
+ return row.original.viewedAt;
+ case 'created_at':
+ return row.original.createdAt;
+ case 'updated_at':
+ return row.original.updatedAt;
+ default:
+ return row.original.createdAt;
+ }
+ };
+
+ return (
+ <>
+ <Show when={i() === 0 && featuredCount() > 0}>
+ <SoupSectionHeader>
+ <span class="truncate">
+ Featured Results
+ </span>
+ </SoupSectionHeader>
+ </Show>
+ <Show
when={
- row.group?.isExpanded() &&
- row.getIsLoadMore() &&
- row.group
+ i() === featuredCount() &&
+ featuredCount() > 0
}
>
- {(group) => {
- const highlighted = () => row.isFocused();
- return (
- <div
- class={cn(
- 'my-1 rounded min-h-9 flex items-center justify-center',
- highlighted()
- ? 'w-[calc(100%-0.5rem)] mx-1 bg-active/60'
- : 'mx-auto'
- )}
- >
- <Show
- when={
- !isFetchingGroupPage(group().key)
- }
- fallback={
+ <SoupSectionHeader>
+ <span class="truncate">More Results</span>
+ </SoupSectionHeader>
+ </Show>
+
+ <Switch>
+ {/* Group header row */}
+ <Match
+ when={row.getIsGrouped() && row.group}
+ >
+ {(group) => (
+ <Dynamic
+ component={
+ group().renderHeader ??
+ groupHeaderComponent()
+ }
+ group={group()}
+ highlighted={row.isFocused()}
+ />
+ )}
+ </Match>
+
+ {/* Load more row */}
+ <Match
+ when={
+ row.group?.isExpanded() &&
+ row.getIsLoadMore() &&
+ row.group
+ }
+ >
+ {(group) => {
+ const highlighted = () =>
+ row.isFocused();
+ return (
+ <div
+ class={cn(
+ 'my-1 rounded min-h-9 flex items-center justify-center',
+ highlighted()
+ ? 'w-[calc(100%-0.5rem)] mx-1 bg-active/60'
+ : 'mx-auto'
+ )}
+ >
+ <Show
+ when={
+ !isFetchingGroupPage(
+ group().key
+ )
+ }
+ fallback={
+ <Button
+ variant="base"
+ size="sm"
+ depth={2}
+ class={cn({
+ 'bg-surface':
+ !highlighted(),
+ 'border-transparent':
+ highlighted(),
+ })}
+ disabled
+ >
+ <Spinner class="size-3 animate-spin" />
+ Loading...
+ </Button>
+ }
+ >
<Button
variant="base"
size="sm"
@@ -1437,161 +1460,151 @@ export const SoupViewList = (props: SoupViewListProps) => {
'border-transparent':
highlighted(),
})}
- disabled
+ onClick={() => {
+ fetchNextGroupPage(
+ group().key
+ );
+ }}
>
- <Spinner class="size-3 animate-spin" />
- Loading...
+ <CaretDownIcon class="size-2.5" />
+ Load More
</Button>
- }
- >
- <Button
- variant="base"
- size="sm"
- depth={2}
- class={cn({
- 'bg-surface': !highlighted(),
- 'border-transparent':
- highlighted(),
- })}
- onClick={() => {
- fetchNextGroupPage(group().key);
- }}
- >
- <CaretDownIcon class="size-2.5" />
- Load More
- </Button>
- </Show>
- </div>
- );
- }}
- </Match>
-
- {/* Entity row */}
- <Match
- when={!row.group || row.group?.isExpanded()}
- >
- <SoupEntityContextMenu
- entity={row.original}
+ </Show>
+ </div>
+ );
+ }}
+ </Match>
+
+ {/* Entity row */}
+ <Match
+ when={
+ !row.group || row.group?.isExpanded()
+ }
>
- <Dynamic
- component={listEntityComponent()}
+ <SoupEntityContextMenu
entity={row.original}
- timestamp={timestamp()}
- highlighted={row.isFocused()}
- onMouseMove={() => {
- if (isKeypressActive()) return;
- if (
- soup.previewEntity() ||
- isNewInboxEnabled()
- )
- return;
- soup.focus.setIndex(row.index);
- }}
- showUnrollNotifications={
- row.original.type !== 'email' &&
- soup.predicates.isActive('inbox') &&
- !soup.predicates.isActive('noise')
- }
- checked={row.isSelected()}
- onChecked={(
- next: boolean,
- shiftKey: boolean
- ) =>
- handleMultiSelectChecked({
- entity: row.original,
- entityIndex: i(),
- next,
- shiftKey: shiftKey ?? false,
- })
- }
- onClick={(event: MouseEvent) => {
- onEntityClick({
- type: 'entity',
- entity: row.original,
- event,
- location: undefined,
- rowIndex: row.index,
- });
- }}
- onProjectClick={(
- projectEntity,
- event
- ) => {
- onEntityClick({
- type: 'project',
+ >
+ <Dynamic
+ component={listEntityComponent()}
+ entity={row.original}
+ timestamp={timestamp()}
+ highlighted={row.isFocused()}
+ onMouseMove={() => {
+ if (isKeypressActive()) return;
+ if (
+ soup.previewEntity() ||
+ isNewInboxEnabled()
+ )
+ return;
+ soup.focus.setIndex(row.index);
+ }}
+ showUnrollNotifications={
+ row.original.type !== 'email' &&
+ soup.predicates.isActive('inbox') &&
+ !soup.predicates.isActive('noise')
+ }
+ checked={row.isSelected()}
+ onChecked={(
+ next: boolean,
+ shiftKey: boolean
+ ) =>
+ handleMultiSelectChecked({
+ entity: row.original,
+ entityIndex: i(),
+ next,
+ shiftKey: shiftKey ?? false,
+ })
+ }
+ onClick={(event: MouseEvent) => {
+ onEntityClick({
+ type: 'entity',
+ entity: row.original,
+ event,
+ location: undefined,
+ rowIndex: row.index,
+ });
+ }}
+ onProjectClick={(
projectEntity,
- entity: row.original,
- event,
- location: undefined,
- rowIndex: row.index,
- });
- }}
- onContentHitClick={(
- e: PointerEvent | MouseEvent,
- location?: SearchLocation
- ) => {
- onEntityClick({
- type: 'entity',
- entity: row.original,
- event: e,
- location,
- rowIndex: row.index,
- });
- }}
- entityRowConfig={{
- swipeLeftColor: 'bg-success',
- swipeLeftRevealedComponent: (
- <CheckIcon class="size-8 text-panel" />
- ),
- }}
- />
- </SoupEntityContextMenu>
- </Match>
- </Switch>
- <Show
- when={
- i() === rows().length - 1 &&
- (isSearchServiceLoading() ||
- source.isFetchingNextPage())
- }
- >
- <div class="flex items-center gap-2 p-3 text-xs text-text-muted">
- <Spinner class="size-3 animate-spin" />
- {source.isFetchingNextPage()
- ? 'Loading more...'
- : 'Searching...'}
- </div>
- </Show>
- <Show when={i() === rows().length - 1}>
- {/* Desktop-only: mobile clearance comes
+ event
+ ) => {
+ onEntityClick({
+ type: 'project',
+ projectEntity,
+ entity: row.original,
+ event,
+ location: undefined,
+ rowIndex: row.index,
+ });
+ }}
+ onContentHitClick={(
+ e: PointerEvent | MouseEvent,
+ location?: SearchLocation
+ ) => {
+ onEntityClick({
+ type: 'entity',
+ entity: row.original,
+ event: e,
+ location,
+ rowIndex: row.index,
+ });
+ }}
+ entityRowConfig={{
+ swipeLeftColor: 'bg-success',
+ swipeLeftRevealedComponent: (
+ <CheckIcon class="size-8 text-panel" />
+ ),
+ }}
+ />
+ </SoupEntityContextMenu>
+ </Match>
+ </Switch>
+ <Show
+ when={
+ i() === rows().length - 1 &&
+ (isSearchServiceLoading() ||
+ source.isFetchingNextPage())
+ }
+ >
+ <div class="flex items-center gap-2 p-3 text-xs text-text-muted">
+ <Spinner class="size-3 animate-spin" />
+ {source.isFetchingNextPage()
+ ? 'Loading more...'
+ : 'Searching...'}
+ </div>
+ </Show>
+ <Show when={i() === rows().length - 1}>
+ {/* Desktop-only: mobile clearance comes
from the in-scroll trailing spacer. */}
- <div class="h-15 mobile:hidden" />
- </Show>
- </>
- );
+ <div class="h-15 mobile:hidden" />
+ </Show>
+ </>
+ );
+ }}
+ </SoupList>
+ </EntityRowProvider>
+ </ListLayoutProvider>
+
+ <Show when={!props.customScrollbarHidden}>
+ <CustomScrollbar
+ scrollContainer={() => {
+ // Find the actual scroll container (VList creates its own scroll container)
+ const listEl = localEntityListRef();
+ if (!listEl) return undefined;
+ const scrollContainer = listEl.querySelector(
+ soupListContainerSelector
+ ) as HTMLElement;
+ return scrollContainer || undefined;
}}
- </SoupList>
- </EntityRowProvider>
- </ListLayoutProvider>
-
- <Show when={!props.customScrollbarHidden}>
- <CustomScrollbar
- scrollContainer={() => {
- // Find the actual scroll container (VList creates its own scroll container)
- const listEl = localEntityListRef();
- if (!listEl) return undefined;
- const scrollContainer = listEl.querySelector(
- soupListContainerSelector
- ) as HTMLElement;
- return scrollContainer || undefined;
- }}
- />
- </Show>
- </Match>
- </Switch>
- </StaticMarkdownContext>
- </div>
+ />
+ </Show>
+ </Match>
+ </Switch>
+ </StaticMarkdownContext>
+ </div>
+ </SoupViewFileDropzone>
</Resize.Panel>
+
<Show when={paneVisible()}>
<Resize.Panel
id="soup-preview"