diff --git a/apps/desktop/layer/renderer/src/modules/ai-chat/editor/plugins/mention/MentionPlugin.tsx b/apps/desktop/layer/renderer/src/modules/ai-chat/editor/plugins/mention/MentionPlugin.tsx index 22b898c75..57f62b22d 100644 --- a/apps/desktop/layer/renderer/src/modules/ai-chat/editor/plugins/mention/MentionPlugin.tsx +++ b/apps/desktop/layer/renderer/src/modules/ai-chat/editor/plugins/mention/MentionPlugin.tsx @@ -2,7 +2,6 @@ import * as React from "react" import { Suspense, useMemo } from "react" import { MentionDropdown } from "./components/MentionDropdown" -import { DEFAULT_MAX_SUGGESTIONS } from "./constants" import { useMentionKeyboard } from "./hooks/useMentionKeyboard" import { useMentionSearch } from "./hooks/useMentionSearch" import { useMentionSearchService } from "./hooks/useMentionSearchService" @@ -31,7 +30,6 @@ export function MentionPlugin() { hasResults, } = useMentionSearch({ onSearch: searchMentions, - maxSuggestions: DEFAULT_MAX_SUGGESTIONS, }) // Hook for handling mention selection diff --git a/apps/desktop/layer/renderer/src/modules/ai-chat/editor/plugins/mention/components/MentionDropdown.tsx b/apps/desktop/layer/renderer/src/modules/ai-chat/editor/plugins/mention/components/MentionDropdown.tsx index 491aa87e9..ef37ca9e0 100644 --- a/apps/desktop/layer/renderer/src/modules/ai-chat/editor/plugins/mention/components/MentionDropdown.tsx +++ b/apps/desktop/layer/renderer/src/modules/ai-chat/editor/plugins/mention/components/MentionDropdown.tsx @@ -1,8 +1,9 @@ import { cn, thenable } from "@follow/utils" import * as React from "react" -import { useCallback } from "react" +import { useCallback, useMemo } from "react" import { useTranslation } from "react-i18next" +import type { TypeaheadGroup } from "../../shared/components/TypeaheadDropdown" import { TypeaheadDropdown } from "../../shared/components/TypeaheadDropdown" import { MENTION_TRIGGER_PATTERN } from "../constants" import { RANGE_WITH_LABEL_KEY } from "../hooks/dateMentionConfig" @@ -110,6 +111,41 @@ const MentionSuggestionItem = React.memo( MentionSuggestionItem.displayName = "MentionSuggestionItem" +const MentionGroupHeader = React.memo(({ type }: { type: MentionData["type"] }) => { + const { t } = useTranslation("ai") + + const label = useMemo(() => { + switch (type) { + case "date": { + return t("mentions.section.date") + } + case "entry": { + return t("mentions.section.entry") + } + case "feed": { + return t("mentions.section.feed") + } + case "category": { + return t("mentions.section.category") + } + case "view": { + return t("mentions.section.view") + } + default: { + return "" + } + } + }, [type, t]) + + return ( +