Skip to content

Add iOS build target and refactor Tauri app initialization - #264

Merged
AdamJ merged 1 commit into
mainfrom
claude/tauri-ios-release-f3ku04
Aug 13, 2026
Merged

Add iOS build target and refactor Tauri app initialization#264
AdamJ merged 1 commit into
mainfrom
claude/tauri-ios-release-f3ku04

Conversation

@AdamJ

@AdamJ AdamJ commented Aug 13, 2026

Copy link
Copy Markdown
Owner

Summary

This PR scaffolds a Tauri iOS build target alongside the existing Mac/Windows desktop app, enabling the app to run in the iOS Simulator and eventually ship to the App Store. The changes include extracting shared app initialization logic into a library crate, gating desktop-only features (native menu, self-hosted updater) behind #[cfg(desktop)], and updating platform detection to distinguish iPadOS from macOS.

Type of Change

  • New feature
  • Update to existing feature
  • Bug fix
  • Documentation update
  • Other (describe below)

Changes Made

Rust / Tauri Backend

  • src-tauri/src/lib.rs (new): Extracted pub fn run() containing all app initialization logic, annotated with #[cfg_attr(mobile, tauri::mobile_entry_point)] for iOS compatibility. Desktop-only features (menu, updater, process plugins) are conditionally compiled via #[cfg(desktop)].
  • src-tauri/src/main.rs: Simplified to a thin entry point that calls timetraked_lib::run(), keeping only the Windows-specific windows_subsystem attribute.
  • src-tauri/Cargo.toml: Added [lib] section declaring timetraked_lib with crate-type = ["staticlib", "cdylib", "rlib"] (required for Tauri iOS/Android builds). Moved tauri-plugin-updater and tauri-plugin-process to a platform-specific dependency block scoped to non-mobile targets.
  • src-tauri/tauri.ios.conf.json (new): iOS platform-override config with App Store bundle ID com.adamjolicoeur.timetraked, separate from the desktop identifier to preserve existing app-data/keychain/updater identity.
  • src-tauri/capabilities/default.json: Removed desktop-only permissions (updater:default, process:allow-restart), keeping only cross-platform ones (core:default, opener:default, dialog:default).
  • src-tauri/capabilities/desktop.json (new): Desktop-only capability set with "platforms": ["macOS", "windows", "linux"] to prevent iOS from requesting unavailable plugins.
  • src-tauri/src/menu.rs: Updated documentation to note that menu building is desktop-only (#[cfg(desktop)]).

Frontend / TypeScript

  • src/lib/platform.ts: Enhanced platform detection:
    • Added isIOS export that detects iPhone/iPad/iPod user agents and distinguishes iPadOS (which spoofs "Macintosh" since iPadOS 13) from real Macs via maxTouchPoints > 1.
    • Updated isMac to exclude iOS devices: isMac = /Mac/.test(userAgent) && !isIOS.
    • Used to gate desktop-only Tauri behavior (native menu, self-hosted updater).
  • src/lib/tauriElectronApiShim.ts: Added isIOS check to skip silent update checks on iOS (App Store owns distribution/updates).
  • src/App.tsx: Added a Command Palette button (Search icon) to the header for easier access on touch devices.
  • index.html: Cleaned up CSP meta tag by removing obsolete capacitor://localhost references (leftover from an earlier Capacitor-based plan) and clarified that Tauri's own CSP header is injected at runtime.

Configuration & Scripts

  • package.json: Added three new npm scripts:
    • pnpm tauri:ios:init — scaffold the Xcode project
    • pnpm tauri:ios:dev — launch in iOS Simulator with hot reload
    • pnpm tauri:ios:build — build the iOS app bundle
  • AGENTS.md: Updated version to 2.7.0 and last-updated date; expanded documentation for platform detection, menu building, and the

https://claude.ai/code/session_01LkgcfBvaBCuTwcYah1WrTn

Splits the Rust app into a shared lib.rs (mobile_entry_point) with a
thin main.rs wrapper, adds the [lib] crate target tauri ios init
requires, and gates desktop-only pieces (native menu, self-hosted
updater, updater restart) behind #[cfg(desktop)] since none apply on
iOS. Adds tauri.ios.conf.json to override the identifier to the App
Store bundle ID without touching the existing desktop identifier, and
splits capabilities into cross-platform vs desktop-only files.

Also closes a touch-accessibility gap: the command palette had no
on-screen trigger, only a keyboard shortcut and a desktop menu item.
Adds isIOS to platform.ts (fixing isMac misdetecting iPhone/iPad) to
gate the startup update check off on iOS, and removes a stale
capacitor://localhost CSP entry left over from an earlier plan.

CI/App Store Connect signing is a deliberate follow-up, not included.
@github-actions github-actions Bot added automation For items related to release/documentation/workflow automations dependencies Pull requests that update a dependency file desktop documentation Improvements or additions to documentation frontend labels Aug 13, 2026
@AdamJ AdamJ added this to Timetraked Aug 13, 2026
@AdamJ AdamJ self-assigned this Aug 13, 2026
@github-project-automation github-project-automation Bot moved this to Backlog in Timetraked Aug 13, 2026
@AdamJ AdamJ moved this from Backlog to In review in Timetraked Aug 13, 2026
@AdamJ
AdamJ merged commit 853ae17 into main Aug 13, 2026
3 checks passed
@AdamJ
AdamJ deleted the claude/tauri-ios-release-f3ku04 branch August 13, 2026 15:59
@github-project-automation github-project-automation Bot moved this from In review to Done in Timetraked Aug 13, 2026
@AdamJ
AdamJ restored the claude/tauri-ios-release-f3ku04 branch August 21, 2026 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automation For items related to release/documentation/workflow automations dependencies Pull requests that update a dependency file desktop documentation Improvements or additions to documentation frontend

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants