Skip to content

Add an optional Strata context-menu action for Omdrop - #68

Open
shaecodes-wilde wants to merge 1 commit into
netmojo-systems:mainfrom
shaecodes-wilde:feat/strata-action
Open

shaecodes-wilde wants to merge 1 commit into
netmojo-systems:mainfrom
shaecodes-wilde:feat/strata-action

Conversation

@shaecodes-wilde

Copy link
Copy Markdown
Contributor

Add an optional OmDrop… file context-menu action for Strata. It reads the whole selection, opens a GTK 4 device picker, and calls the existing Omdrop sender with separate arguments for every path.

Related to #54: this implements the custom-action option A. The menu entry is static and discovery starts after clicking; a persistent file provider with peers directly in the menu is outside this PR.

Behavior

  • omdrop strata install installs regular, owner-only action files in $XDG_CONFIG_HOME/strata/actions/omdrop. Strata refuses symlinked actions, so this copies the assets rather than linking them.
  • omdrop strata remove removes an unedited installed action. A checksum record allows updates of previous unedited bundles; either operation preserves existing, edited, symlinked, or extra user files. Setup does not install it automatically. README covers dependencies, use, errors, removal, and uninstall cleanup.
  • If Omdrop starts off, it opens a 10-minute window using the saved visibility setting before discovering peers. On iPhone, the picker explains the currently tested Everyone/Share → AirDrop setup.
  • Cancel in the picker sends nothing. The action validates readable local files and duplicate basenames, rechecks the selection before dispatch, and passes paths directly after --. Folders are refused with a suggestion to compress them; .webloc/.url handling stays with omdrop send.
  • A passive peer-table check before dispatch rejects a disappeared/changed address with a retry message. A device that disappears afterward is handled by the existing sender's bounded waits/errors. Discovery and send output/exit status appear in Strata Jobs; Jobs cancellation stops the process group.

Validation

Base: current main 5e01a4630e81709fc9dba0e596b5bd9394e0fad1.

  • python3 -m unittest discover -s tests: current main 234 passed, this branch 243 passed; no failures.
  • Nine new checks cover off-to-on discovery and real subprocess argument/exit-status forwarding (spaces, newline and shell metacharacters), invalid selections, cancellation, no peers, changed addresses, private/idempotent install/remove under XDG config, update of an unedited bundle, and preservation of existing/edited/extra/symlinked files.
  • Actual GTK picker checked on an isolated Broadway display/private D-Bus session: selecting the second recipient and Send returns its address; Cancel returns no recipient. This local widget check is separate from the headless unittest suite.
  • bash -n bin/omdrop and git diff --check: passed.

The earlier locally installed action successfully sent a PNG to an iPhone 16 Pro Max and the user confirmed it opened. That setup used MT7922, the separately patched mt76 driver and Omdrop owl; its hardware result does not validate the installer/revalidation additions in this exact branch. The user reconfirmed a successful Strata right-click-to-iPhone transfer while this PR was being prepared. Draft pending a fresh end-to-end test of the new installer/revalidation additions on this packaged revision, including starting Omdrop off. Mac hardware and other radio backends are untested; exact iOS version remains unverified. The existing working desktop installation is unchanged.

@shaecodes-wilde
shaecodes-wilde marked this pull request as ready for review October 14, 2026 20:30

@brentkearney brentkearney left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution, @shaecodes-wilde! This PR needs some work before we can merge:

  1. Test it end to end. Run this revision on real hardware, including starting with Omdrop off; those are #54's acceptance criteria. Add the result when you have it. You don't need to test Contacts Only if you haven't extracted your Apple ID AirDrop credentials yet; we can test that case on our side.
  2. Retry discovery when Omdrop starts off. The action runs one peers -n lookup straight after omdrop on 10m, and a window that has just opened often hasn't seen any devices yet. Retry a few times, or use omdrop peers -n --json --stream. Add a test where the fake omdrop returns [] first and a device second, and the send still happens.
  3. Device instructions. "Set Everyone for 10 Minutes" is right for the self-signed identity, which is what most people use. With the Apple ID identity, Contacts Only works too. Either say so, or base the hint on omdrop identity status --json ("window": "self-signed"), as unreachable_message in bin/omdrop does. Any share sheet wakes AirDrop, not only Photos.
  4. Refresh stale copies. A plugin update leaves the old run.py installed. Have omdrop setup refresh an installed, unedited copy (your checksum record already tells you which ones are safe). Keep that refresh as its own command, such as omdrop strata refresh, which setup calls, so it can be tested on its own. Add a test that an unedited copy is updated and an edited one is left alone.
  5. Minor: strata remove says "Removed" when nothing was installed; use "Omdrop…" to match the product name; and choose a share or send icon instead of globe.

Your PR motivated me to install Strata, and I look forward to playing with it! I also look forward to getting your work integrated with Omdrop - thanks again!

@brentkearney brentkearney added the changes requested The contributor needs to change the PR before it can merge label Oct 15, 2026
@brentkearney

Copy link
Copy Markdown
Collaborator

Hi @shaecodes-wilde, an update that changes part of my review. Since you opened this, Omdrop 0.18.0 has made omdrop-core, Omdrop's Rust version, the one that runs on Macs. Whenever core is installed with a radio backend that supports it, omdrop hands every command to core, and core doesn't know about strata. So omdrop strata install would fail on every Mac today, and on omdrop-owl machines once omdrop-owl supports core. New commands also now go into core, not the bash script (AGENTS.md).

What still applies:

  • The action itself (run.py and the GTK picker) is fine as it is. It only calls omdrop on, peers and send, which work with either version.
  • My points 1, 2, 3 and 5. For 2, omdrop peers -n --json --stream is in core too.

What changes:

  • Installing, removing and refreshing the action (my point 4) can't live in bin/omdrop. Could they be a script in the action bundle instead, such as share/strata/omdrop/install with install, remove and refresh, run by its path? Your checksum record and the install and remove tests carry over as they are. omdrop setup would call refresh to update an unedited copy; we'll add that call to both versions.
  • The branch conflicts with main and needs a rebase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changes requested The contributor needs to change the PR before it can merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants