Skip to content

Commit

Permalink
Merge pull request #178 from lobehub/platform-optimize
Browse files Browse the repository at this point in the history
fix: Plausiable key & scrollbar
  • Loading branch information
rdmclin2 authored Dec 4, 2024
2 parents a5d5797 + 15479f4 commit 35be185
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 19 deletions.
2 changes: 0 additions & 2 deletions src/app/chat/ChatMode/ChatInfo/AgentDetail/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { Flexbox } from 'react-layout-kit';

import AgentCard from '@/components/agent/AgentCard';
import SystemRole from '@/components/agent/SystemRole';
import { CHAT_HEADER_HEIGHT } from '@/constants/token';
import useSessionContext from '@/hooks/useSessionContext';

import EditRole from '../actions/EditRole';
Expand All @@ -17,7 +16,6 @@ const ChatInfo = () => {
return (
sessionAgent && (
<AgentCard
style={{ height: `calc(100vh - ${CHAT_HEADER_HEIGHT}px)` }}
agent={sessionAgent}
actions={[
<Flexbox horizontal justify={'space-between'} align="center" key="token-history">
Expand Down
15 changes: 4 additions & 11 deletions src/app/chat/ChatMode/ChatInfo/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { DraggablePanel, DraggablePanelContainer } from '@lobehub/ui';
import { DraggablePanel } from '@lobehub/ui';
import { Skeleton, Space } from 'antd';
import { createStyles, useResponsive } from 'antd-style';
import isEqual from 'lodash-es/isEqual';
Expand All @@ -7,7 +7,7 @@ import { rgba } from 'polished';
import React, { memo, useEffect, useState } from 'react';
import { Flexbox } from 'react-layout-kit';

import { SIDEBAR_WIDTH } from '@/constants/token';
import { CHAT_HEADER_HEIGHT, SIDEBAR_WIDTH } from '@/constants/token';
import { useGlobalStore } from '@/store/global';

const AgentDetail = dynamic(() => import('./AgentDetail'), {
Expand Down Expand Up @@ -73,16 +73,9 @@ const ChatInfo = memo(() => {
onExpandChange={handleExpand}
expand={showAgentInfo}
>
<DraggablePanelContainer
style={{
flex: 'none',
height: '100%',
maxHeight: '100vh',
minWidth: SIDEBAR_WIDTH,
}}
>
<div style={{ height: `calc(100vh - ${CHAT_HEADER_HEIGHT}px)`, overflowY: 'auto' }}>
<AgentDetail />
</DraggablePanelContainer>
</div>
</DraggablePanel>
);
});
Expand Down
1 change: 0 additions & 1 deletion src/app/chat/ChatMode/SideBar/SessionList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ const List = dynamic(() => import('./List'), {

const useStyles = createStyles(({ css, token, prefixCls }) => ({
session: css`
overflow-y: auto;
height: 100%;
`,
list: css`
Expand Down
6 changes: 4 additions & 2 deletions src/app/chat/ChatMode/SideBar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import isEqual from 'lodash-es/isEqual';
import { rgba } from 'polished';
import { memo, useEffect, useState } from 'react';

import { SIDEBAR_WIDTH } from '@/constants/token';
import { CHAT_HEADER_HEIGHT, SIDEBAR_WIDTH } from '@/constants/token';
import { useGlobalStore } from '@/store/global';

import SessionList from './SessionList';
Expand Down Expand Up @@ -58,7 +58,9 @@ const SideBar = memo(() => {
onExpandChange={handleExpand}
expand={showSessionList}
>
<SessionList />
<div style={{ height: `calc(100vh - ${CHAT_HEADER_HEIGHT}px)`, overflowY: 'auto' }}>
<SessionList />
</div>
</DraggablePanel>
);
});
Expand Down
9 changes: 6 additions & 3 deletions src/components/Analytics/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { siteUrl } from '@/server/utils/url';

import Google from './Google';
import Plausible from './Plausible';
import Vercel from './Vercel';
Expand All @@ -9,7 +7,12 @@ const Analytics = () => {
<>
{<Vercel />}
{<Google />}
{<Plausible scriptBaseUrl={process.env.PLAUSIBLE_SCRIPT_BASE_URL} domain={siteUrl} />}
{
<Plausible
scriptBaseUrl={process.env.PLAUSIBLE_SCRIPT_BASE_URL}
domain={process.env.PLAUSIBLE_DOMAIN}
/>
}
</>
);
};
Expand Down

0 comments on commit 35be185

Please sign in to comment.