Skip to content

Add Advanced settings, menu-bar quick send, iPad menu and Shortcuts actions - #20

Merged
bakirgdev merged 5 commits into
mainfrom
1-0/p11-advanced-settings
Oct 15, 2026
Merged

bakirgdev merged 5 commits into
mainfrom
1-0/p11-advanced-settings

Conversation

@bakirgdev

Copy link
Copy Markdown
Owner

Intent

CrocApp stalled at v0.9.9. This PR (P11 + P12 + P13 of the 1.0 plan) adds the power-user and desktop-integration features: Advanced network settings, the macOS menu bar, the iPad menu, and Shortcuts actions.

Requirements

  • R25 Advanced settings: proxies (Keychain only), internal DNS, curve, hash, upload limit, ports, sender IP, multicast. Go options and process-global handling in crocmobile/network.go; app side in AppSettings, AdvancedSettingsView, AdvancedSettingsValidation.swift; footers written from verify-interop.sh scenario 15 results.
  • R26 Menu-bar quick send and Open at login: MenuBarQuickSend, MenuBarQuickSendView, LoginItem.
  • R28 iPad menu: Send, Receive, Show Receive Folder in Files (AppCommands.swift).
  • R27 Shortcuts: Send Files, Send Text, Receive (app/CrocApp/Intents/).
  • R12d, R29 Proxy secrets only in the Keychain; docs pages added.

Plan deviations

  • Stored transfers do not use the proxy globals; they get an explicit storeclient.Client built from StoreOptions (avoids racing a transfer under activeMu).
  • iPad menu simulator screenshot not taken (menu bar not reachable with the tools at hand); left as an owner device check.
  • Running the actions from Shortcuts, the iPhone run and the Finder Quick Action are owner device checks (O8).

Review

Three reviews. Third review at HEAD 743df24: Important 0, Nit 32 (5 listed, 27 unlisted, none blocking). Earlier Important findings fixed (last one: harness run and Build log entry for 743df24). No Important accepted unfixed.

Verification (rerun at 743df24 in the ship session)

  • Go: go build, go vet, golangci-lint run (0 issues), go test -race ./... (121 passed), govulncheck -show verbose (0 reachable; run via go run golang.org/x/vuln/cmd/govulncheck@latest because the installed binary was built with go1.26 and fails on go1.27).
  • scripts/format-swift.sh --lint: exit 0.
  • scripts/build-xcframework.sh, swift test --package-path CrocKit, xcodebuild test -scheme CrocApp (macOS): pass.
  • Builds: macOS, iOS Simulator, generic iOS device, CrocApp Direct: BUILD SUCCEEDED, no warning: from our sources.
  • scripts/verify-interop.sh: first run failed once on public pool relay admission rate limited; retry: ALL INTEROP CHECKS PASSED.
  • scripts/verify-app-mac.sh: all 12 MAC-*-OK. verify-app-sim.sh: SIM-INTEROP-OK. verify-share-sim.sh: SHARE-SIM-OK.
  • Not verified: interop scenarios RELAY skips are covered by the public run; device-gated items (iPad menu screenshot, Shortcuts on device, Finder Quick Action) are owner checks.

…it, ports, sender IP, multicast

The engine takes the croc CLI's remaining options. network.go validates them
before the transfer lock (new failure code invalidSetting, proxy errors never
quote the value) and sets croc's process-wide proxy and DNS globals for one
transfer, restored before the lock is released, including after an error or a
panic. Stored transfers get an explicit proxied HTTP client instead, because
RevokeStored runs outside the lock and must not read those globals. A sender IP
turns the public relay pool off, as in the CLI. Upload limits are checked in
the engine, since croc panics on a malformed or zero value.

The app adds an Advanced page (pushed on iOS, a tab on macOS) with defaults,
inline validation, footers saying which side each option affects, and Reset
to Defaults. Proxies live only in the Keychain. Multicast stays macOS-only
until the iOS entitlement is granted.

verify-interop.sh scenario 15 runs each wire-changing option against the CLI
with the matching flag. It showed the receiver's curve wins and the sender
adopts it, so a curve mismatch never fails; the footers say so.
…uts actions

macOS gets a window-style MenuBarExtra (drop zone, Choose Files, Send Clipboard
Text, then code, QR, progress, Cancel) over the one TransferController, with
Show in menu bar and Open at login (SMAppService) in Settings. The iPad File
menu gains Show Receive Folder in Files. Send Files, Send Text and Receive are
App Intents with an AppShortcutsProvider, running in the foreground.

verify-app-mac.sh scenarios 10-12 drive the menu-bar view model, the login item
and each action's perform() against the croc CLI.
…on, keep folder scope, match copies exactly

A finished transfer left isActive true until Done, so the next action failed as
busy. The intent wait now polls, ends with its task and cancels the transfer.
Receive holds a chosen folder's security scope while it finds the files, and a
name the sender offered itself is not taken as a Keep Both copy of another.
A small file over a fast link finished before poll's first 100 ms tick, so
OnFileList never fired and the Shortcuts Receive action returned no files
when the sender was a croc v11 CLI. poll now emits the list on done if it
was missed.
…eleted working directory

run() restores the working directory it is given; the test passed a t.TempDir(), so every later StartSend failed at Getwd on Linux.
@bakirgdev

Copy link
Copy Markdown
Owner Author

CI go / checks failed on Linux: TestRunReportsFailurePayload passed a t.TempDir() as the directory run() restores, so the test binary ended in a deleted cwd and later StartSend calls failed at Getwd. macOS tolerates that. Fixed in the latest commit; verified locally with go test -race ./... and a cwd check after the full run.

@bakirgdev
bakirgdev merged commit 3cb7349 into main Oct 15, 2026
15 checks passed
@bakirgdev
bakirgdev deleted the 1-0/p11-advanced-settings branch October 15, 2026 02:52
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