Skip to content

Open an organization's screen from a link to it, as the web does - #152

Merged
simonhamp merged 1 commit into
NativePHP:mainfrom
sulimanbenhalim:fix/open-organization-links
Nov 3, 2026
Merged

simonhamp merged 1 commit into
NativePHP:mainfrom
sulimanbenhalim:fix/open-organization-links

Conversation

@sulimanbenhalim

Copy link
Copy Markdown
Contributor

a link to an organization like https://dev-null.sh/@dev-null-sh opens the profile screen and fails with No query results for model [App\Models\User] dev-null-sh since GET /api/v1/users/dev-null-sh is a 404 while GET /api/v1/organizations/dev-null-sh answers
the web doesn't hit it because routes/web.php tries an organization when no user has the handle

a link can't tell a user from an organization so the app does the same now
when the profile screen gets a 404 before devnull has sent it anything for that handle it replaces itself with {tab}/organizations/{handle} in the same tab

  • that covers links in commits and chats and scheduled commits through SiteLink and an organization's name on a notification it sent
  • a profile devnull already sent or whose commits loaded stays put so a thread on it that's gone can't swap it for an organization
  • a handle that's neither like a renamed user lands on the organization screen's own "didn't load here" with its page on the web a tap away instead of the raw model error
  • Show an organization's page with its commits and mentions, as the web does #150 does an organization's name on its commits and this does links so the two don't touch the same files
  • part of Organization support #147

new tests in ProfileTest cover a link and a notification opening the organization screen and a profile staying put when a thread on it is gone
they fail without the fix or without its guards and the full suite passes

Screenshots

the iOS simulator against dev-null.sh opening devnull://log/users/dev-null-sh which is where SiteLink sends https://dev-null.sh/@dev-null-sh

org-link

iOS light iOS dark Android light Android dark
Before
After

Android isn't here since I don't have the app signed in on an emulator against dev-null.sh

  • No visible change

@simonhamp
simonhamp merged commit 5eb218d into NativePHP:main Nov 3, 2026
2 checks passed
@simonhamp

Copy link
Copy Markdown
Member

lovely

@sulimanbenhalim
sulimanbenhalim deleted the fix/open-organization-links branch November 3, 2026 19:51
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