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): restore collapse animation on inbox swipe mark done (#3849)

Peter Chinman475221d2ff83
diff --git a/js/app/packages/app/component/next-soup/create-soup-state.ts b/js/app/packages/app/component/next-soup/create-soup-state.ts
index 79f7711d53..a6e9f4ed5c 100644
--- a/js/app/packages/app/component/next-soup/create-soup-state.ts
+++ b/js/app/packages/app/component/next-soup/create-soup-state.ts
@@ -14,6 +14,17 @@ import { isTouchDevice } from '@core/mobile/isTouchDevice';
import type { EntityData, WithNotification, WithSearch } from '@entity';
import { createMemo, createSignal, type JSX } from 'solid-js';
+/**
+ * Active "focus" predicates that exclude done entities. When one of these is
+ * active, marking an entity done removes it from the list, so its row should
+ * collapse before being removed rather than disappearing instantly.
+ *
+ * The inbox tabs activate `inbox` / `noise` rather than the standalone
+ * `not-done` predicate (see `soup-filter-presets.ts`), so all three are
+ * included here.
+ */
+const COLLAPSE_ON_DONE_PREDICATES: FilterID[] = ['not-done', 'inbox', 'noise'];
+
export type SoupEntity = WithNotification<EntityData | WithSearch<EntityData>>;
export type GroupHeaderProps = {
@@ -343,7 +354,7 @@ export const createSoupState = <TId extends string = FilterID>(
set: setCollapseEntityCallback,
shouldCollapse: () => {
return (
- predicates.isActive('not-done') &&
+ COLLAPSE_ON_DONE_PREDICATES.some((id) => predicates.isActive(id)) &&
collapseEntityCallback() !== undefined &&
isModality('touch')
);