feat: document title unread count, draft persistence, search date range
CI / Build & Quality Checks (push) Successful in 10m30s

E1 - Document title unread count: FaviconUpdater now also sets
     document.title to '(N) Lotus Chat' for mentions, '· Lotus Chat'
     for plain unreads, and 'Lotus Chat' when clear. Reuses the
     existing roomToUnread forEach loop.

E2 - Draft persistence across reloads: on room unmount, unsent message
     is written to localStorage as 'draft-msg-<roomId>'. On mount, if
     the Jotai atom is empty (page reload), the localStorage draft is
     restored. Cleared on send. Uses the existing Slate node JSON format.

E5 - Search date range filter: new DateRangeButton in SearchFilters
     with From/To date inputs in a PopOut. Dates stored as epoch ms in
     ?fromTs=&toTs= URL params. Passed to Matrix /search as from_ts /
     to_ts filter fields (valid spec fields, cast via 'as any' since
     SDK types don't include them yet).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-30 22:22:40 -04:00
parent 7b14eb539f
commit dfedba9ef8
6 changed files with 188 additions and 13 deletions
@@ -68,10 +68,12 @@ export type MessageSearchParams = {
order?: string;
rooms?: string[];
senders?: string[];
fromTs?: number;
toTs?: number;
};
export const useMessageSearch = (params: MessageSearchParams) => {
const mx = useMatrixClient();
const { term, order, rooms, senders } = params;
const { term, order, rooms, senders, fromTs, toTs } = params;
const searchMessages = useCallback(
async (nextBatch?: string) => {
@@ -90,11 +92,15 @@ export const useMessageSearch = (params: MessageSearchParams) => {
after_limit: 0,
include_profile: false,
},
// eslint-disable-next-line @typescript-eslint/no-explicit-any
filter: {
limit,
rooms,
senders,
},
// from_ts / to_ts are valid Matrix spec fields not yet in SDK types
...(fromTs !== undefined && { from_ts: fromTs }),
...(toTs !== undefined && { to_ts: toTs }),
} as any,
include_state: false,
order_by: order as SearchOrderBy.Recent,
search_term: term,