Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: add unit test for src/utils/server/geo.ts #5913

Closed
wants to merge 14 commits into from
Closed
25 changes: 0 additions & 25 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,6 @@

# Changelog

### [Version 1.53.6](https://github.com/lobehub/lobe-chat/compare/v1.53.5...v1.53.6)

<sup>Released on **2025-02-13**</sup>

#### 🐛 Bug Fixes

- **misc**: Fix not enable models correctly.

<br/>

<details>
<summary><kbd>Improvements and Fixes</kbd></summary>

#### What's fixed

- **misc**: Fix not enable models correctly, closes [#6071](https://github.com/lobehub/lobe-chat/issues/6071) ([b78328e](https://github.com/lobehub/lobe-chat/commit/b78328e))

</details>

<div align="right">

[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)

</div>

### [Version 1.53.5](https://github.com/lobehub/lobe-chat/compare/v1.53.4...v1.53.5)

<sup>Released on **2025-02-13**</sup>
Expand Down
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ ARG NEXT_PUBLIC_UMAMI_WEBSITE_ID

ENV NEXT_PUBLIC_BASE_PATH="${NEXT_PUBLIC_BASE_PATH}"

# Make the middleware rewrite through local as default
# refs: https://github.com/lobehub/lobe-chat/issues/5876
ENV MIDDLEWARE_REWRITE_THROUGH_LOCAL="1"

# Sentry
ENV NEXT_PUBLIC_SENTRY_DSN="${NEXT_PUBLIC_SENTRY_DSN}" \
SENTRY_ORG="" \
Expand Down
4 changes: 4 additions & 0 deletions Dockerfile.database
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ ARG NEXT_PUBLIC_UMAMI_WEBSITE_ID

ENV NEXT_PUBLIC_BASE_PATH="${NEXT_PUBLIC_BASE_PATH}"

# Make the middleware rewrite through local as default
# refs: https://github.com/lobehub/lobe-chat/issues/5876
ENV MIDDLEWARE_REWRITE_THROUGH_LOCAL="1"

ENV NEXT_PUBLIC_SERVICE_MODE="${NEXT_PUBLIC_SERVICE_MODE:-server}" \
NEXT_PUBLIC_ENABLE_NEXT_AUTH="${NEXT_PUBLIC_ENABLE_NEXT_AUTH:-1}" \
APP_URL="http://app.com" \
Expand Down
7 changes: 0 additions & 7 deletions changelog/v1.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
[
{
"children": {
"fixes": ["Fix not enable models correctly."]
},
"date": "2025-02-13",
"version": "1.53.6"
},
{
"children": {
"fixes": ["Fix latex in thinking tag render."]
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lobehub/chat",
"version": "1.53.6",
"version": "1.53.5",
"description": "Lobe Chat - an open-source, high-performance chatbot framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.",
"keywords": [
"framework",
Expand Down Expand Up @@ -173,7 +173,7 @@
"langfuse": "3.29.1",
"langfuse-core": "3.29.1",
"lodash-es": "^4.17.21",
"lucide-react": "^0.475.0",
"lucide-react": "^0.471.0",
"mammoth": "^1.9.0",
"mdast-util-to-markdown": "^2.1.2",
"modern-screenshot": "^4.5.5",
Expand Down Expand Up @@ -245,7 +245,7 @@
"devDependencies": {
"@commitlint/cli": "^19.6.1",
"@edge-runtime/vm": "^5.0.0",
"@huggingface/tasks": "^0.15.0",
"@huggingface/tasks": "^0.13.13",
"@lobehub/i18n-cli": "^1.20.3",
"@lobehub/lint": "^1.25.5",
"@lobehub/seo-cli": "^1.4.3",
Expand Down
23 changes: 23 additions & 0 deletions src/app/[variants]/(main)/chat/settings/modal/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
'use client';

import { useLayoutEffect } from 'react';

import { useQueryRoute } from '@/hooks/useQueryRoute';

/**
* @description: Chat Settings Modal (intercepting routes fallback when hard refresh)
* @example: /chat/settings/modal?tab=prompt => /chat/settings
* @refs: https://github.com/lobehub/lobe-chat/discussions/2295#discussioncomment-9290942
*/

const ChatSettingsModalFallback = () => {
const router = useQueryRoute();

useLayoutEffect(() => {
router.replace('/chat/settings', { query: { tab: '' } });
}, []);

return null;
};

export default ChatSettingsModalFallback;
61 changes: 61 additions & 0 deletions src/app/[variants]/@modal/chat/(.)settings/modal/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
'use client';

import { Skeleton } from 'antd';
import isEqual from 'fast-deep-equal';
import dynamic from 'next/dynamic';
import { PropsWithChildren, memo } from 'react';
import { useTranslation } from 'react-i18next';

import ModalLayout from '@/app/[variants]/@modal/_layout/ModalLayout';
import StoreUpdater from '@/features/AgentSetting/StoreUpdater';
import { Provider, createStore } from '@/features/AgentSetting/store';
import { useChatSettingsTab } from '@/hooks/useChatSettingsTab';
import { useAgentStore } from '@/store/agent';
import { agentSelectors } from '@/store/agent/slices/chat';
import { ChatSettingsTabs } from '@/store/global/initialState';
import { useSessionStore } from '@/store/session';
import { sessionMetaSelectors } from '@/store/session/selectors';

import SettingModalLayout from '../../../_layout/SettingModalLayout';

const CategoryContent = dynamic(() => import('./features/CategoryContent'), {
loading: () => <Skeleton paragraph={{ rows: 6 }} title={false} />,
ssr: false,
});

const Layout = memo<PropsWithChildren>(({ children }) => {
const tab = useChatSettingsTab();
const { t } = useTranslation('setting');
const id = useSessionStore((s) => s.activeId);
const config = useAgentStore(agentSelectors.currentAgentConfig, isEqual);
const meta = useSessionStore(sessionMetaSelectors.currentAgentMeta, isEqual);
const [updateAgentConfig] = useAgentStore((s) => [s.updateAgentConfig]);
const [updateAgentMeta] = useSessionStore((s) => [
s.updateSessionMeta,
sessionMetaSelectors.currentAgentTitle(s),
]);

return (
<ModalLayout>
<SettingModalLayout
activeTitle={t(`agentTab.${tab as ChatSettingsTabs}`)}
category={<CategoryContent />}
desc={t('header.sessionDesc')}
title={t('header.session')}
>
<Provider createStore={createStore}>
<StoreUpdater
config={config}
id={id}
meta={meta}
onConfigChange={updateAgentConfig}
onMetaChange={updateAgentMeta}
/>
{children}
</Provider>
</SettingModalLayout>
</ModalLayout>
);
});

export default Layout;
5 changes: 5 additions & 0 deletions src/app/[variants]/@modal/chat/(.)settings/modal/loading.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { Skeleton } from 'antd';

export default () => {
return <Skeleton paragraph={{ rows: 6 }} style={{ paddingBlock: 16 }} />;
};
56 changes: 56 additions & 0 deletions src/app/[variants]/@modal/chat/(.)settings/modal/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
'use client';

import dynamic from 'next/dynamic';

import { useChatSettingsTab } from '@/hooks/useChatSettingsTab';
import { ChatSettingsTabs } from '@/store/global/initialState';

import Skeleton from './loading';

const loading = () => <Skeleton />;

const AgentMeta = dynamic(() => import('@/features/AgentSetting/AgentMeta'), {
loading,
ssr: false,
});
const AgentChat = dynamic(() => import('@/features/AgentSetting/AgentChat'), {
loading,
ssr: false,
});
const AgentPrompt = dynamic(() => import('@/features/AgentSetting/AgentPrompt'), {
loading,
ssr: false,
});
const AgentPlugin = dynamic(() => import('@/features/AgentSetting/AgentPlugin'), {
loading,
ssr: false,
});
const AgentModal = dynamic(() => import('@/features/AgentSetting/AgentModal'), {
loading,
ssr: false,
});
const AgentTTS = dynamic(() => import('@/features/AgentSetting/AgentTTS'), { loading, ssr: false });

/**
* @description: Agent Settings Modal (intercepting route: /chat/settings/modal )
* @refs: https://github.com/lobehub/lobe-chat/discussions/2295#discussioncomment-9290942
*/

const Page = () => {
const tab = useChatSettingsTab();

return (
<>
{tab === ChatSettingsTabs.Meta && <AgentMeta />}
{tab === ChatSettingsTabs.Prompt && <AgentPrompt modal />}
{tab === ChatSettingsTabs.Chat && <AgentChat />}
{tab === ChatSettingsTabs.Modal && <AgentModal />}
{tab === ChatSettingsTabs.TTS && <AgentTTS />}
{tab === ChatSettingsTabs.Plugin && <AgentPlugin />}
</>
);
};

Page.displayName = 'AgentSettingModal';

export default Page;
Loading
Loading