Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand All @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions src-tauri/gen/apple/ObsidianIRC.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)";
Expand Down
17 changes: 10 additions & 7 deletions src-tauri/gen/apple/ObsidianIRC_iOS/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>0.0.1</string>
<string>0.2.5</string>
<key>CFBundleVersion</key>
<string>0.0.1</string>
<string>0.2.5</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
Expand All @@ -43,13 +43,16 @@
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array/>
<key>CFBundleURLName</key>
<string>IRC Protocol</string>
<string>https</string>
</dict>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>irc</string>
<string>ircs</string>
</array>
<array/>
<key>CFBundleURLName</key>
<string>https</string>
</dict>
</array>
</dict>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
</dict>
</plist>
<dict/>
</plist>
28 changes: 25 additions & 3 deletions src/components/layout/AppLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -332,7 +354,7 @@ export const AppLayout: React.FC = () => {
}}
>
{PAGE_ORDER.filter(
(col) => col !== "memberList" || selectedServerId,
(col) => col !== "memberList" || hasMemberPage,
).map((column) => (
<div
key={column}
Expand Down
13 changes: 11 additions & 2 deletions src/components/layout/ChatHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -331,8 +331,17 @@ export const ChatHeader: React.FC<ChatHeaderProps> = ({
<button
className="p-2 text-discord-text-muted hover:text-white flex-shrink-0"
onClick={() => {
if (searchQuery) onSearchQueryChange("");
else setIsSearchExpanded(false);
if (searchQuery) {
onSearchQueryChange("");
} else {
// Blur before closing so iOS WKWebView fires will-hide and clears
// root.style.position/bottom and data-keyboard-visible properly.
// Without this, onMouseDown's preventDefault keeps focus on the input,
// the unmount doesn't trigger the native keyboard dismiss sequence,
// and data-keyboard-visible stays set — blocking all swipe gestures.
(document.activeElement as HTMLElement)?.blur();
setIsSearchExpanded(false);
}
}}
onMouseDown={(e) => e.preventDefault()}
>
Expand Down
6 changes: 4 additions & 2 deletions src/components/message/MessageActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ interface MessageActionsProps {
onReactClick: (buttonElement: Element) => void;
onRedactClick?: () => void;
canRedact?: boolean;
canReply?: boolean;
}

export const MessageActions: React.FC<MessageActionsProps> = ({
Expand All @@ -16,6 +17,7 @@ export const MessageActions: React.FC<MessageActionsProps> = ({
onReactClick,
onRedactClick,
canRedact = false,
canReply = !!message.msgid,
}) => {
return (
<div className="absolute bottom-1 right-2 opacity-0 group-hover:opacity-100 transition-opacity flex space-x-2 select-none">
Expand All @@ -28,15 +30,15 @@ export const MessageActions: React.FC<MessageActionsProps> = ({
<FaTimes />
</button>
)}
{message.msgid && (
{canReply && (
<button
className="bg-discord-dark-300 hover:bg-discord-dark-200 text-white px-2 py-1 rounded text-xs"
onClick={onReplyClick}
>
<FaReply />
</button>
)}
{message.msgid && (
{canReply && (
<button
className="bg-discord-dark-300 hover:bg-discord-dark-200 text-white px-2 py-1 rounded text-xs"
onClick={(e) => onReactClick(e.currentTarget)}
Expand Down
3 changes: 2 additions & 1 deletion src/components/message/MessageItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,7 @@ export const MessageItem = (props: MessageItemProps) => {
onReply={() => setReplyTo(message)}
onReact={(el) => onReactClick(message, el)}
onDelete={canRedact ? () => onRedactMessage?.(message) : undefined}
canReply={!!message.msgid}
canReply={message.type === "message"}
canDelete={canRedact}
isNarrowView={isTouchDevice}
>
Expand Down Expand Up @@ -1039,6 +1039,7 @@ export const MessageItem = (props: MessageItemProps) => {
canRedact ? () => onRedactMessage?.(message) : undefined
}
canRedact={canRedact}
canReply={message.type === "message"}
/>
)}
</div>
Expand Down
6 changes: 3 additions & 3 deletions src/hooks/useMessageSending.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ export function useMessageSending({
}

const batchId = createBatchId();
const replyPrefix = localReplyTo
const replyPrefix = localReplyTo?.msgid
? `@+draft/reply=${localReplyTo.msgid} `
: "";

Expand Down Expand Up @@ -305,7 +305,7 @@ export function useMessageSending({
return;
}

const messagePrefix = localReplyTo
const messagePrefix = localReplyTo?.msgid
? `@+draft/reply=${localReplyTo.msgid} `
: "";

Expand Down Expand Up @@ -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}`,
);
});
},
Expand Down
12 changes: 9 additions & 3 deletions src/store/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1807,12 +1807,18 @@ const useStore = create<AppState>((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;
}

Expand Down Expand Up @@ -2516,8 +2522,8 @@ const useStore = create<AppState>((set, get) => ({
set((state) => ({
ui: {
...state.ui,
isSettingsModalOpen:
isOpen !== undefined ? isOpen : !state.ui.isSettingsModalOpen,
isUserProfileModalOpen:
isOpen !== undefined ? isOpen : !state.ui.isUserProfileModalOpen,
},
}));
},
Expand Down
Loading