Release v0.6.41: filter and remember pinned clipboard history

This commit is contained in:
2026-11-04 19:58:15 +02:00
parent 524a836cc0
commit 684ca1b3cc
14 changed files with 60 additions and 28 deletions
+16 -1
View File
@@ -112,9 +112,24 @@ int main() {
auto w=open();send(w,WM_COMMAND,112);
until([&]{history.reload();return history.entries().front().pinned;},"resident pin mutation");
require(history.entries().front().id==textId,"pin preserves history identity");
auto filter=[&](HWND window,int index) {
send(GetDlgItem(window,117),CB_SETCURSEL,index);
send(window,WM_COMMAND,MAKEWPARAM(117,CBN_SELCHANGE),LPARAM(GetDlgItem(window,117)));
};
filter(w,1);
until([&]{return send(GetDlgItem(w,102),LB_GETCOUNT)==1;},"pinned filter hides unpinned entries");
send(GetDlgItem(w,101),WM_SETTEXT,0,LPARAM(L"History fixture 497"));
until([&]{return send(GetDlgItem(w,102),LB_GETCOUNT)==0;},"search cannot match an unpinned item in pinned view");
send(GetDlgItem(w,101),WM_SETTEXT,0,LPARAM(L"History fixture 498"));
until([&]{return send(GetDlgItem(w,102),LB_GETCOUNT)==1;},"history search");
send(w,WM_COMMAND,112);
until([&]{return send(GetDlgItem(w,102),LB_GETCOUNT)==0;},"unpin removes the last pinned result");
filter(w,0);
until([&]{return send(GetDlgItem(w,102),LB_GETCOUNT)==1;},"all items restores the matching unpinned entry");
send(w,WM_COMMAND,112);
filter(w,1);
close(w);w=open();
require(send(GetDlgItem(w,117),CB_GETCURSEL)==1,"pinned filter survives helper restart");
wchar_t query[100]{};send(GetDlgItem(w,101),WM_GETTEXT,100,LPARAM(query));
require(std::wstring(query)==L"History fixture 498","search survives helper restart");
send(w,WM_COMMAND,114);
@@ -124,7 +139,7 @@ int main() {
require(WaitForSingleObject(child,0)==WAIT_TIMEOUT && IsWindow(entry),"full item remains usable after closing history");
send(entry,WM_CLOSE);
until([&]{return WaitForSingleObject(child,0)==WAIT_OBJECT_0;},"helper exits after last full item closes");CloseHandle(child);
w=open();send(GetDlgItem(w,101),WM_SETTEXT,0,LPARAM(L""));
w=open();filter(w,0);send(GetDlgItem(w,101),WM_SETTEXT,0,LPARAM(L""));
until([&]{return send(GetDlgItem(w,102),LB_GETCOUNT)==500;},"clear search");close(w);
ks::writeClipboard(target,excluded(image));
w=open();send(w,WM_COMMAND,111);