Skip to content

feat(ios): add an in-app inspector (DariUI) - #295

Merged
easyhooon merged 6 commits into
mainfrom
feat/ios-in-app-inspector
Nov 12, 2026
Merged

easyhooon merged 6 commits into
mainfrom
feat/ios-in-app-inspector

Conversation

@easyhooon

@easyhooon easyhooon commented Nov 12, 2026 •

Copy link
Copy Markdown
Owner

Summary

Step 1 of #288: an in-app inspector for iOS, so QA and web developers can check bridge messages on a device without a Mac. Refs #288 (steps 2+ stay open).

Behavior changes

  • The Swift package now needs iOS 16. Apps whose deployment target is iOS 15 can't add Dari 3.5.0 through SPM, even with import Dari behind #if DEBUG; stay on 3.4.0 until they move to 16.

Changes

  • New DariUI product (root Package.swift and dari-ios/Package.swift), so apps that only use the desktop app don't link UI code.
    • Dari.shared.presentInspector() shows it over the frontmost screen, and DariInspectorView can go in an app's own .sheet.
    • List, newest first, with search over handler, tag and payloads; status icon, direction, tag, time and duration per row.
    • Detail with a segmented Overview / Request / Response picker, pretty JSON that keeps key order, protobuf Decoded / Raw (Hex and Base64).
    • Mask Sensitive Values switch in the ⋯ menu (persisted, off by default), using the same rules as the desktop: the list, search, detail, share and export all see masked data, and raw protobuf previews are dropped.
    • Share one message as text; export all as text or JSON (same fields, key order and nulls as the Android exporter and the desktop's iOS variant); clear.
    • System components only, so it follows the host app's look, including Liquid Glass on iOS 26+.
  • DariUI reads the store through package access; nothing new is public in Dari beyond what DariUI exposes.
  • The inspector re-snapshots the store on every event (coalesced), so retentionPeriod and maxEntries drops show up. It follows Dari.stop() / start() while open.
  • Sample app: an Inspector button stands in for a debug menu.
  • Docs: In-app inspector section in ios/index.mdx (+ ko), iOS 16 requirement, README tables.
  • Separate commit: ProtobufTests gets its own port range; it shared 38700–38707 with BridgeMacroTests and failed intermittently.

Notes for reviewers

  • Desktop masking and setPayloadRedactor apply only to what's sent to the desktop app; the in-app view has its own switch, as on Android.
  • Out of scope for step 1: filter menus, response-time stats, notification, shake-to-open, floating button, history across restarts.
  • Verified: swift test (new DariUITests), a Swift 6 consumer of both the root package and dari-ios building for the iOS Simulator, and the sample on an iOS 27 Simulator (list, detail, protobuf Raw, empty state, JSON export share sheet). Not run on a physical device or iPad.
  • Reviewed with Opus at high effort; its findings are fixed in the last commit.

List, detail, search and share, opened with Dari.shared.presentInspector().
Raises the package minimum to iOS 16.

Refs #288
BridgeMacroTests shares 38700-38707, and stopped listeners hold a port for up to 250 ms.
Ship DariUI and the iOS 16 minimum from the root Package.swift, parse JSON before reindenting,
match the Kotlin export's key order and nulls, and format payloads off the main thread.
@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@easyhooon
easyhooon marked this pull request as ready for review November 12, 2026 07:53
@easyhooon
easyhooon merged commit c16dc89 into main Nov 12, 2026
7 checks passed
@easyhooon
easyhooon deleted the feat/ios-in-app-inspector branch November 12, 2026 07:53
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.

1 participant