diff --git a/src/modules/llms/models-modal/ModelsList.tsx b/src/modules/llms/models-modal/ModelsList.tsx index c3ed54f2b..9e93860bd 100644 --- a/src/modules/llms/models-modal/ModelsList.tsx +++ b/src/modules/llms/models-modal/ModelsList.tsx @@ -9,7 +9,7 @@ import VisibilityOutlinedIcon from '@mui/icons-material/VisibilityOutlined'; import type { DModelsServiceId } from '~/common/stores/llms/llms.service.types'; import { isLLMChatFree_cached } from '~/common/stores/llms/llms.pricing'; -import { DLLM, DLLMId, getLLMContextTokens, getLLMLabel, getLLMMaxOutputTokens, isLLMCustomUserParameters, isLLMHidden, LLM_IF_ANT_PromptCaching, LLM_IF_GEM_CodeExecution, LLM_IF_OAI_Fn, LLM_IF_OAI_Json, LLM_IF_OAI_PromptCaching, LLM_IF_OAI_Reasoning, LLM_IF_OAI_Vision, LLM_IF_Outputs_Audio, LLM_IF_Outputs_Image, LLM_IF_Tools_WebSearch } from '~/common/stores/llms/llms.types'; +import { DLLM, DLLMId, getLLMContextTokens, getLLMLabel, getLLMMaxOutputTokens, getLLMPubDate, isLLMCustomUserParameters, isLLMHidden, LLM_IF_ANT_PromptCaching, LLM_IF_GEM_CodeExecution, LLM_IF_OAI_Fn, LLM_IF_OAI_Json, LLM_IF_OAI_PromptCaching, LLM_IF_OAI_Reasoning, LLM_IF_OAI_Vision, LLM_IF_Outputs_Audio, LLM_IF_Outputs_Image, LLM_IF_Tools_WebSearch } from '~/common/stores/llms/llms.types'; import { GoodTooltip } from '~/common/components/GoodTooltip'; import { PhGearSixIcon } from '~/common/components/icons/phosphor/PhGearSixIcon'; import { STAR_EMOJI, StarredToggle, starredToggleStyle } from '~/common/components/StarIcons'; @@ -99,6 +99,10 @@ export const ModelItem = React.memo(function ModelItem(props: { const isNotSymlink = !llm.label.startsWith('🔗'); // getLLMLabel exception: need access to the base const llmLabel = getLLMLabel(llm); + // "new" badge: shown only when pubDate is set AND within the last 30 days + const pubDate = getLLMPubDate(llm); + const isRecentlyPublished = pubDate ? (Date.now() - pubDate.getTime()) < 30 * 24 * 60 * 60 * 1000 : false; + const handleLLMConfigure = React.useCallback((event: React.MouseEvent) => { event.stopPropagation(); @@ -227,6 +231,7 @@ export const ModelItem = React.memo(function ModelItem(props: { } {/* Features Chips - sync with `useLLMSelect.tsx` */} + {isRecentlyPublished && isNotSymlink && pubDate && new} {featuresChipMemo} {seemsFree && isNotSymlink && free}