Skip to content

feat: apple watch app + home screen widgets#655

Open
islandbitcoin wants to merge 17 commits into
mainfrom
feat/apple-watch-app-home-screen-widgets
Open

feat: apple watch app + home screen widgets#655
islandbitcoin wants to merge 17 commits into
mainfrom
feat/apple-watch-app-home-screen-widgets

Conversation

@islandbitcoin

@islandbitcoin islandbitcoin commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds the Flash Apple Watch app and BTC price complication with live BTC price, 30-day chart, Flash branding, refresh state, Scan quick action, and Receive Paycode QR display on the watch.
  • Adds iOS home-screen WidgetKit support with BTC price, 30-day watch-style sparkline, stale chart-data cleanup, and Scan/Receive quick actions.
  • Adds Android home-screen widget support and native bridge wiring so widget/watch state stays synced from the React Native app.
  • Wires WatchConnectivity, app-group entitlements, Xcode targets/embed settings, and CocoaPods fixes needed for clean native builds.

Verification

  • git diff --check origin/main...HEAD
  • xcodebuild -workspace ios/LNFlash.xcworkspace -scheme 'FlashWatch Watch App' -configuration Debug -destination 'platform=watchOS Simulator,id=B12E90B2-3F78-4E36-874D-EC1835869416' -derivedDataPath /tmp/lnflash-watch-action-dd build
  • xcodebuild -workspace ios/LNFlash.xcworkspace -scheme FlashWidgetExtension -configuration Debug -sdk iphonesimulator -destination 'generic/platform=iOS Simulator' -derivedDataPath /tmp/lnflash-watch-action-dd build
  • xcodebuild -workspace ios/LNFlash.xcworkspace -scheme FlashWidgetExtension -configuration Debug -sdk iphonesimulator -destination 'generic/platform=iOS Simulator' -derivedDataPath /tmp/lnflash-watch-qr-ios-dd build

Current CI Notes

  • Passing on latest checked run before cleanup: CodeQL and Conventional commits.
  • Failing: Check Code stops at tsc -p . with TS5095 under the repo's current TypeScript config.
  • Failing: Tests stop before running test cases because ts-jest cannot load missing ttypescript.
  • Failing: Spell Check reports repo-wide existing typos such as Governement, Cantacts, Infor, and Enjoing in files outside this watch/widget scope.

Notes

  • Local yarn tsc:check with the existing config hits the same TS5095 CI blocker.
  • A local experiment with module: esnext, moduleResolution: bundler, and ts-patch clears the immediate CI config blockers but exposes broad existing TypeScript errors across app/test files, so that config cleanup is intentionally not included in this PR.

abh3po and others added 17 commits June 12, 2026 15:30
…-driven relay, remove dead createGroup

- Remove the malformed react-native-svg+15.15.2.patch: it captured Android
  build artifacts (android/build/.transforms, classes.dex, generated
  BuildConfig.java) rather than source. react-native-svg patching is owned by
  #645, which supersedes this.
- Gate the verbose [nip29] publish/join logs behind __DEV__ via nip29Log /
  nip29Warn so signed events and relay chatter never reach production logs.
- Make the default relay + support group id config-driven via react-native-config
  (NIP29_RELAY_URL / NIP29_SUPPORT_GROUP_ID), with groups.0xchat.com and the
  support group as defaults — no longer hard-coded. Also route the provider's
  relayUrls default prop through NIP29_DEFAULT_RELAY_URL.
- Remove the unused createGroup from NostrGroupChatProvider (dead code that
  duplicated the standalone createNip29Group used by CreateGroupModal); drop the
  now-unused generateSecretKey / bytesToHex imports.

No new type errors (tsc unchanged at 87, all pre-existing). Note: react-native-config
may need a jest mock when the suite is revived (ENG-433).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The three derive-from-EventStore effects returned `store.subscribe(...)`
directly as the cleanup, but its unsubscribe returns `boolean`, which
violates useEffect's `void` cleanup contract (TS2345). Wrap each so the
cleanup discards the return. No runtime change (React ignored the value);
clears the 3 tsc errors this PR introduced.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Native home-screen widget for iOS (WidgetKit) and Android (AppWidget) in
small/medium/large sizes showing the live BTC price plus Scan/Receive
quick actions.

- Shared price snapshot via App Group (iOS) / SharedPreferences (Android),
  written by the RN app on each price poll through a WidgetBridge native
  module, and refreshed independently by the widget via the public
  realtimePrice GraphQL query so it stays current while the app is closed.
- Quick actions deep-link via flash://scan and flash://receive; added those
  routes to the navigation linking config and a flash:// intent filter on
  Android MainActivity.
- iOS extension sources scaffolded with Xcode setup steps in
  ios/FlashWidget/SETUP.md (target creation must be done in the GUI).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Adds a native watchOS app and a WidgetKit complication that show a live
BTC price on the watch and on any watch face, mirroring the conventions
of the existing home-screen widget (ios/FlashWidget).

- Watch app (SwiftUI): glanceable price, manual refresh, last-updated,
  and Scan/Receive quick actions handed off to the iPhone.
- Complication (WidgetKit, watchOS 9+): accessoryCircular, inline,
  rectangular, and corner families.
- Self-contained price fetch via the public unauthenticated realtimePrice
  query (works with the phone away / before login; defaults to USD).
- Watch-local App Group group.com.lnflash.watch shares the snapshot
  between the watch app and its complication.
- Phone-side WatchConnectivityBridge RN module pushes the user's display
  currency to the watch and opens flash:// deep links from watch actions;
  WatchCurrencySync wires it into the authed tree.
- ios/FlashWatch/SETUP.md documents Xcode target creation + wiring
  (pbxproj edited in the GUI, per repo convention).

Closes ENG-459

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… chart

- Replace generic SF Symbol icons with Flash logo on widgets, watch app,
  watch complications, and watch app icon
- Add price change badge (+/- percent) with green/red coloring on all
  widget sizes and watch app
- Add 30-day high/low range row on large widget and watch app
- Add end-point dot marker on sparkline for current price position
- Polish typography spacing and chart proportions to match River quality
- Chart data: ONE_MONTH range with smooth Catmull-Rom curves (140 points)
…watch

The widget sparkline was using a different price conversion formula than
the watch app, causing wrong price values (+82140% change) and a broken
flat-line chart. Now uses the same (base / 10^offset) * multiple(currencyUnit)
formula as the Flash price-history screen and watch app.

Also switched from timestamp-based to index-based x-axis positioning so
data points are evenly spaced — matching the watch chart exactly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants