chore: upgrade i18next 26, prettier 3, fontsource-variable, domhandler 6, lint-staged 17

- i18next 23->26 + react-i18next 15->17
- prettier 2->3, reformat all files
- replace @fontsource/inter with @fontsource-variable/inter 5, update import path
- domhandler 5->6 (aligns with transitive deps)
- lint-staged 16->17
This commit is contained in:
Lotus Bot
2026-05-21 23:30:50 -04:00
parent b3666fa876
commit 61a1f008d0
363 changed files with 1443 additions and 1419 deletions
+21 -21
View File
@@ -111,7 +111,7 @@ type SilentReloadTimeline = () => Promise<void>;
const groupNotifications = (
notifications: INotification[],
allowRooms: Set<string>
allowRooms: Set<string>,
): RoomNotificationsGroup[] => {
const groups: RoomNotificationsGroup[] = [];
notifications.forEach((notification) => {
@@ -133,7 +133,7 @@ const groupNotifications = (
const useNotificationTimeline = (
paginationLimit: number,
onlyHighlight?: boolean
onlyHighlight?: boolean,
): [NotificationTimeline, LoadTimeline, SilentReloadTimeline] => {
const mx = useMatrixClient();
const allRooms = useAtomValue(allRoomsAtom);
@@ -149,10 +149,10 @@ const useNotificationTimeline = (
return mx.http.authedRequest<INotificationsResponse>(
Method.Get,
'/notifications',
queryParams
queryParams,
);
},
[mx]
[mx],
);
const loadTimeline: LoadTimeline = useCallback(
@@ -163,7 +163,7 @@ const useNotificationTimeline = (
const data = await fetchNotifications(
from,
paginationLimit,
onlyHighlight ? 'highlight' : undefined
onlyHighlight ? 'highlight' : undefined,
);
const groups = groupNotifications(data.notifications, allJoinedRooms);
@@ -177,7 +177,7 @@ const useNotificationTimeline = (
return currentTimeline;
});
},
[paginationLimit, onlyHighlight, fetchNotifications, allJoinedRooms]
[paginationLimit, onlyHighlight, fetchNotifications, allJoinedRooms],
);
/**
@@ -188,7 +188,7 @@ const useNotificationTimeline = (
const data = await fetchNotifications(
undefined,
paginationLimit,
onlyHighlight ? 'highlight' : undefined
onlyHighlight ? 'highlight' : undefined,
);
const groups = groupNotifications(data.notifications, allJoinedRooms);
setNotificationTimeline({
@@ -243,10 +243,10 @@ function RoomNotificationsGroupComp({
() => ({
...LINKIFY_OPTS,
render: factoryRenderLinkifyWithMention((href) =>
renderMatrixMention(mx, room.roomId, href, makeMentionCustomProps(mentionClickHandler))
renderMatrixMention(mx, room.roomId, href, makeMentionCustomProps(mentionClickHandler)),
),
}),
[mx, room, mentionClickHandler]
[mx, room, mentionClickHandler],
);
const htmlReactParserOptions = useMemo<HTMLReactParserOptions>(
() =>
@@ -256,7 +256,7 @@ function RoomNotificationsGroupComp({
handleSpoilerClick: spoilerClickHandler,
handleMentionClick: mentionClickHandler,
}),
[mx, room, linkifyOpts, mentionClickHandler, spoilerClickHandler, useAuthentication]
[mx, room, linkifyOpts, mentionClickHandler, spoilerClickHandler, useAuthentication],
);
const renderMatrixEvent = useMatrixEventRenderer<[IRoomEvent, string, GetContentCallback]>(
@@ -318,7 +318,7 @@ function RoomNotificationsGroupComp({
const editedEvent = getEditedEvent(
evt.event_id,
mEvent,
evtTimeline.getTimelineSet()
evtTimeline.getTimelineSet(),
);
const getContent = (() =>
editedEvent?.getContent()['m.new_content'] ??
@@ -395,7 +395,7 @@ function RoomNotificationsGroupComp({
</Text>
</Box>
);
}
},
);
const handleOpenClick: MouseEventHandler = (evt) => {
@@ -484,14 +484,14 @@ function RoomNotificationsGroupComp({
userId={event.sender}
src={
senderAvatarMxc
? mxcUrlToHttp(
? (mxcUrlToHttp(
mx,
senderAvatarMxc,
useAuthentication,
48,
48,
'crop'
) ?? undefined
'crop',
) ?? undefined)
: undefined
}
alt={displayName}
@@ -550,13 +550,13 @@ function RoomNotificationsGroupComp({
}
const useNotificationsSearchParams = (
searchParams: URLSearchParams
searchParams: URLSearchParams,
): InboxNotificationsPathSearchParams =>
useMemo(
() => ({
only: searchParams.get('only') ?? undefined,
}),
[searchParams]
[searchParams],
);
const DEFAULT_REFRESH_MS = 7000;
@@ -585,7 +585,7 @@ export function Notifications() {
setSearchParams(
new URLSearchParams({
only: 'highlight',
})
}),
);
return;
}
@@ -594,7 +594,7 @@ export function Notifications() {
const [notificationTimeline, _loadTimeline, silentReloadTimeline] = useNotificationTimeline(
24,
onlyHighlight
onlyHighlight,
);
const [timelineState, loadTimeline] = useAsyncCallback(_loadTimeline);
@@ -610,12 +610,12 @@ export function Notifications() {
useCallback(() => {
silentReloadTimeline();
}, [silentReloadTimeline]),
refreshIntervalTime
refreshIntervalTime,
);
const handleScrollTopVisibility = useCallback(
(onTop: boolean) => setRefreshIntervalTime(onTop ? DEFAULT_REFRESH_MS : -1),
[]
[],
);
useEffect(() => {