feat: add bounded session and history navigation

Add session scrolling, latest-message navigation and fingerprint location under the shared UI gate; reuse navigation in history reads and provide read-only smoke. Navigation index snapshot passed 124 tests and a full build. Windows 4.1.13.63 read-only validation passed 10/10, including two-scroll history location; no sends. Record scope limits, including next-unread navigation not yet implemented.
This commit is contained in:
2026-09-06 20:09:00 +08:00
parent c49f6a10b2
commit e5548bd471
13 changed files with 563 additions and 24 deletions
@@ -0,0 +1,23 @@
using WxAgent.Core;
using Xunit;
namespace WxAgent.Core.Tests;
public sealed class WechatNavigationTests
{
[Theory]
[InlineData(0)]
[InlineData(101)]
public void RejectsUnboundedScrollRequests(int pages) =>
Assert.Throws<WxAgentException>(() => WechatNavigationRules.ValidateScrollLimit(pages));
[Fact]
public void MatchesExactVisibleFingerprintAndRejectsAmbiguity()
{
var message = new ChatMessageSnapshot("test", new string('a', 64), 0, ChatMessageType.Text);
Assert.Same(message, WechatNavigationRules.FindMessage([message], new string('A', 64)));
Assert.Null(WechatNavigationRules.FindMessage([message], new string('b', 64)));
Assert.Throws<WxAgentException>(() => WechatNavigationRules.FindMessage([message, message], message.Fingerprint));
Assert.Throws<WxAgentException>(() => WechatNavigationRules.FindMessage([message], "not-a-fingerprint"));
}
}