Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
624267e
Put the Remotes composer in one box on a blurred bar
simonhamp Nov 15, 2026
f6c54e2
Move the commit reply bar onto the Remotes composer box
simonhamp Nov 16, 2026
e082ad5
Post as an organization you're in, as the web does
simonhamp Nov 17, 2026
259fc21
Fade the thread out above the composer, drop the box and the fold hint
simonhamp Nov 18, 2026
a24c1f9
Merge feat/remote-composer into feat/commit-screen
simonhamp Nov 18, 2026
a5d112c
Reply with photos and a preview from the bar, and drop any time
simonhamp Nov 18, 2026
1c0beee
Merge feat/remote-composer into feat/commit-screen
simonhamp Nov 18, 2026
ae2b463
Draw the fade in the bar on iOS, where the thread runs under it
simonhamp Nov 18, 2026
07e127d
Draw the reply bar's fade in the bar on iOS, as Remotes does
simonhamp Nov 18, 2026
18652b8
Keep every photo picked at once, however old
simonhamp Nov 18, 2026
1de5fcb
Merge feat/remote-composer into feat/commit-screen
simonhamp Nov 18, 2026
44ac045
Put the composer bar on Liquid Glass on iOS, faded in at the top
simonhamp Nov 18, 2026
365568c
Merge feat/remote-composer into feat/commit-screen
simonhamp Nov 18, 2026
a529a87
Put the reply bar on Liquid Glass on iOS, as Remotes does
simonhamp Nov 18, 2026
9941ce0
Merge feat/commit-screen into feat/post-as-org
simonhamp Nov 18, 2026
cbd3bc4
Line the reply bar's Post as avatar up with the field's text
simonhamp Nov 18, 2026
eaeffdc
Treat an organization's commits as yours when you're a member
simonhamp Nov 18, 2026
6185699
Draw one line above related commits, not the commit's hairline as well
simonhamp Nov 18, 2026
be8e9de
Merge feat/commit-screen into feat/post-as-org
simonhamp Nov 18, 2026
c8f904e
Show avatars in the Post as menu
simonhamp Nov 20, 2026
d5cf93d
Even out the reply bar's spacing and lighten its glass
simonhamp Nov 21, 2026
2f4d5f4
Read an author's replies to themselves as one thread, as the web does
simonhamp Nov 21, 2026
4f0ed67
Use glass/80 for both composer bars and even out the Messages bar
simonhamp Nov 21, 2026
c5180c6
Move the glass/N test guard out of Pest.php
simonhamp Nov 21, 2026
083085a
Merge feat/log-threads (#179) into feat/nested-replies
simonhamp Nov 21, 2026
f03090c
Open every level of replies in place on the commit page, as the web does
simonhamp Nov 21, 2026
a0032d3
Move the commit page to a commit in its tree instead of pushing another
simonhamp Nov 21, 2026
10cca47
Animate the commit page's move to another commit in its tree
simonhamp Nov 21, 2026
5c5d26b
Move the commit page's short hash to the top right of the commit
simonhamp Nov 21, 2026
16f3839
Open the replies of the commits above the commit in place
simonhamp Nov 21, 2026
5fcb78e
Fill the composer sheet with the field, and float mentions over it
simonhamp Nov 21, 2026
12bc35d
Fill the composer sheet with a field that really fills, and place men…
simonhamp Nov 21, 2026
d204792
Fold the replies of the commits above the commit on every move
simonhamp Nov 21, 2026
056deb8
Hold the mention suggestions to six rows and scroll the rest
simonhamp Nov 21, 2026
3156778
Shorten the sheet's field to make room for mentions under the caret
simonhamp Nov 21, 2026
f9832b5
Let a caller that scrolls the mention list itself turn off its inner …
simonhamp Nov 21, 2026
75cb547
Ask the sheet's mention list not to scroll inside its own scroll view
simonhamp Nov 21, 2026
35539b3
Show the handle under the name in the Post as menu
simonhamp Nov 21, 2026
1d72a77
Set the Post as handle with core's NavAction::subtitle()
simonhamp Nov 21, 2026
de4235b
Blur what scrolls under the composer bars with iOS 26's scroll edge e…
simonhamp Nov 22, 2026
89bff8d
Count the replies of the commits above from their own pages
simonhamp Nov 22, 2026
f3e4adb
Keep the asked-for ancestor counts with the ancestors
simonhamp Nov 22, 2026
65bd2ce
Put the composer back in a glass box over the edge blur
simonhamp Nov 22, 2026
e4b24f4
Leave a gap under the mention list on iOS
simonhamp Nov 22, 2026
a0ea9bc
Leave a gap under the Replying to card in Remotes on iOS
simonhamp Nov 22, 2026
820a175
Suggest every matching org member in Remotes, scrolling past six
simonhamp Nov 22, 2026
b5ecbf7
Tidy a blank line left by the last commit
simonhamp Nov 22, 2026
3b582bb
Scroll to a reply you just sent on a commit page
simonhamp Nov 22, 2026
942a74c
Draw the hairline under replies that another commit follows
simonhamp Nov 22, 2026
59988ed
Keep a quoted commit clear of the composer sheet's toolbar
simonhamp Nov 22, 2026
52e4541
Open every level of replies in place on the commit page, and move the…
simonhamp Nov 23, 2026
0109aab
Even out the composer bars' spacing and lighten their glass (#194)
simonhamp Nov 23, 2026
c0858d0
Show an author's replies to themselves as one thread, as the web does…
simonhamp Nov 23, 2026
bda3d71
Merge pull request #192 from NativePHP/feat/post-as-avatars
simonhamp Nov 24, 2026
2def9bf
Merge pull request #182 from NativePHP/feat/post-as-org
simonhamp Nov 24, 2026
2dc3b99
Commit screen: photos and preview in the reply bar, drop any time, re…
simonhamp Nov 24, 2026
a58df59
Merge main into feat/remote-composer
simonhamp Nov 24, 2026
42dd4d4
Merge main into feat/remote-composer
simonhamp Nov 24, 2026
d122e60
Update dependencies to pick up the merged core changes
simonhamp Nov 24, 2026
d00d008
Blur what scrolls under the composer bars with iOS 26's scroll edge e…
simonhamp Nov 24, 2026
2220b4d
Merge feat/remote-composer into fix/composer-fill-sheet
simonhamp Nov 24, 2026
5f19776
Drop the mobile-ui#227 test guard now the lock has it
simonhamp Nov 24, 2026
ab4dca5
Put the draft stash comment back on updatedSheetBody()
simonhamp Nov 24, 2026
07b784f
Fill the composer sheet with the field, and float mentions over it (#…
simonhamp Nov 25, 2026
3615c61
Merge main into feat/remote-composer
simonhamp Nov 25, 2026
16c16a9
Merge pull request #200 from NativePHP/feat/post-as-subtitle
simonhamp Nov 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 39 additions & 3 deletions app/Devnull/Account.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ final class Account

private const string TermsKey = 'devnull.terms-to-accept';

private const string OrganizationsKey = 'devnull.organizations';

private const string GuildsKey = 'devnull.guilds-available';

/**
Expand Down Expand Up @@ -259,9 +261,42 @@ public function rememberTermsToAccept(?string $version): void
}

/**
* Signs this phone out: who it was, the badges, its pastéis and Remotes, whether it has guilds and shows their
* tab, your timezone, the terms you owe, every answer, image and voice note kept for a quick start, and your unsent
* drafts and recordings. Signing out leaves the tabs for onboarding, so the next account's tabs are decided afresh.
* The GitHub organizations you can post as, as devnull last said, oldest membership first. None until it has.
*
* @return list<User>
*/
public function organizations(): array
{
$kept = Cache::get(self::OrganizationsKey);

return is_array($kept) ? array_values(array_map(User::fromArray(...), array_filter($kept, is_array(...)))) : [];
}

/**
* Which commits are yours: your own and your organizations' (see Ownership).
*/
public function ownership(): Ownership
{
return Ownership::of($this->user(), $this->organizations());
}

/**
* Remembers the organizations you can post as. With null, from a devnull too old to say, it keeps what it had.
*
* @param list<User>|null $organizations
*/
public function rememberOrganizations(?array $organizations): void
{
if ($organizations !== null) {
Cache::forever(self::OrganizationsKey, array_map(fn (User $organization): array => $organization->toArray(), $organizations));
}
}

/**
* Signs this phone out: who it was, the badges, its pastéis and Remotes, your organizations, whether it has guilds
* and shows their tab, your timezone, the terms you owe, every answer, image and voice note kept for a quick start,
* and your unsent drafts and recordings. Signing out leaves the tabs for onboarding, so the next account's tabs are
* decided afresh.
*/
public function forget(): void
{
Expand All @@ -280,6 +315,7 @@ public function forget(): void
Cache::forget(self::TimezoneKey);
Cache::forget(self::GuildsKey);
Cache::forget(self::TermsKey);
Cache::forget(self::OrganizationsKey);
self::forgetGuildsTabShown();
}
}
29 changes: 17 additions & 12 deletions app/Devnull/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -303,14 +303,16 @@ public function replies(string $id, ?string $cursor = null): Page
/**
* Commits, as a reply to $parentId or quoting $quotedCommitId, as the web's
* composer, reply box and Quote do. devnull takes one or the other, not both.
* A new commit or a quote may start a poll (see PollDraft::payload()).
* A new commit can go straight to a guild's board ($guildHandle).
* A new commit or a quote may start a poll (see PollDraft::payload()). With
* $author, the handle of an organization you're a member of, it goes out as
* that organization, as the web's Post as picks (see PostAs). A new commit
* can go straight to a guild's board ($guildHandle).
*
* @param array{options: list<string>, duration: int}|null $poll
*/
public function createCommit(string $body, ?string $parentId = null, ?string $quotedCommitId = null, ?array $poll = null, ?string $guildHandle = null): Commit
public function createCommit(string $body, ?string $parentId = null, ?string $quotedCommitId = null, ?array $poll = null, ?string $author = null, ?string $guildHandle = null): Commit
{
$commit = $this->data($this->send('POST', 'commits', payload: self::commitPayload($body, $parentId, $quotedCommitId, $poll, $guildHandle)));
$commit = $this->data($this->send('POST', 'commits', payload: self::commitPayload($body, $parentId, $quotedCommitId, $poll, $author, $guildHandle)));
$this->cache->commitAdded($commit);

return Commit::fromArray($commit);
Expand All @@ -322,9 +324,9 @@ public function createCommit(string $body, ?string $parentId = null, ?string $qu
*
* @param array{options: list<string>, duration: int}|null $poll
*/
public function signedCommit(string $body, ?string $parentId = null, ?string $quotedCommitId = null, ?array $poll = null, ?string $guildHandle = null): SignedRequest
public function signedCommit(string $body, ?string $parentId = null, ?string $quotedCommitId = null, ?array $poll = null, ?string $author = null, ?string $guildHandle = null): SignedRequest
{
return $this->signedWrite('POST', 'commits', self::commitPayload($body, $parentId, $quotedCommitId, $poll, $guildHandle));
return $this->signedWrite('POST', 'commits', self::commitPayload($body, $parentId, $quotedCommitId, $poll, $author, $guildHandle));
}

/**
Expand All @@ -334,9 +336,9 @@ public function signedCommit(string $body, ?string $parentId = null, ?string $qu
*
* @param list<DraftImage> $images
*/
public function signedCommitWithImages(string $body, array $images, ?string $parentId = null, ?string $quotedCommitId = null, ?string $guildHandle = null): SignedRequest
public function signedCommitWithImages(string $body, array $images, ?string $parentId = null, ?string $quotedCommitId = null, ?string $author = null, ?string $guildHandle = null): SignedRequest
{
return $this->signedWithImages('commits', self::commitPayload($body, $parentId, $quotedCommitId, guildHandle: $guildHandle), $images);
return $this->signedWithImages('commits', self::commitPayload($body, $parentId, $quotedCommitId, author: $author, guildHandle: $guildHandle), $images);
}

/**
Expand All @@ -363,14 +365,16 @@ public function signedMessage(string $threadPath, string $body, string $clientId
* Signs a commit to be submitted at $at, as the web's Schedule commit
* does, for the background to send. Only you see it until then. With
* photos it goes as multipart, as a commit with photos does, and a poll
* goes in its JSON. One for a guild's board says which ($guildHandle).
* goes in its JSON. With $author it goes out as that organization when it's
* due, as long as you're still in it then. One for a guild's board says
* which ($guildHandle).
*
* @param list<DraftImage> $images
* @param array<string, mixed>|null $poll
*/
public function signedScheduledCommit(string $body, CarbonInterface $at, array $images = [], ?array $poll = null, ?string $guildHandle = null): SignedRequest
public function signedScheduledCommit(string $body, CarbonInterface $at, array $images = [], ?array $poll = null, ?string $author = null, ?string $guildHandle = null): SignedRequest
{
$payload = array_filter(['body' => $body, 'scheduled_at' => self::scheduleTime($at), 'poll' => $poll, 'guild_handle' => $guildHandle], fn (mixed $value): bool => $value !== null);
$payload = array_filter(['body' => $body, 'scheduled_at' => self::scheduleTime($at), 'poll' => $poll, 'author' => $author, 'guild_handle' => $guildHandle], fn (mixed $value): bool => $value !== null);

return $images === []
? $this->signedWrite('POST', self::ScheduledCommitsPath, $payload)
Expand Down Expand Up @@ -1006,13 +1010,14 @@ private function send(string $method, string $path, array $query = [], ?array $p
* @param array{options: list<string>, duration: int}|null $poll
* @return array<string, mixed>
*/
private static function commitPayload(string $body, ?string $parentId, ?string $quotedCommitId, ?array $poll = null, ?string $guildHandle = null): array
private static function commitPayload(string $body, ?string $parentId, ?string $quotedCommitId, ?array $poll = null, ?string $author = null, ?string $guildHandle = null): array
{
return array_filter([
'body' => $body,
'parent_id' => $parentId,
'quoted_commit_id' => $quotedCommitId,
'poll' => $poll,
'author' => $author,
'guild_handle' => $guildHandle,
], fn (mixed $value): bool => $value !== null);
}
Expand Down
15 changes: 8 additions & 7 deletions app/Devnull/CommitMenu.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace App\Devnull;

use App\Devnull\Data\Commit;
use App\Devnull\Data\User;
use App\Icons\Lucide;
use Native\Mobile\Edge\Elements\TopBarAction;
use Native\Mobile\Edge\Layouts\Builders\NavAction;
Expand All @@ -14,26 +13,28 @@
* Unpin from profile on your own published commit, not a reply nor one posted
* in a guild, which devnull won't pin to a profile; then, after a
* divider, Report commit on someone else's published commit, or Delete commit
* on your own. Each item names the commit, so a tap never rebuilds anything
* from an attribute (see ShowsCommits).
* on yours. An organization's commit is yours while you're a member, whoever
* posted it (see Ownership), so every member gets Delete, as on the web. Only
* a person has a profile to pin to, so it never gets Pin. Each item names the
* commit, so a tap never rebuilds anything from an attribute (see ShowsCommits).
*/
final class CommitMenu
{
/**
* @return list<TopBarAction|NavAction>
*/
public static function items(Commit $commit, ?User $viewer): array
public static function items(Commit $commit, Ownership $ownership): array
{
$isOwn = $viewer !== null && $commit->author->id === $viewer->id;
$isOwn = $ownership->owns($commit);
$items = [];

$items[] = self::item($commit, 'share', 'Share link', Lucide::Link, 'shareCommit');

if ($isOwn && $commit->isApproved() && $commit->parentId === null && $commit->guild === null) {
if ($ownership->isYourOwn($commit) && $commit->isApproved() && $commit->parentId === null && $commit->guild === null) {
$items[] = self::item($commit, 'pin', $commit->isPinned ? 'Unpin from profile' : 'Pin to profile', Lucide::Pin, 'togglePin');
}

if ($viewer !== null && ! $isOwn && $commit->isApproved()) {
if ($ownership->isSignedIn() && ! $isOwn && $commit->isApproved()) {
$items[] = NavAction::divider();
$items[] = self::item($commit, 'report', 'Report commit', Lucide::Flag, 'reportCommit');
} elseif ($isOwn) {
Expand Down
14 changes: 14 additions & 0 deletions app/Devnull/ComposerMenu.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,20 @@ public static function items(bool $photosFull, bool $voiceNotesGoAlone, string $
];
}

/**
* What the photo button in the reply bar on a commit's page opens: the photo library, or the camera, as the
* composer sheet's two photo buttons do.
*
* @return list<TopBarAction>
*/
public static function photoItems(): array
{
return [
self::item('reply-pick-photos', 'Choose photos', Lucide::ImagePlus, 'pickPhotos'),
self::item('reply-take-photo', 'Take a photo', Lucide::Camera, 'takePhoto'),
];
}

private static function item(string $ref, string $label, Lucide $icon, string $method, bool $disabled = false): TopBarAction
{
return NavAction::make($ref)
Expand Down
151 changes: 151 additions & 0 deletions app/Devnull/ComposerSheet.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
<?php

namespace App\Devnull;

use Native\Mobile\UI\Caret;

/**
* Where the composer sheet (partials/commit-sheet) puts its mention list, and how tall its field is meanwhile.
*
* The field fills the space between the author row and what's under it by itself (`h-full`). The list floats just
* under the line the caret is on, which the field reports (`@caretChange`, see OpensCommitSheet::sheetCaretMoved()),
* as tall as its rows, up to six of them. When there isn't room for that under the caret, the field gets shorter
* instead, just tall enough to end on the caret's line (it scrolls its text to keep the caret in view), and the list
* goes in the room that frees, under the field. Once the list is gone, the field fills again.
*
* Everything is in points from the top of the sheet's body area, whose top is the field slot's top: the slot's
* padding, then the field.
*/
final class ComposerSheet
{
/** The field slot's padding above the field (pt-3). */
public const int FieldTop = 12;

/** The least the field shows, on a phone short enough that the rest leaves it little room. */
public const int MinFieldLines = 2;

/**
* The mention list's rows, and how many show before the rest scroll inside it. The same as the lists by the other
* fields (see Display), whose row height partials/mention-suggestions draws.
*/
public const int MentionRowHeight = Display::MentionRowHeight;

public const int MentionRowsShown = Display::MentionRowsShown;

/** The list's own padding above and under its rows (py-1), and its heading's height (one line of text-xs, py-1). */
public const int MentionPadding = 8;

public const int MentionHeadingHeight = 24;

/** How far under the caret's line (or the field) the mention list starts, and stops above the toolbar. */
public const int MentionGap = 4;

public const int MentionInset = 8;

/**
* Before the field has said where its caret is (it says so as soon as it has focus, so only for a moment), the
* list goes under about one line, and a line is taken to be this tall.
*/
public const int FirstLineHeight = 24;

/**
* The caret as the sheet keeps it, as the field shows it at its full height: the bottom of its line, the line's
* height, and the field's visible height, in points. A caret the field has scrolled out of view is kept to its
* edges.
*
* @return array{bottom: float, line_height: float, field_height: float}
*/
public static function caret(Caret $caret): array
{
$field = max(0.0, $caret->fieldHeight);
$bottom = max(0.0, $caret->bottom());

return [
'bottom' => $field > 0 ? min($bottom, $field) : $bottom,
'line_height' => max(0.0, $caret->height),
'field_height' => $field,
];
}

/**
* The caret to keep after the field reports a new one. While the field is shorter for the list, it reports
* itself at that height, scrolled to the caret, which says nothing about where the caret is at its full height,
* so the sheet keeps what it had. Any other report is the field at its full height.
*
* @param array{bottom: float, line_height: float, field_height: float}|null $kept
* @param int|null $shortened how tall the sheet has made the field, or null when it fills
* @return array{bottom: float, line_height: float, field_height: float}
*/
public static function reported(Caret $caret, ?array $kept, ?int $shortened): array
{
if ($kept !== null && $shortened !== null && abs($caret->fieldHeight - $shortened) <= 1) {
return $kept;
}

return self::caret($caret);
}

/** The mention list's height with all its rows showing, up to six: its padding, its heading, then its rows. */
public static function mentionHeight(int $rows, bool $heading = false): int
{
return self::MentionPadding
+ ($heading ? self::MentionHeadingHeight : 0)
+ min(max($rows, 1), self::MentionRowsShown) * self::MentionRowHeight;
}

/**
* Where the mention list goes, and how tall the field is while it shows.
*
* - `field`: the field's height, or null when it fills as usual.
* - `top`: the list's top.
* - `height`: the list's height, or null when it runs down to the toolbar.
*
* With room for the whole list (up to six rows) between the caret's line and the field's bottom, it floats there
* over the field and nothing moves. Without it, the field ends on the caret's line, shortened by as much as the
* list needs but never under two lines, and the list starts under it and runs to the toolbar, over anything
* under the field (which comes up with the field's bottom). So the list never covers the caret's line.
*
* The room is measured to the field's bottom, since nothing reports how tall what's under it is.
*
* @param array{bottom: float, line_height: float, field_height: float}|null $caret
* @return array{field: int|null, top: int, height: int|null}
*/
public static function mentionLayout(?array $caret, int $rows, bool $heading = false): array
{
if ($caret === null || $caret['field_height'] <= 0) {
$line = $caret === null ? self::FirstLineHeight : (int) ceil($caret['bottom']);

return ['field' => null, 'top' => self::FieldTop + $line + self::MentionGap, 'height' => null];
}

$list = self::mentionHeight($rows, $heading);
$field = (int) floor($caret['field_height']);
$bottom = (int) ceil($caret['bottom']);
$room = $field - $bottom - self::MentionGap - self::MentionInset;

if ($room >= $list) {
return ['field' => null, 'top' => self::FieldTop + $bottom + self::MentionGap, 'height' => $list];
}

$line = $caret['line_height'] > 0 ? (int) ceil($caret['line_height']) : self::FirstLineHeight;
$shortened = max(self::MinFieldLines * $line, $field - self::MentionGap - self::MentionInset - $list);

if ($shortened >= $bottom) {
// The caret is in the field's first lines already: shortening it frees nothing, so the list takes what
// room there is under the caret, at least a row.
return [
'field' => null,
'top' => self::FieldTop + $bottom + self::MentionGap,
'height' => max($room, self::MentionPadding + self::MentionRowHeight),
];
}

return ['field' => $shortened, 'top' => self::FieldTop + $shortened + self::MentionGap, 'height' => null];
}

/** Whether the sheet's mention list has the "People you follow" heading: a bare "@" in a new commit. */
public static function mentionHeading(?array $mention, string $view): bool
{
return ($mention['query'] ?? null) === '' && $view === 'compose';
}
}
Loading
Loading