Skip to content

Surface a new memory through a native desktop notification #1439

Description

@rohan-pandeyy

The gap

Smart Memories curates photo collections, but nothing tells you when a new one is ready.

The backend only curates when something asks it to, so on a day with no import nothing is generated and nothing surfaces. You have to remember to open the Memories page and press Refresh, which rather defeats the point of a feature whose whole job is to find things for you.

tauri-plugin-notification is not installed today. It is missing from frontend/src-tauri/Cargo.toml and frontend/package.json, and it is not registered in main.rs.

Proposal

Integrate Tauri's native notification plugin and hang it off memory creation.

The plugin talks to each operating system's own alert infrastructure, so Windows Action Center, macOS Notification Center and Linux D-Bus all work with no third party notification service involved.

After the daily memory is generated, a background task fires a notification: "Your Daily Memory is Ready". Acting on it should take you straight to the memory in the story viewer, with no manual navigation.

What that involves

1. Install the plugin

  • tauri-plugin-notification in frontend/src-tauri/Cargo.toml
  • @tauri-apps/plugin-notification in frontend/package.json

2. Register it in main.rs

3. Fire the notification after curation

A Rust background task waits for the backend to come up, asks for a run through POST /memories/generate, follows that run to completion, then reads GET /memories/today and notifies on what it finds.

4. Grant the OS permissions

Under Tauri v2's permission model this means a capability entry rather than anything bespoke.

5. Route the user to the memory

Rust emits a Tauri event that a listener in the React app root picks up, opening the Memory Viewer directly.

Things worth getting right

  • Desktop notification click callbacks are not dependable in v2. The click should not be the only way through. Emitting the event unconditionally and rendering an in-app card next to the OS notification keeps the path reliable on every platform.
  • Never curate mid-index. A run that starts while indexing is in progress scores a library whose labels are only half written.
  • Do not announce the same memory twice. notified_at already exists on a memory and is a timestamp rather than a boolean, precisely so "notified but not opened" stays distinguishable.
  • Anniversaries depend on a run happening that day. They are written with surface_date = today and are not generated retroactively, so a launch-time trigger is what makes them possible at all.

References

Metadata

Metadata

Assignees

Projects

Status
In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions