From 615bfaf33f106fb27acab4103dab766d092f0e17 Mon Sep 17 00:00:00 2001 From: Christoph Thiede Date: Thu, 21 Nov 2024 04:13:34 +0100 Subject: [PATCH] announcements: fix search --- .../instance/previewMatch.st | 7 +++++++ .../instance/searchableProperties.st | 8 ++++++++ .../instance/visitBySearcher.context..st | 8 ++++++++ .../methodProperties.json | 5 ++++- 4 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 packages/SqueakInboxTalk.package/TalkInboxBrowserAnnouncement.class/instance/previewMatch.st create mode 100644 packages/SqueakInboxTalk.package/TalkInboxBrowserAnnouncement.class/instance/searchableProperties.st create mode 100644 packages/SqueakInboxTalk.package/TalkInboxBrowserAnnouncement.class/instance/visitBySearcher.context..st diff --git a/packages/SqueakInboxTalk.package/TalkInboxBrowserAnnouncement.class/instance/previewMatch.st b/packages/SqueakInboxTalk.package/TalkInboxBrowserAnnouncement.class/instance/previewMatch.st new file mode 100644 index 0000000..f7917c3 --- /dev/null +++ b/packages/SqueakInboxTalk.package/TalkInboxBrowserAnnouncement.class/instance/previewMatch.st @@ -0,0 +1,7 @@ +searching - conversation +previewMatch + + ^ TalkTextSearcher + pseudoMatchFor: self text + from: self + label: nil \ No newline at end of file diff --git a/packages/SqueakInboxTalk.package/TalkInboxBrowserAnnouncement.class/instance/searchableProperties.st b/packages/SqueakInboxTalk.package/TalkInboxBrowserAnnouncement.class/instance/searchableProperties.st new file mode 100644 index 0000000..b308f30 --- /dev/null +++ b/packages/SqueakInboxTalk.package/TalkInboxBrowserAnnouncement.class/instance/searchableProperties.st @@ -0,0 +1,8 @@ +accessing - conversation +searchableProperties + + ^ OrderedDictionary new + at: 'From' put: #author; + at: 'Date' put: #date; + at: 'Subject' put: #subject; + yourself \ No newline at end of file diff --git a/packages/SqueakInboxTalk.package/TalkInboxBrowserAnnouncement.class/instance/visitBySearcher.context..st b/packages/SqueakInboxTalk.package/TalkInboxBrowserAnnouncement.class/instance/visitBySearcher.context..st new file mode 100644 index 0000000..17b5a44 --- /dev/null +++ b/packages/SqueakInboxTalk.package/TalkInboxBrowserAnnouncement.class/instance/visitBySearcher.context..st @@ -0,0 +1,8 @@ +accessing - conversation +visitBySearcher: aTextSearcher context: searchContext + + self searchableProperties keysAndValuesDo: [:label :block | | propertyValue | + propertyValue := (block value: self) asString. + aTextSearcher visit: self label: label contents: propertyValue context: searchContext]. + + aTextSearcher visit: self contents: (self perform: aTextSearcher messageTextSelector) context: searchContext. \ No newline at end of file diff --git a/packages/SqueakInboxTalk.package/TalkInboxBrowserAnnouncement.class/methodProperties.json b/packages/SqueakInboxTalk.package/TalkInboxBrowserAnnouncement.class/methodProperties.json index 9b0d2e6..0417ba5 100644 --- a/packages/SqueakInboxTalk.package/TalkInboxBrowserAnnouncement.class/methodProperties.json +++ b/packages/SqueakInboxTalk.package/TalkInboxBrowserAnnouncement.class/methodProperties.json @@ -27,11 +27,14 @@ "openInNabble" : "ct 11/18/2024 21:23", "openInPipermail" : "ct 11/18/2024 21:23", "plainText" : "ct 11/18/2024 20:37", + "previewMatch" : "ct 11/19/2024 03:31", "printOn:" : "ct 11/18/2024 20:49", "rawText" : "ct 11/18/2024 03:46", "richText" : "ct 11/18/2024 03:43", + "searchableProperties" : "ct 11/19/2024 03:30", "selector" : "ct 11/18/2024 20:35", "selector:" : "ct 11/18/2024 20:35", "subject" : "ct 11/18/2024 03:12", "subject:" : "ct 11/18/2024 03:12", - "text" : "ct 11/18/2024 20:50" } } + "text" : "ct 11/18/2024 20:50", + "visitBySearcher:context:" : "ct 11/19/2024 03:30" } }