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(filters): clean up soup/search filters (#2661)

gbirman628a22de2735
diff --git a/js/app/packages/app/component/SoupChatInput.tsx b/js/app/packages/app/component/SoupChatInput.tsx
index b27efcaa02..b77807a9ad 100644
--- a/js/app/packages/app/component/SoupChatInput.tsx
+++ b/js/app/packages/app/component/SoupChatInput.tsx
@@ -22,12 +22,11 @@ import { invalidateAllSoup } from '@queries/soup/cache';
import { cognitionApiServiceClient } from '@service-cognition/client';
import { ChatInput } from 'core/component/AI/component/input/ChatInput';
import { registerHotkey, useHotkeyDOMScope } from 'core/hotkey/hotkeys';
-import { createSignal, onCleanup, onMount, Show } from 'solid-js';
+import { createSignal, onCleanup, Show } from 'solid-js';
import { useSplitPanelOrThrow } from './split-layout/layoutUtils';
function SoupChatInputInner() {
const analytics = useAnalytics();
- let containerRef!: HTMLDivElement;
const splitPanelContext = useSplitPanelOrThrow();
const soup = useSoup();
const input = useChatInputContext();
@@ -50,17 +49,17 @@ function SoupChatInputInner() {
const [chatHasFocus, setChatHasFocus] = createSignal(false);
const metaHeld = () => chatHasFocus() && pressedKeys().has('cmd');
- onMount(() => {
- attachHotkeys(containerRef);
+ const attachContainer = (el: HTMLDivElement) => {
+ attachHotkeys(el);
const focusIn = () => setChatHasFocus(true);
const focusOut = () => setChatHasFocus(false);
- containerRef.addEventListener('focusin', focusIn);
- containerRef.addEventListener('focusout', focusOut);
+ el.addEventListener('focusin', focusIn);
+ el.addEventListener('focusout', focusOut);
onCleanup(() => {
- containerRef.removeEventListener('focusin', focusIn);
- containerRef.removeEventListener('focusout', focusOut);
+ el.removeEventListener('focusin', focusIn);
+ el.removeEventListener('focusout', focusOut);
});
- });
+ };
// cmd+j - Focus AI chat
registerHotkey({
@@ -128,7 +127,7 @@ function SoupChatInputInner() {
return (
<Show when={!soup.previewEntity()}>
<div
- ref={containerRef}
+ ref={attachContainer}
class="absolute bottom-0 right-px left-px pb-2 px-2 flex justify-center pointer-events-none"
style={{
'background-image': `linear-gradient(transparent, var(--color-panel) 85%)`,
diff --git a/js/app/packages/app/component/next-soup/soup-view/filters-bar/active-filter-chips.tsx b/js/app/packages/app/component/next-soup/soup-view/filters-bar/active-filter-chips.tsx
index 55b7435126..ece4d16315 100644
--- a/js/app/packages/app/component/next-soup/soup-view/filters-bar/active-filter-chips.tsx
+++ b/js/app/packages/app/component/next-soup/soup-view/filters-bar/active-filter-chips.tsx
@@ -395,7 +395,7 @@ export const ActiveFilterChips = (props: ActiveFilterChipsProps) => {
variant="ghost"
onClick={() => props.onClearAll()}
>
- Clear all
+ Clear
</Button>
</span>
</Show>
diff --git a/js/app/packages/app/component/next-soup/soup-view/filters-bar/unified-filter-dropdown.tsx b/js/app/packages/app/component/next-soup/soup-view/filters-bar/unified-filter-dropdown.tsx
index 46926898d2..2bcc40ea2a 100644
--- a/js/app/packages/app/component/next-soup/soup-view/filters-bar/unified-filter-dropdown.tsx
+++ b/js/app/packages/app/component/next-soup/soup-view/filters-bar/unified-filter-dropdown.tsx
@@ -561,7 +561,7 @@ export const UnifiedFilterDropdown = () => {
as={Button}
variant="secondary"
size="sm"
- class="rounded-xs [&_svg]:size-4"
+ class="rounded-xs [&_svg]:size-4 suppress-css-bracket"
>
<SlidersHorizontalIcon />
<span class="font-medium">Filter</span>
@@ -688,6 +688,14 @@ export const UnifiedFilterDropdown = () => {
onPointerDown={() =>
handleIndexChange(option.value)
}
+ onKeyDown={(e) => {
+ if (e.key === 'Enter' || e.key === ' ') {
+ e.preventDefault();
+ e.stopPropagation();
+ handleIndexChange(option.value);
+ setOpen(false);
+ }
+ }}
>
<TypeIndicator active={active()} />
<Show when={option.icon}>