Skip to content

Solution for long term memory for agent coding CLIs and to facilitate handoff between different agent vendors

Rust

fix(web): mark an expired page on the page view

Vinícius DS Andrade8b9d545ee829
diff --git a/crates/ai-memory-web/src/routes/page.rs b/crates/ai-memory-web/src/routes/page.rs
index 7a0bcf68..ec3f97d7 100644
--- a/crates/ai-memory-web/src/routes/page.rs
+++ b/crates/ai-memory-web/src/routes/page.rs
@@ -142,6 +142,7 @@ pub(crate) async fn handler(
kind: meta.kind,
tier: meta.tier,
pinned: meta.pinned,
+ expired: meta.expired,
updated_relative: humanize(&meta.updated_at),
created_relative: humanize(&meta.created_at),
supersedes_path,
diff --git a/crates/ai-memory-web/src/templates.rs b/crates/ai-memory-web/src/templates.rs
index e205764b..9fa37be0 100644
--- a/crates/ai-memory-web/src/templates.rs
+++ b/crates/ai-memory-web/src/templates.rs
@@ -360,6 +360,10 @@ pub(crate) struct PageView {
pub tier: String,
/// Whether the page is pinned.
pub pinned: bool,
+ /// Whether the page's `expires_at` TTL has passed. Search and the
+ /// listings already leave such a page out; its own URL still opens it,
+ /// so the view says so.
+ pub expired: bool,
/// Humanised updated timestamp.
pub updated_relative: String,
/// Humanised created timestamp.
diff --git a/crates/ai-memory-web/templates/page.html b/crates/ai-memory-web/templates/page.html
index 0c5bd69d..c81f49c4 100644
--- a/crates/ai-memory-web/templates/page.html
+++ b/crates/ai-memory-web/templates/page.html
@@ -30,6 +30,11 @@
pinned
</span>
{% endif %}
+ {% if expired %}
+ <span class="inline-flex items-center rounded px-2 py-0.5 font-medium bg-amber-50 dark:bg-amber-950 text-amber-700 dark:text-amber-300 border border-amber-200 dark:border-amber-800">
+ expired
+ </span>
+ {% endif %}
<span class="ml-1">Updated {{ updated_relative }}</span>
<span>·</span>
<a href="{{ history_href }}" class="text-blue-600 dark:text-blue-400 underline">History</a>