@tbox.cn/app-module-mall-core 1.0.0-alpha.6 → 1.0.0-alpha.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +6 -6
- package/tests/home-slot.test.tsx +7 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tbox.cn/app-module-mall-core",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.8",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "商圈基础模块:scope 域装配注册 + mall-info 工具链 + mall-directory 服务 + 首页主屏(home 槽 / 联单面板 / 会员停车快览)+ 首页预览卡。",
|
|
6
6
|
"exports": {
|
|
@@ -19,10 +19,10 @@
|
|
|
19
19
|
"./package.json": "./package.json"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@tbox.cn/app-
|
|
23
|
-
"@tbox.cn/app-contracts-mall": "1.0.0-alpha.
|
|
24
|
-
"@tbox.cn/app-
|
|
25
|
-
"@tbox.cn/app-agent-sdk-server": "1.0.0-alpha.
|
|
22
|
+
"@tbox.cn/app-contracts": "1.0.0-alpha.8",
|
|
23
|
+
"@tbox.cn/app-contracts-mall": "1.0.0-alpha.8",
|
|
24
|
+
"@tbox.cn/app-agent-sdk-client": "1.0.0-alpha.8",
|
|
25
|
+
"@tbox.cn/app-agent-sdk-server": "1.0.0-alpha.8"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"react": "18.3.1",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"@phosphor-icons/react": "2.1.10",
|
|
31
31
|
"express": "4.22.2",
|
|
32
32
|
"zod": "3.25.76",
|
|
33
|
-
"@tbox.cn/app-agent-ui-kit": "1.0.0-alpha.
|
|
33
|
+
"@tbox.cn/app-agent-ui-kit": "1.0.0-alpha.8"
|
|
34
34
|
},
|
|
35
35
|
"peerDependenciesMeta": {
|
|
36
36
|
"@tbox.cn/app-agent-ui-kit": {
|
package/tests/home-slot.test.tsx
CHANGED
|
@@ -477,7 +477,7 @@ describe('IndexPage 首屏历史布局', () => {
|
|
|
477
477
|
expect(mocks.mallHomeProps?.showDevServices).toBe(true);
|
|
478
478
|
});
|
|
479
479
|
|
|
480
|
-
it('远离底部时主动发送 query
|
|
480
|
+
it('远离底部时主动发送 query,不抢回底部(回合锚定)', () => {
|
|
481
481
|
mocks.state.messages = [message('current-1')];
|
|
482
482
|
flushSync(() => root.render(<IndexPage />));
|
|
483
483
|
|
|
@@ -495,7 +495,8 @@ describe('IndexPage 首屏历史布局', () => {
|
|
|
495
495
|
|
|
496
496
|
mocks.state.messages = [message('current-1'), message('current-2')];
|
|
497
497
|
flushSync(() => root.render(<IndexPage />));
|
|
498
|
-
|
|
498
|
+
// 回合锚定:发送后不追底;anchor 元素在 mock 里无 rect,位置保持不变。
|
|
499
|
+
expect(scrollTop).toBe(200);
|
|
499
500
|
});
|
|
500
501
|
|
|
501
502
|
it('新对话立即回到首页顶部,并关闭自动落底意图', () => {
|
|
@@ -535,7 +536,7 @@ describe('IndexPage 首屏历史布局', () => {
|
|
|
535
536
|
expect(container.querySelector('.mock-quick-commands')).not.toBeNull();
|
|
536
537
|
});
|
|
537
538
|
|
|
538
|
-
it('
|
|
539
|
+
it('主动发送后流式更新不抢回底部(回合锚定)', () => {
|
|
539
540
|
mocks.state.messages = [message('current-1')];
|
|
540
541
|
flushSync(() => root.render(<IndexPage />));
|
|
541
542
|
|
|
@@ -552,7 +553,7 @@ describe('IndexPage 首屏历史布局', () => {
|
|
|
552
553
|
flushSync(() => mocks.mallHomeProps?.onSend?.('最近有什么活动?'));
|
|
553
554
|
mocks.state.messages = [message('current-1'), message('current-2')];
|
|
554
555
|
flushSync(() => root.render(<IndexPage />));
|
|
555
|
-
expect(scrollTop).toBe(
|
|
556
|
+
expect(scrollTop).toBe(250);
|
|
556
557
|
|
|
557
558
|
scrollHeight = 1900;
|
|
558
559
|
mocks.state.messages = [
|
|
@@ -561,7 +562,7 @@ describe('IndexPage 首屏历史布局', () => {
|
|
|
561
562
|
{ ...message('assistant-1'), role: 'assistant', content: '正在查询', status: 'streaming' },
|
|
562
563
|
];
|
|
563
564
|
flushSync(() => root.render(<IndexPage />));
|
|
564
|
-
expect(scrollTop).toBe(
|
|
565
|
+
expect(scrollTop).toBe(250);
|
|
565
566
|
|
|
566
567
|
scrollHeight = 2000;
|
|
567
568
|
mocks.state.messages = [
|
|
@@ -570,7 +571,7 @@ describe('IndexPage 首屏历史布局', () => {
|
|
|
570
571
|
{ ...message('assistant-1'), role: 'assistant', content: '正在查询活动', status: 'streaming' },
|
|
571
572
|
];
|
|
572
573
|
flushSync(() => root.render(<IndexPage />));
|
|
573
|
-
expect(scrollTop).toBe(
|
|
574
|
+
expect(scrollTop).toBe(250);
|
|
574
575
|
|
|
575
576
|
scrollTop = 800;
|
|
576
577
|
flushSync(() => body.dispatchEvent(new Event('scroll', { bubbles: true })));
|