Skip to content

Commit 6afd36f

Browse files
committed
feat(chat): support multiple conversation
1 parent 950c864 commit 6afd36f

30 files changed

+1399
-28
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@
116116
"@handsontable/react": "2.1.0",
117117
"antd": "4.22.5",
118118
"classnames": "^2.2.6",
119+
"dayjs": "^1.11.19",
119120
"handsontable": "6.2.2",
120121
"highlight.js": "^10.5.0",
121122
"immer": "~10.1.1",

pnpm-lock.yaml

Lines changed: 6 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/chat/__tests__/__snapshots__/button.test.tsx.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,4 @@ exports[`Test Chat Button Match the snapshot: secondary button 1`] = `
4545
</DocumentFragment>
4646
`;
4747

48-
exports[`Test Chat Button expect ONLY one global gradient div: global gradient 1`] = `"<svg width="0" height="0"><defs><linearGradient id="secondary_linear_gradient" x1="1.18164" y1="3.93164" x2="13.9881" y2="8.54198" gradientUnits="userSpaceOnUse"><stop stop-color="#00BAC6"></stop><stop offset="0.5" stop-color="#0067FF"></stop><stop offset="1" stop-color="#450FDE"></stop></linearGradient><linearGradient id="secondary_linear_gradient_hover" x1="8.96582" y1="0.96582" x2="15.9711" y2="3.4877" gradientUnits="userSpaceOnUse"><stop stop-color="#00BAC6"></stop><stop offset="0.5" stop-color="#0067FF"></stop><stop offset="1" stop-color="#450FDE"></stop></linearGradient></defs></svg>"`;
48+
exports[`Test Chat Button expect ONLY one global gradient div: global gradient 1`] = `"<svg width="0" height="0"><defs><linearGradient id="secondary_linear_gradient" x1="0" y1="0.2" x2="0.9" y2="0.5"><stop stop-color="#00BAC6"></stop><stop offset="0.5" stop-color="#0067FF"></stop><stop offset="1" stop-color="#450FDE"></stop></linearGradient><linearGradient id="secondary_linear_gradient_hover" x1="0.5" y1="0" x2="1" y2="0.2"><stop stop-color="#00BAC6"></stop><stop offset="0.5" stop-color="#0067FF"></stop><stop offset="1" stop-color="#450FDE"></stop></linearGradient></defs></svg>"`;
Lines changed: 202 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,202 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`Test Chat Conversations Match snapshot 1`] = `
4+
<DocumentFragment>
5+
<div
6+
class="dtc-conversations-wrapper dtc-conversations--collapsed"
7+
>
8+
<ul
9+
class="dtc-conversations"
10+
/>
11+
</div>
12+
</DocumentFragment>
13+
`;
14+
15+
exports[`Test Chat Conversations Match snapshot: collapsed 1`] = `
16+
<DocumentFragment>
17+
<div
18+
class="dtc-conversations-wrapper dtc-conversations--collapsed"
19+
>
20+
<ul
21+
class="dtc-conversations"
22+
/>
23+
</div>
24+
</DocumentFragment>
25+
`;
26+
27+
exports[`Test Chat Conversations Match snapshot: groupable 1`] = `
28+
<DocumentFragment>
29+
<div
30+
class="dtc-conversations-wrapper dtc-conversations--collapsed"
31+
>
32+
<ul
33+
class="dtc-conversations"
34+
>
35+
<li>
36+
<div
37+
class="dtc-conversations-title"
38+
>
39+
<div
40+
data-testid="ellipsisText"
41+
>
42+
昨天
43+
</div>
44+
</div>
45+
<ul
46+
class="dtc-conversations-list"
47+
>
48+
<div
49+
class="dtc-conversations-item"
50+
>
51+
<div
52+
class="dtc-conversations-item-title"
53+
>
54+
<div
55+
data-testid="ellipsisText"
56+
>
57+
this is conversation 1
58+
</div>
59+
</div>
60+
</div>
61+
</ul>
62+
</li>
63+
<li>
64+
<div
65+
class="dtc-conversations-title"
66+
>
67+
<div
68+
data-testid="ellipsisText"
69+
>
70+
今天
71+
</div>
72+
</div>
73+
<ul
74+
class="dtc-conversations-list"
75+
>
76+
<div
77+
class="dtc-conversations-item"
78+
>
79+
<div
80+
class="dtc-conversations-item-title"
81+
>
82+
<div
83+
data-testid="ellipsisText"
84+
>
85+
this is conversation 2
86+
</div>
87+
</div>
88+
</div>
89+
</ul>
90+
</li>
91+
</ul>
92+
</div>
93+
</DocumentFragment>
94+
`;
95+
96+
exports[`Test Chat Conversations Match snapshot: handleCreateChat 1`] = `
97+
<DocumentFragment>
98+
<div
99+
class="dtc-conversations-wrapper dtc-conversations--collapsed"
100+
>
101+
<button
102+
class="ant-btn ant-btn-default ant-btn-background-ghost dtc__aigc__button prompt-float-chat-add dtc__aigc__button--secondary"
103+
style="margin: 16px; gap: 4px; display: flex; align-items: center; justify-content: center;"
104+
type="button"
105+
>
106+
<span
107+
data-mock-icon="NewChatOutlined"
108+
/>
109+
<span
110+
class="dtc__aigc__button__text"
111+
>
112+
开启新对话
113+
</span>
114+
</button>
115+
<ul
116+
class="dtc-conversations"
117+
/>
118+
</div>
119+
</DocumentFragment>
120+
`;
121+
122+
exports[`Test Chat Conversations Match snapshot: loading 1`] = `
123+
<DocumentFragment>
124+
<div
125+
class="dtc-conversations-wrapper dtc-conversations--collapsed"
126+
>
127+
<div
128+
aria-busy="true"
129+
aria-live="polite"
130+
class="ant-spin ant-spin-spinning dtc-conversations-spin-wrapper"
131+
>
132+
<span
133+
class="ant-spin-dot ant-spin-dot-spin"
134+
>
135+
<i
136+
class="ant-spin-dot-item"
137+
/>
138+
<i
139+
class="ant-spin-dot-item"
140+
/>
141+
<i
142+
class="ant-spin-dot-item"
143+
/>
144+
<i
145+
class="ant-spin-dot-item"
146+
/>
147+
</span>
148+
</div>
149+
</div>
150+
</DocumentFragment>
151+
`;
152+
153+
exports[`Test Chat Conversations Match snapshot: normal 1`] = `
154+
<DocumentFragment>
155+
<div
156+
class="dtc-conversations-wrapper dtc-conversations--collapsed"
157+
>
158+
<ul
159+
class="dtc-conversations"
160+
>
161+
<div
162+
class="dtc-conversations-item"
163+
>
164+
<div
165+
class="dtc-conversations-item-title"
166+
>
167+
<div
168+
data-testid="ellipsisText"
169+
>
170+
this is conversation 1
171+
</div>
172+
</div>
173+
</div>
174+
<div
175+
class="dtc-conversations-item"
176+
>
177+
<div
178+
class="dtc-conversations-item-title"
179+
>
180+
<div
181+
data-testid="ellipsisText"
182+
>
183+
this is conversation 2
184+
</div>
185+
</div>
186+
</div>
187+
</ul>
188+
</div>
189+
</DocumentFragment>
190+
`;
191+
192+
exports[`Test Chat Conversations Match snapshot: select 1`] = `
193+
<DocumentFragment>
194+
<div
195+
class="dtc-conversations-wrapper dtc-conversations--collapsed"
196+
>
197+
<ul
198+
class="dtc-conversations"
199+
/>
200+
</div>
201+
</DocumentFragment>
202+
`;

0 commit comments

Comments
 (0)