Skip to content

Commit df3c020

Browse files
fleandrei0xB19cursoragentpeterjahdamip
authored
upgrade to 0.0.8 (#548)
* fix notification message * ci change release type * bump veersion * bump package lock * Db refactoring (#414) * refacto * refacto drizzle * refactor(db): improve code quality, fix duplication, and harden data layer - Extract shared copyRow + SQL exec logic to exec-utils.ts (dedup sqlite.ts/sqlite-worker.ts) - Wrap clearAllTables/clearConversationTables in withTransaction for atomicity - Scope getMessagesByStatus by ownerUserId for multi-user data isolation - Rename getUserProfileField -> getUserProfileById for clarity - Add messageId composite index for dedup query performance - Move seekers notification from query layer to SDK event system (SEEKERS_UPDATED) - Type rowToDiscussion with structural type instead of Record<string, unknown> - Add error handling to deserializeSendAnnouncement for corrupt data resilience - Reorder DDL: move announcementCursors CREATE TABLE before indexes Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Cursor <cursoragent@cursor.com> * remove persistEncryptionKey (#417) * clean tests and remove useless mock (#418) * warn user when gossip opened in several tabs * allow message text selection on browser * switch SQLite VFS to IDBBatchAtomicVFS for multi-tab support * Sdk api improvements (#421) * add Node.js file-based persistence and StorageConfig tagged union - Create NodeFsVFS custom VFS using Node.js fs sync APIs for file persistence - Refactor storage options into StorageConfig tagged union (opfs/idb/node-fs/memory) - Move wasmUrl/wasmBinary into respective StorageConfig variants - Auto-load WASM from filesystem in node-fs mode via createRequire - Add node-demo.ts and node-messaging-demo.ts examples * example * remove service wrapper * fix test * sql migration (#423) * Add peer lag (#413) * Fix notification (#410) * fix notification message * ci change release type * bump veersion * bump package lock * add peer lag --------- Co-authored-by: B19 <44082144+0xB19@users.noreply.github.com> Co-authored-by: damip <damip@damir.com> * defer send queue until session is Active * fix db creation error * use .js suffix for re-export. Needed forNodeNext compat◊gst * add delay for reset killed and saturated sessions (#403) * add delay for reset killed and saturated sessions * fix test and bugs * rebase on db change * fix session status updates don't trigger rerender in components * rebase and fix issues * fix copilote revew * fix compilote review 2 * send keep alive when peer sent 8 or more non ack msg. (#449) * send keep alive when peer sent 8 or more non ack msg. Test added for it. When reset send queu, keep alive msg are removed if there is at least one non keep alive msg * fix add forgotten files * removed unused function * (sdk) update README * fix and test issue keep alive disrupt chat order in chat list. Also should not receive notif for keep alive (#463) * tap 3 time on avatar icon in main page will wipe the current session. For now only ux ui part has been done. Still need to integrate to bordercrypt when ready (#477) * Bump rollup from 2.79.2 to 2.80.0 (#447) Bumps [rollup](https://github.com/rollup/rollup) from 2.79.2 to 2.80.0. - [Release notes](https://github.com/rollup/rollup/releases) - [Changelog](https://github.com/rollup/rollup/blob/v2.80.0/CHANGELOG.md) - [Commits](rollup/rollup@v2.79.2...v2.80.0) --- updated-dependencies: - dependency-name: rollup dependency-version: 2.80.0 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump minimatch (#445) Bumps and [minimatch](https://github.com/isaacs/minimatch). These dependencies needed to be updated together. Updates `minimatch` from 10.2.1 to 10.2.4 - [Changelog](https://github.com/isaacs/minimatch/blob/main/changelog.md) - [Commits](isaacs/minimatch@v10.2.1...v10.2.4) Updates `minimatch` from 3.1.2 to 3.1.5 - [Changelog](https://github.com/isaacs/minimatch/blob/main/changelog.md) - [Commits](isaacs/minimatch@v10.2.1...v10.2.4) Updates `minimatch` from 9.0.5 to 9.0.9 - [Changelog](https://github.com/isaacs/minimatch/blob/main/changelog.md) - [Commits](isaacs/minimatch@v10.2.1...v10.2.4) Updates `minimatch` from 5.1.6 to 5.1.9 - [Changelog](https://github.com/isaacs/minimatch/blob/main/changelog.md) - [Commits](isaacs/minimatch@v10.2.1...v10.2.4) --- updated-dependencies: - dependency-name: minimatch dependency-version: 10.2.4 dependency-type: indirect - dependency-name: minimatch dependency-version: 3.1.5 dependency-type: indirect - dependency-name: minimatch dependency-version: 9.0.9 dependency-type: indirect - dependency-name: minimatch dependency-version: 5.1.9 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add 3 dots menu on home page (#479) * apply React best practices and add baseline tests for nav redesign - fix semantic HTML: <nav> for BottomNavigation, <main> for MainLayout content - fix Discussions.tsx: remove useEffect+useState anti-pattern for scroll ref, use callback ref via useState instead (no derived state) - fix touch target on QR share button (20px → 36px with padding) - simplify PageLayout: replace RefObject with callback ref pattern, remove internal useRef in favor of useState - update useHeaderScroll to accept DOM node directly - add baseline tests: BottomNavigation (4), MainLayout (4), pageConfig (8) * replace footer nav with 3-dot menu in discussions header - Add ThreeDotMenu component with accessibility (role=menu, keyboard nav, focus management) - Add 3-dot menu to Discussions header with Settings item, keep QR button - Remove BottomNavigation from MainLayout (component files kept for future use) - Add back button to Settings page pointing to Discussions - Fix DiscussionHeader search icon position (was below header, now inline right) - Add reusable hover-fill CSS animation (center-spread effect) - Apply hover-fill to list rows across the app - Add menu-open animation to Tailwind config Closes #458, #473 * Republish public key only if not published in last 24h Use lastPublicKeyPush from UserProfile DB to skip redundant publishes. Add SDK test helper factory for UserProfile. * Context menu (#480) * add useLongPress hook with touch, right-click, and cancel-on-move support Detects long-press via setTimeout on touchstart (configurable delay/threshold), cancels on movement or early touchend, and handles desktop right-click via onContextMenu. Exposes longPressTriggered ref so consumers can suppress conflicting gestures (swipe, click). * add ContextMenu bottom sheet component with slide-up animation Portal-based bottom sheet with backdrop dismiss, swipe-down close (>50px), Escape key, arrow key navigation, and focus management. Uses hover-fill class for menu items and pb-safe-b for iOS safe area. * add context menu to MessageItem, remove swipe-left forward Long-press or right-click opens a bottom-sheet context menu with Reply, Forward, and Copy actions. Copy writes message content to clipboard with toast confirmation. Desktop users get a hover arrow button (md+ only). Swipe-left forward gesture is removed (offset clamped to >= 0) along with the forward indicator JSX. Swipe-right reply is preserved. Long-press and swipe are mutually exclusive via longPressTriggered ref. * add long-press context menu with Edit Name to DiscussionListItem Long-press (or right-click) on an active discussion item opens a context menu with Edit Name option. Opens ContactNameModal to rename. Disabled on pending items. Click navigation is guarded by longPressTriggered ref. DiscussionList wires handleEditName via gossip.discussions.updateName() with toast feedback. * fix hover arrow: always right-aligned, remove circle background * match modal max-width to app-max-w breakpoints BaseModal and ContextMenu now use md:max-w-2xl lg:max-w-3xl instead of max-w-md, consistent with the app-max-w utility used by page layouts. * nudge hover arrow inward to avoid bubble edge on incoming messages * pop selected message above overlay when context menu opens When the context menu is open, the selected message smoothly scales up (1.03x) with a shadow and renders above the backdrop (z-1001) so the user can clearly see which message they acted on. Uses a 200ms ease-out transition on transform and box-shadow. * add smooth translateY lift to selected message on context menu open * shift selected message toward center on context menu open * redesign context menu as floating popover with keyboard preservation - Replace bottom sheet with floating popover menu positioned near the bubble - Add glass overlay (white/dark tint) behind the menu - Bubble and menu translate up in sync when near viewport bottom - Prevent keyboard dismissal on long press via onBlur refocus pattern - Disable text selection on discussion page for mobile - Guard against double context menu open from timer + native contextmenu race - Respect bottom safe area inset for menu positioning - Delay menu pointer events until finger lifts to avoid accidental activation - Transfer focus to textarea before search unmount to keep keyboard * fix context menu positioning on iOS when keyboard is open Use refs (keyboardHeightRef, isKeyboardVisibleRef) instead of state in event handlers to avoid stale closures. On iOS, window.innerHeight doesn't shrink with the keyboard, so the context menu needs the live keyboard height to calculate available viewport space. * context menu: open on tap, spotlight overlay, iOS keyboard fixes - Switch context menu trigger from long press to tap - Replace full-screen backdrop with spotlight overlay (box-shadow cutout) so selected bubble appears above the dimming layer - Add diagonal nudge for tall bubbles to indicate selection - Fix iOS context menu positioning with keyboard height snapshot - Add module-level keyboard height singleton for reliable cross-component access - Scroll to bottom when iOS keyboard opens if already at bottom - Replace async useDiscussion with synchronous useMemo to eliminate loading flash - Use Virtuoso initialTopMostItemIndex with visibility gating to prevent scroll animation when entering a discussion * long press to select text, fix menu dismiss on single tap - Long press enables text selection with word-under-finger detection - Tap bubble to deselect, tap outside to deselect - Block text selection when context menu is open - Disable swipe gestures during text selection - Fix menu requiring 2 taps to dismiss (touchReady timer instead of waiting for touchend which already fired before menu rendered) * restyle context menu to match Figma design - Label on left, icon in circular badge on right - Separator lines between menu items - Circular icon badge with muted bg and accent icon color - Adjusted border radius (rounded-lg) and min-width (200px) - Fix iOS container scroll during swipe (preventDefault on horizontal touch) * unify menu item style across ThreeDotMenu and ContextMenu Apply same Figma-based layout (label left, icon badge right, separators) to ThreeDotMenu and ContextMenu components for visual consistency. * menu icon badges: green bg in light mode, dark bg in dark mode Light: bg-accent + text-accent-foreground (green bg, dark icon) Dark: bg-muted + text-accent (dark bg, teal icon) * code review fixes: CSS variable for spotlight, stale closure, cleanup - C1: Replace JS dark mode check with CSS custom property --spotlight-overlay - C2: contextMenuItems useMemo depends on stable scalars (message.id, message.content) instead of full message object - C3: Add .catch() to navigator.clipboard.writeText - W1: Call item.onClick() before onClose() in all menu components - W3: Use swipeOffsetRef to avoid stale closure in handleTouchEnd - W4: Track animation setTimeout in ref, clear on unmount - N2: Remove redundant ternary in menu transform * context menu: always nudge bubble, match spotlight radius, fix Android text selection - Always apply diagonal nudge on context menu open (not just tall bubbles) - Pass actual computed border-radius to spotlight overlay so it matches the bubble shape exactly - On Android, let native contextmenu event through for text selection handles - Add preventDefaultOnEnd option to useLongPress for Android compatibility * remove sticky hover:opacity-90 on message bubbles On Android, hover state persists after touch, causing incoming messages to stay at 90% opacity. * fix timer leak on unmount and close context menu on scroll - useLongPress: clear pending timer on component unmount - MessageItem: close context menu when the Virtuoso list scrolls (prevents spotlight/menu desync on desktop mouse wheel) * fix iOS first long press not working in discussions - Add touch-action: manipulation on message row div so iOS WebKit doesn't delay touch events for gesture disambiguation - Handle touchcancel in useLongPress to clear timer when iOS cancels touch for scroll takeover * bottom nav as optional setting, PR review fixes - Add showBottomNav user preference in Appearance settings (off by default) - MainLayout conditionally renders BottomNavigation based on setting - ThreeDotMenu: trap Tab key to close menu (WAI-ARIA) - ThreeDotMenu: use index as key instead of label - Discussions: narrow filterCounts dependency to gossip.isSessionOpen * fix MessageItem browser tests: click bubble instead of right-click Context menu now opens on tap/click, not right-click (which triggers text selection). Update tests to click the bubble button. * Fix release script to also update package-lock.json version (#485) Use `npm version --no-git-tag-version` to update both package.json and package-lock.json in one shot. Closes #411 * Allow login when API is down, show connection status (#486) * Allow login when API is down, show connection status in header - Make publishPublicKey non-blocking in openSession so login succeeds even when the API is unreachable - Track API reachability with periodic ping + SDK error events - Show "Waiting for connection..." in Discussions header instead of logo when disconnected - Add ConnectionBanner to Discussion, NewDiscussion, and NewContact Closes #428 * Refine connection status UI per design feedback - Discussions: bigger title-sized text, accent color, hide avatar - DiscussionHeader: show "Waiting for connection..." below contact name with light font weight instead of separate banner * Fix connection status reactivity - Use mode: 'no-cors' on ping fetch to avoid false CORS failures - Remove SDK error handler setting isApiReachable=false (was racing with the periodic ping and preventing recovery) - Reduce ping interval to 10s for faster status updates - Re-check API immediately when network comes back online * Simplify connection detection to use Capacitor Network API only Remove custom API ping mechanism — phone connectivity is already reliably detected by Capacitor Network plugin and browser online/offline events. API downtime is a separate concern. * Rename Logout to Lock App (#488) * Rename Logout to Lock App with Lock icon Closes #148 * Skip biometric auto-login after manual lock Add lockedByUser flag to account store. Set it when the user explicitly locks the app so the login screen waits for a manual unlock instead of immediately re-authenticating via biometrics. * when clicking on qr icon on discussion list, we now can switch between qr code scaning and sharing our contact. Improve ux of share contact by inspiring from Signal (#484) * when clicking on qr icon on discussion list, we now can switch between qr code scaning and sharing our contact. Improve ux of share contact by inspiring from Signal * cursor review code tweak * fix typescript issue * Add Android wireless hot reload with dev server support - Add dev-android.sh script and cap:dev:android npm command for one-command wireless live reload - Make capacitor.config.ts read DEV_SERVER_URL env var (no server block without it) - Accept self-signed SSL certs in debug builds only (BridgeWebViewClient subclass) - Add network_security_config.xml with debug-overrides for user CA trust - Document Android live reload setup in README * Add iOS wireless hot reload and unified dev scripts - Add dev-ios.sh and dev-all.sh scripts for iOS and dual-platform hot reload - Patch @capacitor/ios SSL handling to accept self-signed certs (via patch-package) - Add SSLBypassPlugin.swift for belt-and-suspenders SSL bypass in debug builds - Remove WKAppBoundDomains from Info.plist (blocks dev server on IP) - Enable WebView inspection (isInspectable) for Safari DevTools in debug - Add buildFeatures { buildConfig = true } for Android BuildConfig access - Update README with unified Wireless Dev Mode section - Add DEV-GUIDE.md with complete setup instructions * removed the red color of popover help circle button because it was too catchy for user eyes (#489) * ignore claude settings * ignore .worktree * Add dev auto-login to skip password on hot reload - New useDevAutoLogin hook guarded by import.meta.env.DEV (tree-shaken in prod) - Set VITE_DEV_PASSWORD in .env to auto-login on page reload - Document VITE_DEV_PASSWORD in .env.example * Make Add button more visible on New Contact page Use primary color and bold font for the top-right Add button. Fixes #495 * Improve Add button visibility and hide QR/import when ID is filled - Style Add button with bg-accent + text-primary-foreground (pill shape) - Hide Scan QR code and Import from file when a valid Gossip ID is entered - Cleaner UX when arriving from an invite link with pre-filled ID Fixes #495 * Add support for multiple device hot reload in development - Update dev-all.sh script to allow specifying multiple Android and iOS devices via environment variables or CLI arguments. - Enhance device detection and filtering for connected devices. - Introduce new cap:dev:scan command in package.json for scanning devices. - Update .env.example to include new configuration options for development accounts and device targets. - Modify useDevAutoLogin hook to trigger a dev account picker if no account exists but VITE_DEV_ACCOUNTS is set. - Update Onboarding page to show account picker in dev mode. This improves the development experience by allowing easier management of multiple devices during testing. * Fix reply/forward message glitch in long conversations (#487) - Use stable keys in Virtuoso computeItemKey to prevent item confusion when the list shifts (new messages, status changes) - Use unique announcement keys to handle multiple announcements - Add default case for exhaustiveness safety - Replace visible "Loading..." text with invisible placeholders matching final layout dimensions to prevent layout shift - Add truncate to reply/forward previews to prevent overflow * Fix keyboard layout across Samsung, Xiaomi, and iOS (#501) Replace React-based keyboard handling with CSS custom properties for zero-delay response. Lock viewport height on init to prevent ghost gap from OS+transform double-offset. Samsung gets adjustResize (OS handles layout), others get adjustNothing (CSS transform handles layout). - Set --viewport-height, --keyboard-height, --available-height CSS vars directly from native keyboard events (no React render cycle) - Samsung: adjustResize in Java, OS handles WebView resize - Xiaomi/iOS: adjustNothing, CSS transform shifts content up - Modals use --available-height to fit above keyboard on all devices - Remove useIOSKeyboardWorkaround and useFixedKeyboardStyles hooks - Simplify IOSKeyboardWrapper to pure CSS class - Discussion layout: header in z-10 div, content in keyboard-shift-content - Delete account now clears all DB tables (not just profile) * Keyboard fix (#502) * Fix first messages unreachable when keyboard is open on Android The CSS padding-top rule on the Virtuoso scroller was in @layer base, which always loses to Tailwind's pt-6 utility class — so it never applied. Replace with a Virtuoso Header component that uses the --keyboard-height CSS variable to add scrollable space at the top. * Update IOSKeyboardWrapper tests to match keyboard-aware-height class Tests were checking for old transition and h-full classes that no longer exist after the component was refactored to use a CSS variable approach. * Feature/share username (#503) * Fix Android QR scanner opening twice due to StrictMode double-mount * Add option to include username in invite QR code and link * Redesign share contact page layout and UX - QR code as hero element at top, identity info below - Replace Code/Scan tab switcher with scan button in header - Editable shared username via modal instead of inline checkbox - Unified row heights and alignment across all interactive elements - Compact expiry hint replacing full warning notice card - Inline copy link action removing unnecessary modal * add delete message * add get visible message helper * (chore) read device from .env for native watch mode * add message edition * dynamic message menu pos * Bump libcrux-ml-dsa from 0.0.3 to 0.0.4 in /wasm (#389) Bumps [libcrux-ml-dsa](https://github.com/cryspen/libcrux) from 0.0.3 to 0.0.4. - [Release notes](https://github.com/cryspen/libcrux/releases) - [Changelog](https://github.com/cryspen/libcrux/blob/main/RELEASE.md) - [Commits](cryspen/libcrux@libcrux-ml-dsa-v0.0.3...libcrux-ml-dsa-v0.0.4) --- updated-dependencies: - dependency-name: libcrux-ml-dsa dependency-version: 0.0.4 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> * Multi select (#505) * feat: add multi-select messages with animated counter Long press to select, checkboxes slide in, tap to toggle. Selection header shows animated flip-clock counter, clear and copy actions. * fix: handle optional message.id types in multi-select * fix: prevent message row vertical shift when checkbox slides in * fix: use absolute positioning for checkbox to prevent layout shift * fix: iOS long-press deselect, dynamic scroll arrow, mutual reply/forward * fix: stabilize multi-select interactions and guarded delete actions Prevent duplicate Android long-press toggles and synthesized post-gesture clicks from instantly deselecting messages, and add guarded multi-delete behavior with improved diagnostics and browser regression coverage. Made-with: Cursor * Feature/i18n (#510) * Fix notification (#410) * fix notification message * ci change release type * bump veersion * bump package lock * Add multi-language support (EN, FR, ZH-CN, RU) with react-i18next - Configure i18next with privacy-first settings (no cookies, navigator detection only) - Create 8 translation namespaces: common, auth, discussions, settings, wallet, onboarding, errors, time - Migrate all UI components from hardcoded strings to t() calls - Add language selector in Settings with persistence via uiStore - Locale-aware date/time formatting in timeUtils via Intl APIs - TypeScript type safety with module augmentation for autocomplete * Migrate remaining pages and components to i18n (Phase 7-8) Add missing translations for new dev features: multi-select, message editing, deletion, context menu actions, session issue banner, connection status, and fix unused import lint errors. * add pinned message * add emoji reply * add discussion page background pattern Made-with: Cursor * refactor: Discussion page, keyboard store, MessageInput (#518) - MessageInput: extract InputPreviewBanner, useAutoResizeTextarea, useInitialValue - Keyboard: centralize in keyboardStore (Zustand), platform-adaptive (iOS/Android) - Rename IOSKeyboardWrapper -> KeyboardAwareWrapper - MessageSearch: use onPointerDown to prevent keyboard dismiss on close - ScrollToBottomButton: move inside MessageList for correct positioning - Discussion: extract useHeaderScrollDetection, useForwardPreview, useDiscussionActions - CSS: keyboard transitions, platform-specific durations Made-with: Cursor * fix: unified keyboard handling for all Android OEMs adjustNothing in manifest means the OS doesn't resize the WebView, but the Android keyboard path assumed OS resize. Samsung worked by accident (custom behavior), Xiaomi showed input hidden under keyboard. Now both iOS and Android use the same approach: lock viewport height, set --keyboard-offset from keyboard events, shrink layout via --available-height. Also scroll to bottom on keyboard open when user was already at bottom. * add self discussion * add ToS * early detect already existing contact * clean error messages * add discussion msg rentention time * (ios) add custom privacy screen * logout in home menu * share to external app * add Privacy settings * remove build warning * fix tests * Add security settings with auto-lock feature and update account store logout behavior * mute discussion fix test config * enhance biometric login error handling * Bump libcrux-ml-dsa from 0.0.4 to 0.0.8 in /wasm (#541) Bumps [libcrux-ml-dsa](https://github.com/cryspen/libcrux) from 0.0.4 to 0.0.8. - [Release notes](https://github.com/cryspen/libcrux/releases) - [Changelog](https://github.com/cryspen/libcrux/blob/main/CHANGELOG.md) - [Commits](https://github.com/cryspen/libcrux/commits) --- updated-dependencies: - dependency-name: libcrux-ml-dsa dependency-version: 0.0.8 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump picomatch from 4.0.3 to 4.0.4 in /gossip-sdk (#540) Bumps [picomatch](https://github.com/micromatch/picomatch) from 4.0.3 to 4.0.4. - [Release notes](https://github.com/micromatch/picomatch/releases) - [Changelog](https://github.com/micromatch/picomatch/blob/master/CHANGELOG.md) - [Commits](micromatch/picomatch@4.0.3...4.0.4) --- updated-dependencies: - dependency-name: picomatch dependency-version: 4.0.4 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix retentionPolicy * page transitions + perf: framer-motion slides, TanStack Virtual, swipe gestures (#546) - AnimatedRoutes: push/pop slide transitions for discussions, crossfade for others - TanStack Virtual replaces Virtuoso for faster first render - Swipe left on message to reply (inverted from right) - Swipe right in discussion to go back - Swipe left/right on discussion list to change filter - Filter buttons with animated sliding pill - suppress-bubble-in: skip CSS animations on initial message load - Lazy-loaded settings pages - 37 routing safety tests - Reduced viewport padding * fix transition detail discussion * fix: add message selection (long press) support to Notes/self discussion * feat: add Share QR image button on Share Contact page * fix: add safe area top offset to toast notifications * fix: multi-select delete in Notes uses selfMessages API instead of messages * fix: share/copy forwarded messages uses original content instead of empty wrapper * do not skip historical announcements when import account with mnemonics * fix: delete account only removes current account data, not all accounts * stop skip historical announcement when account is restored from mnemonics (a previous commit deleted a wrong skipHistorical call for create account with biometrics instead of the one from restore mnemonics * fix test issues and upgrade to 0.0.8 (#547) --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: ben888 <br@massa.net> Co-authored-by: B19 <44082144+0xB19@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: Pedroloco <34547263+peterjah@users.noreply.github.com> Co-authored-by: Peterjah <ps@massa.net> Co-authored-by: Damir Vodenicarevic <damipator@gmail.com> Co-authored-by: damip <damip@damir.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 parent 1da0a8c commit df3c020

File tree

357 files changed

+26949
-8426
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

357 files changed

+26949
-8426
lines changed

.env.example

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
VITE_GOSSIP_API_URL=
2+
VITE_INVITE_DOMAIN=
3+
VITE_APP_BUILD_ID=
4+
# Set to auto-login in dev mode (skip password prompt on hot reload)
5+
# VITE_DEV_PASSWORD=devdevde
6+
# Dev accounts: auto-restore from mnemonic on first launch (pick identity per device)
7+
# VITE_DEV_ACCOUNTS=[{"name":"Alice","mnemonic":"abandon abandon ..."},{"name":"Bob","mnemonic":"zoo zoo ..."}]
8+
9+
# Device targets for cap:dev:all (comma-separated for multiple devices)
10+
# ANDROID_DEVICES=10.26.239.15:5555,10.26.239.20:5555
11+
# IOS_DEVICES=iPhone de Ben

.github/workflows/tests.yml

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,52 @@ on:
55
branches: [main, dev]
66

77
jobs:
8-
test:
8+
sdk-tests:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
13+
- uses: actions/setup-node@v4
14+
with:
15+
node-version: '24'
16+
cache: 'npm'
17+
18+
- run: npm ci
19+
20+
- name: Run gossip-sdk tests
21+
run: npm --workspace gossip-sdk test
22+
23+
app-tests:
924
runs-on: ubuntu-latest
1025
env:
1126
VITE_GOSSIP_API_URL: ${{ vars.GOSSIP_API_URL }}
1227
VITE_INVITE_DOMAIN: ${{ vars.INVITE_DOMAIN_DEV }}
1328
steps:
14-
- name: Checkout repository
15-
uses: actions/checkout@v4
29+
- uses: actions/checkout@v4
1630

17-
- name: Setup Node.js
18-
uses: actions/setup-node@v4
31+
- uses: actions/setup-node@v4
1932
with:
2033
node-version: '24'
2134
cache: 'npm'
2235

23-
- name: Install dependencies
24-
run: npm ci
36+
- run: npm ci
37+
38+
- name: Cache Playwright browsers
39+
id: playwright-cache
40+
uses: actions/cache@v4
41+
with:
42+
path: ~/.cache/ms-playwright
43+
key: playwright-${{ hashFiles('**/package-lock.json') }}
2544

2645
- name: Install Playwright browsers
46+
if: steps.playwright-cache.outputs.cache-hit != 'true'
2747
run: npx playwright install --with-deps chromium
2848

49+
- name: Install Playwright deps (cached)
50+
if: steps.playwright-cache.outputs.cache-hit == 'true'
51+
run: npx playwright install-deps chromium
52+
2953
- name: Run tests
3054
run: |
3155
npm run build
3256
npm run test:run
33-
34-
- name: Run gossip-sdk tests
35-
run: npm --workspace gossip-sdk test

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,5 +75,6 @@ android/app/src/main/res/mipmap-*/ic_launcher_background.png
7575
# Test artifacts
7676
test/**/__screenshots__/
7777

78-
# Git worktrees
79-
.worktrees/
78+
# Git worktrees & Claude Code
79+
.worktrees/
80+
.claude/

DEV-GUIDE.md

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
# Gossip App — Wireless Dev Mode Guide
2+
3+
Hot reload over Wi-Fi on Android and iOS, with an optional Gossip bot for remote control.
4+
5+
## Quick Start
6+
7+
### Android only
8+
9+
```bash
10+
npm run cap:dev:android -- 10.26.239.15:5555
11+
```
12+
13+
### iOS only
14+
15+
```bash
16+
npm run cap:dev:ios
17+
# → Opens Xcode. Select your iPhone → Cmd+R
18+
# (Vite starts automatically, hot reload is active)
19+
```
20+
21+
### Both platforms
22+
23+
```bash
24+
npm run cap:dev:all -- "10.26.239.15:5555"
25+
# → Android deploys via ADB, iOS opens Xcode for manual run
26+
```
27+
28+
## Prerequisites
29+
30+
### Network
31+
32+
- Phone(s) and Mac on the **same Wi-Fi network**
33+
- Android: ADB Wi-Fi connected (`adb connect <ip>:5555`)
34+
- iOS: Wi-Fi debugging enabled in Xcode (Window → Devices and Simulators → Connect via network)
35+
36+
### One-time iOS setup
37+
38+
1. Install the mkcert root CA on your iPhone:
39+
- AirDrop `~/.vite-plugin-mkcert/rootCA.pem` to your phone
40+
- Settings → General → VPN & Device Management → install the profile
41+
- Settings → General → About → Certificate Trust Settings → enable full trust
42+
43+
2. Ensure Xcode has your device set up for Wi-Fi debugging
44+
45+
### One-time Android setup
46+
47+
```bash
48+
adb tcpip 5555
49+
adb connect <phone-ip>:5555
50+
```
51+
52+
## How It Works
53+
54+
### The dev scripts
55+
56+
All scripts follow the same flow:
57+
58+
1. Detect local IP address
59+
2. Build the SDK (`npm run build:sdk`)
60+
3. Set `DEV_SERVER_URL=https://<local-ip>:5173`
61+
4. Run `cap sync` (writes the dev server URL into the Capacitor config)
62+
5. Deploy to device (or open Xcode for iOS)
63+
6. Start Vite HTTPS dev server (`npx vite --host`)
64+
65+
The WebView loads from the Vite server instead of bundled files → any code change triggers hot reload.
66+
67+
### SSL handling
68+
69+
The Vite server uses HTTPS (required for `crypto.subtle`). Self-signed certs need bypass on both platforms:
70+
71+
**Android** (already in repo):
72+
73+
- `MainActivity.java`: `BridgeWebViewClient` subclass that accepts all certs in debug
74+
- `network_security_config.xml`: trusts user-installed CAs in debug
75+
76+
**iOS** (3 layers, belt-and-suspenders):
77+
78+
1. `patches/@capacitor+ios+8.0.0.patch` — patches `WebViewDelegationHandler.swift` to accept self-signed certs (persisted via `patch-package`, applied on `npm install`)
79+
2. `ios/App/App/SSLBypassPlugin.swift` — Capacitor plugin registered in debug builds only
80+
3. `ios/App/App/Info.plist``WKAppBoundDomains` removed (blocks localStorage on non-listed domains)
81+
82+
### Key files
83+
84+
| File | Purpose |
85+
| ------------------------------------------------- | ----------------------------------------- |
86+
| `scripts/dev-android.sh` | Android hot reload script |
87+
| `scripts/dev-ios.sh` | iOS hot reload script |
88+
| `scripts/dev-all.sh` | Both platforms simultaneously |
89+
| `capacitor.config.ts` | Reads `DEV_SERVER_URL` env var |
90+
| `patches/@capacitor+ios+8.0.0.patch` | SSL bypass patch for Capacitor iOS |
91+
| `ios/App/App/SSLBypassPlugin.swift` | SSL bypass Capacitor plugin (debug only) |
92+
| `ios/App/App/MyViewController.swift` | Plugin registration + WebView inspectable |
93+
| `android/app/src/main/java/.../MainActivity.java` | SSL bypass for Android (debug only) |
94+
95+
## Troubleshooting
96+
97+
### iOS black screen
98+
99+
This means the WebView can't load from the dev server (SSL rejection).
100+
101+
1. Verify the patch is applied: check `node_modules/@capacitor/ios/Capacitor/Capacitor/WebViewDelegationHandler.swift` for "patched by gossip-app" comment
102+
2. If not applied: `npx patch-package` or `npm install` (postinstall hook runs it)
103+
3. After patching: `npx cap sync ios`, then clean build in Xcode (Cmd+Shift+K → Cmd+R)
104+
4. Nuclear option: delete `~/Library/Developer/Xcode/DerivedData` and rebuild
105+
106+
### `cap sync` removed the dev server URL
107+
108+
Never run `cap sync` without `DEV_SERVER_URL` set. Always use the dev scripts which set it automatically.
109+
110+
### Safari Web Inspector doesn't show the app
111+
112+
- Ensure `bridge?.webView?.isInspectable = true` is set in `MyViewController.swift` (under `#if DEBUG`)
113+
- The app must actually load (no black screen) for it to appear
114+
- Safari → Settings → Advanced → Show features for web developers
115+
116+
### Android not connecting
117+
118+
```bash
119+
adb devices # check connection
120+
adb disconnect
121+
adb connect <ip>:5555
122+
```
123+
124+
## Gossip Bot (optional)
125+
126+
For remote control — send instructions from your phone via Gossip:
127+
128+
```bash
129+
cd bot.local && npm start
130+
```
131+
132+
Then set up a cron in Claude Code:
133+
134+
```
135+
/loop 1m Check bot.local/inbox.jsonl for unprocessed messages...
136+
```
137+
138+
Bot config is in `bot.local/.env`. See `memory/dev-setup.md` for full details.

README.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,86 @@ The app uses these Capacitor plugins:
324324
2. Clear derived data
325325
3. Reinstall pods: `cd ios/App && pod deintegrate && pod install`
326326

327+
## Wireless Dev Mode
328+
329+
Hot reload directly on your phone over Wi-Fi. Edit code on your Mac, see changes instantly on the device — no cable needed.
330+
331+
### Android
332+
333+
**One-time setup** — connect ADB over Wi-Fi:
334+
335+
```bash
336+
# With USB plugged in:
337+
adb tcpip 5555
338+
adb connect <phone-ip>:5555
339+
# Unplug USB. Verify:
340+
adb devices
341+
```
342+
343+
**Run:**
344+
345+
```bash
346+
npm run cap:dev:android -- <device>
347+
# Example: npm run cap:dev:android -- 10.26.239.15:5555
348+
```
349+
350+
### iOS
351+
352+
**One-time setup** — enable Wi-Fi debugging in Xcode:
353+
354+
1. Connect iPhone via USB
355+
2. Xcode → Window → Devices and Simulators → check "Connect via network"
356+
3. Unplug — device stays visible wirelessly
357+
358+
**Run:**
359+
360+
```bash
361+
# List available devices
362+
npm run cap:list:ios
363+
364+
# Run with a specific device
365+
npm run cap:dev:ios -- "iPhone de Ben"
366+
367+
# Without target — opens Xcode, pick your device
368+
npm run cap:dev:ios
369+
```
370+
371+
### How it works
372+
373+
Both scripts:
374+
375+
1. Detect your Mac's local IP
376+
2. Build the SDK
377+
3. Set `DEV_SERVER_URL` so the Capacitor WebView points at the Vite dev server
378+
4. Sync and deploy the app to your device
379+
5. Start Vite with `--host` (HTTPS via mkcert for `crypto.subtle` support)
380+
381+
Self-signed certs are accepted in debug builds only:
382+
383+
- **Android**: `BridgeWebViewClient` override in `MainActivity.java`
384+
- **iOS**: `WKNavigationDelegate` override in `MyViewController.swift` (`#if DEBUG`)
385+
386+
### Troubleshooting
387+
388+
- **Android "cannot find symbol BuildConfig"**: Ensure `buildFeatures { buildConfig = true }` in `android/app/build.gradle`
389+
- **iOS cert rejected**: Make sure you're running a Debug build, not Release
390+
- **Device not found**: Check `adb devices` (Android) or `npx cap run ios --list` (iOS)
391+
- **Hot reload not working**: Verify phone and Mac are on the same Wi-Fi network
392+
393+
### All Capacitor Commands
394+
395+
| Command | Description |
396+
| -------------------------- | -------------------------------------------- |
397+
| `npm run cap:dev:android` | Live reload on Android device over Wi-Fi |
398+
| `npm run cap:dev:ios` | Live reload on iOS device over Wi-Fi |
399+
| `npm run cap:sync:android` | Build web assets and sync to Android project |
400+
| `npm run cap:sync:ios` | Build web assets and sync to iOS project |
401+
| `npm run cap:run:android` | Build, sync, and run on Android device |
402+
| `npm run cap:run:ios` | Build, sync, and run on iOS simulator |
403+
| `npm run cap:open:android` | Open Android project in Android Studio |
404+
| `npm run cap:open:ios` | Open iOS project in Xcode |
405+
| `npm run cap:list:ios` | List available iOS devices |
406+
327407
## Contributing
328408

329409
1. Fork the repository

0 commit comments

Comments
 (0)