Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。
TypeScript agentai-agentai-assistantandroidclaude-codecodexelectroniosllmmacosreact-nativetypescriptwindows
fix(maker-shared): don't flag new messages when the list becomes empty
Zhao Dengfeng3ce3a6494b3c
diff --git a/packages/maker-shared/src/__tests__/messageWindow.test.ts b/packages/maker-shared/src/__tests__/messageWindow.test.tsindex 2c3c51e3db..cbc0f31fb3 100644--- a/packages/maker-shared/src/__tests__/messageWindow.test.ts+++ b/packages/maker-shared/src/__tests__/messageWindow.test.ts@@ -141,6 +141,20 @@ describe('messageWindow', () => {});});+ it('does not flag new messages when a replacement empties the list away from bottom', () => {+ // 不在底部时替换成另一批消息仍提示;替换成空列表没有可跳转的新消息。+ expect(evaluateMessageWindowUpdate({+ previousKeys: ['old-1'],+ nextKeys: ['new-1'],+ wasNearBottom: false,+ }).showNewMessageIndicator).toBe(true);+ expect(evaluateMessageWindowUpdate({+ previousKeys: ['m1'],+ nextKeys: [],+ wasNearBottom: false,+ })).toMatchObject({ kind: 'replaced', shouldAutoFollow: false, showNewMessageIndicator: false });+ });+it('builds the load-earlier action state from window availability', () => {expect(buildMessageLoadEarlierAction({hasOlderMessages: true,diff --git a/packages/maker-shared/src/messageWindow.ts b/packages/maker-shared/src/messageWindow.tsindex 40b0a4f98d..ea7518c9cd 100644--- a/packages/maker-shared/src/messageWindow.ts+++ b/packages/maker-shared/src/messageWindow.ts@@ -159,7 +159,12 @@ export function evaluateMessageWindowUpdate(args: {autoFollowTarget: shouldAutoFollow ? 'content-end' : 'none',preserveVisibleAnchor: false,shouldAutoFollow,- showNewMessageIndicator: tailChanged && !args.wasNearBottom,+ // 列表被替换成空时没有可跳转的新消息,不能亮红点。+ showNewMessageIndicator: shouldShowNewMessageIndicator({+ previousLastKey,+ nextLastKey,+ wasNearBottom: args.wasNearBottom,+ }),};}