Skip to content

[Guilds 05] Open a guild from its hashtag in a commit or message - #211

Draft
shanesmithdev wants to merge 2 commits into
NativePHP:mainfrom
shanesmithdev:guilds-05
Draft

shanesmithdev wants to merge 2 commits into
NativePHP:mainfrom
shanesmithdev:guilds-05

Conversation

@shanesmithdev

@shanesmithdev shanesmithdev commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Status: Pending #210 (Guilds 04) being merged first.

This builds on #210, so until that merges this PR also shows its commit. Only the last commit, "Open a guild from its hashtag in a commit or message", is new here. It uses the guild mentions dev-null.sh now sends with every commit and message, which are merged and live.

Important

The coloured text is a temporary approach, standing in for each guild's icon. The web shows a guild's icon beside its name. The app can't yet.

Once mobile-ui can put images inside text (Text(Image) or a text attachment on iOS, InlineTextContent on Android), we can show the icon instead. I need to submit a PR for mobile-ui for that.

What's in this PR?

  • A hashtag that names a guild opens the guild, instead of a search for it, as on the web. Any other hashtag still searches.

    • A commit posted in a guild treats that guild's own hashtag the same way, as the web does
    • It works in the Log, profiles, guild boards, commit pages, reply previews, scheduled commits and Remotes messages. Quoted commits are drawn as plain text, so their hashtags aren't tappable, as before
    • The composer's preview keeps hashtags as plain text, as before
  • In a commit, a guild's hashtag shows as a chip with the guild's name, in mono on a soft background, like the web's guild mention.

    • Each guild's name has its own colour, picked from its handle, so a guild always looks the same
    • The web's pill shows the guild's icon, but a commit's text can't hold images yet, so the icon is left out for now
    • Text can't take rounded corners or padding either, so a thin space at each end stands in for padding
  • In a Remotes message, a guild's name is mono in the bubble's link colour, without the background, as inline code is there. A guild's own colour could match the colour of your bubble.

Testing

Pest tests cover:

  • a guild hashtag in a commit showing the guild's name in its colour and opening the guild, matched whatever its case, beside a hashtag that still searches;
  • a commit's own guild hashtag, with no guild mentions sent, and devnull's name winning when the commit only knows that guild's handle;
  • a guild hashtag in a Remotes message;
  • each guild's colour staying the same for its handle, whatever its case.

Locally, the full suite passes. Checked by hand on an iPhone 17 Pro simulator and an Android phone.

Independent review

A fresh reviewer, who hadn't seen the work being built, read this commit. It found one bug, now fixed:

  • A commit's own guild could hide its real name. When a commit arrived with only its guild's handle, the app stood in a placeholder named #rust, which replaced the real name devnull sent in its guild mentions, so the chip read "#rust" instead of "Rustaceans". devnull's name now wins, and a test covers it.

And a few smaller points:

  • A commit you've just posted to a guild shows its own hashtag as a search link until devnull has it, then as a chip.
  • Tests could cover more: scheduled commits, a folded preview, a reply in a thread, the chip's background colour, and the composer preview staying plain.
  • Opening a guild doesn't URL-encode its handle. That's how it already worked from the directory and the "posted in" pill. It only matters if devnull ever allows handles outside plain letters, digits and underscores.

It also checked that a handle can't break out of the tap's attribute, that hashtags in code, links, quotes and cut-off previews behave, case handling, that every screen drawing these bodies can open a guild, and the project's theme and font rules, and found them fine.

Screenshots

guild-hashtag

Notice the four hashtags under the note, now each guild's name in its own colour.

iOS light iOS dark Android light Android dark
Before
After

The guild page's header now has Join or Leave beside the icon, as a
profile has Follow, with Commit (posting to the board) where Remote
sits. Share stays alone in the top bar. Joining or leaving changes the
button and the member count at once, puts them back if devnull refuses,
and unmutes a guild you join, as devnull does.

Tapping the member count opens the guild's members, as the web lists
them: avatar, name, handle and bio, with "(moderator)" on the
moderator's row while they're a member, and no Follow buttons.
A hashtag that names a guild now opens the guild instead of a search.
Any non-guild hashtag still opens search instead.

In a commit it shows as a chip: the guild's name in medium mono on a
wash, in a colour picked from its handle. The guild's icon can't sit
in text yet, so it's left out for now. In a Remotes message the name
keeps the bubble's link colour, which a guild's colour could clash with.
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