Skip to content

Commit facd5e0

Browse files
committed
Merge branch 'feat/assistant' of github.com:lowcoder-org/lowcoder into feat/chat-component
2 parents 158de18 + 734b320 commit facd5e0

28 files changed

+2218
-386
lines changed

client/packages/lowcoder-design/src/icons/index.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import React, { lazy, Suspense } from "react";
22

3+
export { ReactComponent as AIGenerate } from "./remix/ai-generate.svg";
4+
export { ReactComponent as AIGenerate2 } from "./remix/ai-generate-2.svg";
5+
export { ReactComponent as AIGenerateText } from "./remix/ai-generate-text.svg";
36
export { ReactComponent as AppSnapshotIcon } from "./v1/app-snapshot.svg";
47
export { ReactComponent as ArchiveIcon } from "./remix/archive-fill.svg";
58
export { ReactComponent as HookCompDropIcon } from "./v1/hook-comp-drop.svg";

client/packages/lowcoder/src/comps/comps/chatComp/chatCompTypes.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,12 @@ export const chatChildrenMap = {
1717
chatQuery: QuerySelectControl,
1818
currentMessage: stringExposingStateControl("currentMessage", ""),
1919
modelType: dropdownControl(ModelTypeOptions, "direct-llm"),
20+
modelHost: withDefault(StringControl, ""),
2021
streaming: BoolControl.DEFAULT_TRUE,
2122
systemPrompt: withDefault(StringControl, "You are a helpful assistant."),
2223
agent: BoolControl,
2324
maxInteractions: withDefault(NumberControl, 10),
25+
tableName: withDefault(StringControl, ""),
2426
};
2527

2628
export type ChatCompProps = {

client/packages/lowcoder/src/comps/comps/chatComp/chatPropertyView.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// client/packages/lowcoder/src/comps/comps/chatComp/chatPropertyView.tsx
22
import React from "react";
33
import { Section, sectionNames } from "lowcoder-design";
4+
import { trans } from "i18n";
45

56
export const ChatPropertyView = React.memo((props: any) => {
67
const { children } = props;

client/packages/lowcoder/src/comps/comps/chatComp/components/ChatMain.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ const ChatContainer = styled.div`
2323
display: flex;
2424
height: 500px;
2525
26+
p {
27+
margin: 0;
28+
}
29+
2630
.aui-thread-list-root {
2731
width: 250px;
2832
background-color: #fff;

client/packages/lowcoder/src/comps/comps/chatComp/components/assistant-ui/thread-list.tsx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,30 +7,32 @@ import { PencilIcon, PlusIcon, Trash2Icon } from "lucide-react";
77

88
import { TooltipIconButton } from "./tooltip-icon-button";
99
import { useThreadListItemRuntime } from "@assistant-ui/react";
10-
import { Button } from "antd";
10+
import { Button, Flex } from "antd";
1111

1212
import styled from "styled-components";
1313
import { useChatContext } from "../context/ChatContext";
1414

1515
const StyledPrimaryButton = styled(Button)`
16-
padding: 20px;
17-
margin-bottom: 20px;
16+
// padding: 20px;
17+
// margin-bottom: 20px;
1818
`;
1919

2020

2121
export const ThreadList: FC = () => {
2222
return (
2323
<ThreadListPrimitive.Root className="aui-root aui-thread-list-root">
2424
<ThreadListNew />
25-
<ThreadListItems />
25+
<Flex vertical style={{flex: 1, overflow: 'auto', gap: 4}}>
26+
<ThreadListItems />
27+
</Flex>
2628
</ThreadListPrimitive.Root>
2729
);
2830
};
2931

3032
const ThreadListNew: FC = () => {
3133
return (
3234
<ThreadListPrimitive.New asChild>
33-
<StyledPrimaryButton size="large" type="primary" icon={<PlusIcon />}>
35+
<StyledPrimaryButton size="middle" type="primary" icon={<PlusIcon size={16}/>}>
3436
New Thread
3537
</StyledPrimaryButton>
3638
</ThreadListPrimitive.New>
@@ -54,9 +56,8 @@ const ThreadListItem: FC = () => {
5456
};
5557

5658
const ThreadListItemTitle: FC = () => {
57-
5859
return (
59-
<p className="aui-thread-list-item-title">
60+
<p className="aui-thread-list-item-title" style={{margin: 0}}>
6061
<ThreadListItemPrimitive.Title fallback="New Chat" />
6162
</p>
6263
);

0 commit comments

Comments
 (0)