feat: document title unread count, draft persistence, search date range
CI / Build & Quality Checks (push) Successful in 10m30s
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:
@@ -56,22 +56,26 @@ function FaviconUpdater() {
|
||||
const roomToUnread = useAtomValue(roomToUnreadAtom);
|
||||
|
||||
useEffect(() => {
|
||||
let notification = false;
|
||||
let highlight = false;
|
||||
let totalNotif = 0;
|
||||
let totalHighlight = 0;
|
||||
roomToUnread.forEach((unread) => {
|
||||
if (unread.total > 0) {
|
||||
notification = true;
|
||||
}
|
||||
if (unread.highlight > 0) {
|
||||
highlight = true;
|
||||
}
|
||||
totalNotif += unread.total;
|
||||
totalHighlight += unread.highlight;
|
||||
});
|
||||
|
||||
if (notification) {
|
||||
setFavicon(highlight ? LogoHighlightSVG : LogoUnreadSVG);
|
||||
if (totalNotif > 0) {
|
||||
setFavicon(totalHighlight > 0 ? LogoHighlightSVG : LogoUnreadSVG);
|
||||
} else {
|
||||
setFavicon(LogoSVG);
|
||||
}
|
||||
|
||||
if (totalHighlight > 0) {
|
||||
document.title = `(${totalHighlight}) Lotus Chat`;
|
||||
} else if (totalNotif > 0) {
|
||||
document.title = `· Lotus Chat`;
|
||||
} else {
|
||||
document.title = 'Lotus Chat';
|
||||
}
|
||||
}, [roomToUnread]);
|
||||
|
||||
return null;
|
||||
|
||||
@@ -33,6 +33,8 @@ export type _SearchPathSearchParams = {
|
||||
order?: string;
|
||||
rooms?: string;
|
||||
senders?: string;
|
||||
fromTs?: string;
|
||||
toTs?: string;
|
||||
};
|
||||
export const _SEARCH_PATH = 'search/';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user