Search: persist recent searches and give the store the local UTC offset #315

Open
opened 2026-11-12 17:23:42 +00:00 by charles · 0 comments
Owner

Found while building Text chat 17 (#267). fluxer-core::chat::search keeps its state in app.chat.search, but two inputs it needs live outside the files Text chat 17 owns:

  1. Recent searches are not persisted. Search::recent (10, newest first) is filled on submit, but nothing loads it from LocalSettings::chat.recent_searches on PersistResult::Loaded or writes it back with PersistOp::SaveSettings (that is persist.rs / app.rs), and Chat::clear_account (chat/state.rs) resets it on logout although it is local to the machine. The original keeps them per search context in local storage (SearchHistory.ts).
  2. The local UTC offset. parse(&str, UtcOffset) reads dates in the offset it is given; the reducer uses Search::utc_offset, which is UTC until the runtime sets it (the store cannot read the system time zone). Dates relative to now (today, last:2d, may) are resolved against the newest message id the store knows (the #109 stand-in).

Suggested home: Text chat 21 (runtime wiring), or with #109 if a clock input lands.

Found while building Text chat 17 (#267). `fluxer-core::chat::search` keeps its state in `app.chat.search`, but two inputs it needs live outside the files Text chat 17 owns: 1. **Recent searches are not persisted.** `Search::recent` (10, newest first) is filled on submit, but nothing loads it from `LocalSettings::chat.recent_searches` on `PersistResult::Loaded` or writes it back with `PersistOp::SaveSettings` (that is `persist.rs` / `app.rs`), and `Chat::clear_account` (`chat/state.rs`) resets it on logout although it is local to the machine. The original keeps them per search context in local storage (`SearchHistory.ts`). 2. **The local UTC offset.** `parse(&str, UtcOffset)` reads dates in the offset it is given; the reducer uses `Search::utc_offset`, which is UTC until the runtime sets it (the store cannot read the system time zone). Dates relative to now (`today`, `last:2d`, `may`) are resolved against the newest message id the store knows (the #109 stand-in). Suggested home: Text chat 21 (runtime wiring), or with #109 if a clock input lands.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
charles/fluxer-native#315
No description provided.