From 3cc5f0cc6ae4f29e2e24112d9d67c32c95a0713f Mon Sep 17 00:00:00 2001 From: Jared Vititoe Date: Mon, 31 Aug 2026 21:29:29 -0400 Subject: [PATCH] fix(room-nav): drop pointless dynamic import of setRoomNotificationPreference MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit RoomNavItem.tsx already statically imported getRoomNotificationModeIcon and RoomNotificationMode from the same module, so the two `await import('../../hooks/useRoomsNotificationPreferences')` calls (in unmuteRoom and handleMuteFor) never achieved real code-splitting — verified by building and grepping dist/assets: setRoomNotificationPreference landed in the same eager entry chunk regardless, since Rolldown can't split a module already reachable via a static import elsewhere. Just import it statically alongside its siblings instead. No behavior change — confirmed via 3 independent investigations before starting and 3 independent reviews of this diff before committing. Closes LotusGuild/cinny#5 Co-Authored-By: Claude Sonnet 5 --- src/app/features/room-nav/RoomNavItem.tsx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/app/features/room-nav/RoomNavItem.tsx b/src/app/features/room-nav/RoomNavItem.tsx index df491d32e..dd299ee1b 100644 --- a/src/app/features/room-nav/RoomNavItem.tsx +++ b/src/app/features/room-nav/RoomNavItem.tsx @@ -66,6 +66,7 @@ import { useSpaceOptionally } from '../../hooks/useSpace'; import { getRoomNotificationModeIcon, RoomNotificationMode, + setRoomNotificationPreference, } from '../../hooks/useRoomsNotificationPreferences'; import { RoomNotificationModeSwitcher } from '../../components/RoomNotificationSwitcher'; import { getRoomCreatorsForRoomId, useRoomCreators } from '../../hooks/useRoomCreators'; @@ -298,8 +299,6 @@ export function saveMuteTimers(timers: MuteTimerEntry[]): void { // Reverse a timed mute: restore the room's notification mode to Unset and drop // its persisted timer. Shared by the in-session timer and the boot-time restore. export async function unmuteRoom(mx: MatrixClient, roomId: string): Promise { - const { setRoomNotificationPreference } = - await import('../../hooks/useRoomsNotificationPreferences'); await setRoomNotificationPreference( mx, roomId, @@ -392,8 +391,6 @@ const RoomNavItemMenu = forwardRef( const handleMuteFor = useCallback( async (durationMs: number | null) => { - const { setRoomNotificationPreference } = - await import('../../hooks/useRoomsNotificationPreferences'); const prevMode = notificationMode ?? RoomNotificationMode.Unset; await setRoomNotificationPreference( mx,