diff --git a/package-lock.json b/package-lock.json index e1e54bc5..70519810 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "obsidianirc-client", - "version": "0.2.4", + "version": "0.2.5", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "obsidianirc-client", - "version": "0.2.4", + "version": "0.2.5", "dependencies": { "@heroicons/react": "^2.2.0", "@tauri-apps/api": "^2.0.0", diff --git a/package.json b/package.json index e0e4999a..70b175bb 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "obsidianirc-client", "private": true, - "version": "0.2.4", + "version": "0.2.5", "type": "module", "homepage": "https://github.com/ObsidianIRC/ObsidianIRC", "scripts": { @@ -21,7 +21,10 @@ "test:coverage": "vitest run --coverage", "test:debug": "vitest --inspect-brk --browser --no-file-parallelism", "android:dev": "tauri android dev --config src-tauri/tauri.android.conf.json --no-dev-server-wait", + "android:build": "tauri android build --apk --debug", + "android:release": "tauri android build --apk", "ios:dev": "bash scripts/ios-dev.sh", + "ios:build": "tauri ios build --debug --export-method debugging", "gen-certs": "bash scripts/setup-dev-certs.sh", "run-dev-stack": "docker compose --profile testing up --remove-orphans", "stop-dev-stack": "docker compose --profile testing down --remove-orphans", diff --git a/src-tauri/gen/apple/ObsidianIRC.xcodeproj/project.pbxproj b/src-tauri/gen/apple/ObsidianIRC.xcodeproj/project.pbxproj index 4a69a51b..e435f070 100644 --- a/src-tauri/gen/apple/ObsidianIRC.xcodeproj/project.pbxproj +++ b/src-tauri/gen/apple/ObsidianIRC.xcodeproj/project.pbxproj @@ -339,7 +339,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = YES; @@ -438,7 +438,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; PRODUCT_NAME = "$(TARGET_NAME)"; diff --git a/src-tauri/gen/apple/ObsidianIRC_iOS/Info.plist b/src-tauri/gen/apple/ObsidianIRC_iOS/Info.plist index 061d782e..4fff09d4 100644 --- a/src-tauri/gen/apple/ObsidianIRC_iOS/Info.plist +++ b/src-tauri/gen/apple/ObsidianIRC_iOS/Info.plist @@ -15,9 +15,9 @@ CFBundlePackageType APPL CFBundleShortVersionString - 0.0.1 + 0.2.5 CFBundleVersion - 0.0.1 + 0.2.5 LSRequiresIPhoneOS UILaunchStoryboardName @@ -43,13 +43,16 @@ CFBundleURLTypes + CFBundleURLSchemes + CFBundleURLName - IRC Protocol + https + + CFBundleURLSchemes - - irc - ircs - + + CFBundleURLName + https diff --git a/src-tauri/gen/apple/ObsidianIRC_iOS/ObsidianIRC_iOS.entitlements b/src-tauri/gen/apple/ObsidianIRC_iOS/ObsidianIRC_iOS.entitlements index 6631ffa6..21e2f8d8 100644 --- a/src-tauri/gen/apple/ObsidianIRC_iOS/ObsidianIRC_iOS.entitlements +++ b/src-tauri/gen/apple/ObsidianIRC_iOS/ObsidianIRC_iOS.entitlements @@ -1,6 +1,5 @@ - - - + + \ No newline at end of file diff --git a/src/components/layout/AppLayout.tsx b/src/components/layout/AppLayout.tsx index 628d7b68..cf8cca81 100644 --- a/src/components/layout/AppLayout.tsx +++ b/src/components/layout/AppLayout.tsx @@ -118,8 +118,30 @@ export const AppLayout: React.FC = () => { const shouldShowMemberListSidebar = shouldShowMemberList && !showMemberListAsOverlay; - const currentPageIndex = getPageIndex(mobileViewActiveColumn); - const totalPages = selectedServerId ? 3 : 2; + // Member list page doesn't exist in DMs — only channels have a member list. + const hasMemberPage = !!selectedServerId && !selectedPrivateChatId; + + // Clamp the active column synchronously so currentPageIndex is never out of + // range during the same render that totalPages drops from 3 to 2 (e.g. when + // switching from a channel to a DM while on the member-list page). + const effectiveMobileColumn = + !hasMemberPage && mobileViewActiveColumn === "memberList" + ? "chatView" + : mobileViewActiveColumn; + + const currentPageIndex = getPageIndex(effectiveMobileColumn); + const totalPages = hasMemberPage ? 3 : 2; + + // Persist the corrected column back into the store after paint. + useEffect(() => { + if (effectiveMobileColumn !== mobileViewActiveColumn) { + setMobileViewActiveColumn(effectiveMobileColumn); + } + }, [ + effectiveMobileColumn, + mobileViewActiveColumn, + setMobileViewActiveColumn, + ]); const { containerRef, @@ -332,7 +354,7 @@ export const AppLayout: React.FC = () => { }} > {PAGE_ORDER.filter( - (col) => col !== "memberList" || selectedServerId, + (col) => col !== "memberList" || hasMemberPage, ).map((column) => (
= ({ )} - {message.msgid && ( + {canReply && ( )} - {message.msgid && ( + {canReply && (
diff --git a/src/hooks/useMessageSending.ts b/src/hooks/useMessageSending.ts index 9b63c0fb..d733fb32 100644 --- a/src/hooks/useMessageSending.ts +++ b/src/hooks/useMessageSending.ts @@ -202,7 +202,7 @@ export function useMessageSending({ } const batchId = createBatchId(); - const replyPrefix = localReplyTo + const replyPrefix = localReplyTo?.msgid ? `@+draft/reply=${localReplyTo.msgid} ` : ""; @@ -305,7 +305,7 @@ export function useMessageSending({ return; } - const messagePrefix = localReplyTo + const messagePrefix = localReplyTo?.msgid ? `@+draft/reply=${localReplyTo.msgid} ` : ""; @@ -373,7 +373,7 @@ export function useMessageSending({ splitLines.forEach((line: string) => { ircClient.sendRaw( selectedServerId, - `${localReplyTo ? `@+draft/reply=${localReplyTo.msgid} ` : ""}PRIVMSG ${target} :${line}`, + `${localReplyTo?.msgid ? `@+draft/reply=${localReplyTo.msgid} ` : ""}PRIVMSG ${target} :${line}`, ); }); }, diff --git a/src/store/index.ts b/src/store/index.ts index de0a6c31..ac0ee711 100644 --- a/src/store/index.ts +++ b/src/store/index.ts @@ -1807,12 +1807,18 @@ const useStore = create((set, get) => ({ } } - // If already selected, do nothing + // If already selected, only navigate on mobile if requested if ( serverId && state.ui.perServerSelections[serverId]?.selectedPrivateChatId === privateChatId ) { + if (state.ui.isNarrowView && options?.navigate) { + return { + ...state, + ui: { ...state.ui, mobileViewActiveColumn: "chatView" }, + }; + } return state; } @@ -2516,8 +2522,8 @@ const useStore = create((set, get) => ({ set((state) => ({ ui: { ...state.ui, - isSettingsModalOpen: - isOpen !== undefined ? isOpen : !state.ui.isSettingsModalOpen, + isUserProfileModalOpen: + isOpen !== undefined ? isOpen : !state.ui.isUserProfileModalOpen, }, })); },