a temp key–value pair LastVisit: 2025-10-27 22:15:42 is inserted (not in the frontmatter) upon loading the Page’s top widget (as a workaround).
-- priority: -1
local lastVisitStore = lastVisitStore or {}
index.defineTag {
name = "page",
metatable = {
__index = function(self, attr)
if attr == "lastVisit" then
return lastVisitStore[self.name]
end
end
}
}
event.listen{
name = "hooks:renderTopWidgets",
run = function(e)
local pageRef = editor.getCurrentPage()
local now = os.date("%Y-%m-%d %H:%M:%S")
if lastVisitStore[pageRef] == now then
return
end
lastVisitStore[pageRef] = now
-- editor.flashNotification("lastVisit: pageRef " .. now)
end
}
then one can
${query[[from index.tag "page"
where _.lastVisit and _.name != editor.getCurrentPage()
select {ref=_.ref, lastVisit=_.lastVisit}
order by _.lastVisit desc
limit 5]]}
to get
Note that the history is NOT persisted (compared to the key lastModified and created): the information is maintained only in memory, and will be lost after restarting SilverBullet.
This constitutes both a merit (one-off, non-modify compared to lastModified, non-fields-pollution) and a drawback (non persistent like its simbling attr lastModified).

