Skip to content

feat: start remotes and orgs from the API - #734

Merged
xHeaven merged 3 commits into
dev-null-sh:productionfrom
simonhamp:feat/api-remotes-people
Oct 22, 2026
Merged

xHeaven merged 3 commits into
dev-null-sh:productionfrom
simonhamp:feat/api-remotes-people

Conversation

@simonhamp

Copy link
Copy Markdown
Contributor

Lets the mobile app start a new remote or a new org, the way the web's New remote and New org buttons do. It's one of a few small PRs that bring Remotes to the app (NativePHP/dev-null-app) on top of the signed API from #130. It stands alone. A new remote needs no endpoint of its own: the app finds someone here, and its first push starts the conversation, as on the web. Pushing is in the messages PR (#665).

Endpoints

Both signed. They go through the web's conversations limiter (300 a minute).

Request Answer
GET /api/v1/remotes/candidates?q=&for=remote|org&org={id} {"candidates": [{"user", "reason"}]}, up to 8 people, with a null reason for anyone who can be picked
POST /api/v1/remotes/orgs with name and members (usernames) 201 with {"org": {"id"}}

user is the UserResource the rest of the signed API uses for people, so the app can read it with the code it already has. The candidates answer is sent with Cache-Control: private, no-store, like the web's.

Rules kept from the web

The form requests are copies of the web's ListRemoteCandidatesRequest and CreateOrgRequest. The reasons come from the web's RemoteCandidatesQuery, and the web's CreateOrg action makes the org.

  • The reasons are the web's words: has remotes off and doesn't follow you for a remote, and also already in the org, has a block with someone in the org and the org is full (100) for an org.
  • ?for=org asks about a new org and ?org={id} about one the user is in. An org they aren't in is a 404.
  • An org takes an optional name of up to 60 characters and up to 99 other people. Each of them has to follow the user (unless the user is a site admin), have Remotes on, and have no block with anyone joining.
  • Someone who can't join is a 422 on their place in members, with the web's message, like @taylorotwell doesn't follow you.
  • Starting an org also goes through throttle:messages (30 a minute), as on the web.
  • Both are a 404 while the user has Remotes off.

One small difference. The web looks ?org= up before it validates it, so an org that isn't a UUID makes Postgres throw and the web answers 500. The API request only looks it up when it is a UUID, so the same request gets a 422 there. I left the web alone to keep this PR small.

Testing

New feature tests in tests/Feature/Controllers/Api/ cover both endpoints: the happy paths, every reason, the 404s, validation, both limits and unsigned requests. Everything CI runs passes on this branch locally: Pint, Rector, the JS lint, PHPStan, tsc, type coverage, the JS unit tests, and all 3,417 PHP tests at 100% coverage.

simonhamp added a commit to NativePHP/dev-null-app that referenced this pull request Oct 19, 2026
…ipe to reply

Remotes gets the web's two buttons at the top right, with its icons: New org
(users-round) and New remote (square-pen). New remote finds a developer by
name or handle and opens your conversation with them. New org takes an
optional name and people, up to the web's 100 with you, and opens the new
org. Someone you can't reach shows the web's reason and can't be picked.
Both use the people search and org creation in dev-null-sh/dev-null.sh#734.

Open, Fetched and Stashed are now pages you swipe between, like the Log and
Notifications. The pager's tabs are text only, so Fetched's request count
goes in its label.

Swiping a message sideways replies to it, as the web does on touch screens:
someone else's to the right, your own to the left. The field takes focus.
Any other swipe, such as a flick while scrolling, does nothing.

The typing line now sits above the composer's border, as on the web, so the
Push box is tighter. Stash and Pop in a thread's menu use the web's archive
icons.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
simonhamp added a commit to NativePHP/dev-null-app that referenced this pull request Oct 19, 2026
* Add Remotes: the inbox, threads and their settings, as on the web

Remotes takes Saved's place in the tab bar, and Saved opens from your own
profile. The inbox and threads poll as the web's do, messages push staged
and then pushed, and the Account screen gains the web's Remotes switch
and Share pulls.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Keep a reader's place in a Remotes thread, and fix what the simulator turned up

Each message is now a row of the thread's scroll view, not of one column
inside it, so SwiftUI keeps a reader's place by the rows on screen. With
NativePHP/mobile-ui#141 (combined/dev-null-app 6e92378), a message
arriving no longer pulls someone reading back down to it, and still
follows someone at the bottom.

Bubbles get a set width, since a column that only hugged its bubble
measured the text on one line and clipped it. HEAD only shows when
something above it was read, as on the web. The thread's own path()
clashed with OpensInTab's and silently stopped View profile and mention
taps. And a devnull too old to send remotes on /me no longer reads as
Remotes turned off.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Start remotes and orgs from the inbox, swipe between its tabs, and swipe to reply

Remotes gets the web's two buttons at the top right, with its icons: New org
(users-round) and New remote (square-pen). New remote finds a developer by
name or handle and opens your conversation with them. New org takes an
optional name and people, up to the web's 100 with you, and opens the new
org. Someone you can't reach shows the web's reason and can't be picked.
Both use the people search and org creation in dev-null-sh/dev-null.sh#734.

Open, Fetched and Stashed are now pages you swipe between, like the Log and
Notifications. The pager's tabs are text only, so Fetched's request count
goes in its label.

Swiping a message sideways replies to it, as the web does on touch screens:
someone else's to the right, your own to the left. The field takes focus.
Any other swipe, such as a flick while scrolling, does nothing.

The typing line now sits above the composer's border, as on the web, so the
Push box is tighter. Stash and Pop in a thread's menu use the web's archive
icons.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Tap a message for React and Reply, and even out the composer

A long press on a message was unreliable, so it's gone. A tap now shows
React and Reply beside the message, with the web's icons (smile-plus and
reply), as the web shows them on hover. Reply sits nearest the bubble. The
row keeps a gutter for them on every message, so they come and go without
moving anything. React opens the reactions sheet, which no longer carries
Reply. A double tap still toggles a heart, and a swipe still replies.

Who's typing moves under the title in the nav bar. The empty typing line
above the composer was part of the bar, so it hid messages before they
reached the bar's border.

The field has the same room above and below, so the bar sits evenly on
the keyboard. The thread now pads its end for the bar alone. mobile-ui's
bottom anchor adds the home indicator while the keyboard is down
(NativePHP/mobile-ui#141, combined/dev-null-app b70ef42). With the keyboard
up there's no longer a big gap above the bar, and a short thread no longer
floats up the screen.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Show React and Reply right beside the tapped bubble, fading in

The buttons sat in a gutter at the edge of the screen, away from short
messages. Now the bubble and a slot for them share a row, so they sit
right against the bubble, after someone else's and before yours. The slot
keeps its width, so a long message wraps short of it either way, and
nothing moves when they appear. An image-only message keeps them beside
its images.

Every message keeps its buttons, faded out and tucked 8 points toward the
bubble. A tap fades them in and slides them into place over 180ms, and
fades out the last message's. Faded out, they take no taps.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
@simonhamp
simonhamp marked this pull request as ready for review October 19, 2026 23:48
@xHeaven
xHeaven merged commit b06d31e into dev-null-sh:production Oct 22, 2026
5 checks passed
@simonhamp
simonhamp deleted the feat/api-remotes-people branch October 22, 2026 04:19
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.

2 participants