Skip to content

Open every level of replies in place on the commit page, and move the page within its tree - #196

Draft
simonhamp wants to merge 18 commits into
feat/self-threadsfrom
feat/nested-replies
Draft

simonhamp wants to merge 18 commits into
feat/self-threadsfrom
feat/nested-replies

Conversation

@simonhamp

@simonhamp simonhamp commented Nov 21, 2026 •

Copy link
Copy Markdown
Member

Changes to the commit page, one commit each.

f03090c: a reply's "N replies" used to open that reply's own page, so going deeper meant pushing screen after screen. Now it opens the replies under it in place, and theirs under them, as deep as they go. This is what the web's commit page does.

a0032d3: tapping a commit that's already in the page's tree (an ancestor, a series or self-thread part, a reply at any depth) moves the same page to it instead of pushing another commit screen. Commits outside the tree, profiles and links still push.

Merge order: this is based on #195 (feat/self-threads) and has #179 (feat/log-threads) merged in. It reuses #179's ExpandsThreads and ThreadRows, and #179 and #195 conflict, so the branch carries a merge commit (083085a) resolved the same way as the phone build (2c46223), with its thread test fixtures. Merge #179 and #195 first; then this diff shrinks to this PR's own commits.

How the web does it

From resources/js/components/commit-thread.tsx on production:

  • maxIndentDepth = 3. The commit's replies are depth 1 and sit under the commit's text. Depth 2 and 3 each step in one indent.
  • Replies at depth 4 and deeper stay in the depth 3 column. They get no elbow or line, and a "↳ replying to @handle" line (or "quoting") under the name.
  • Every reply has its own toggle, so any level opens in place. "Show more" past the cap reads "Show N more to @handle".
  • A reply that its author carried on as a self-thread leaves the continuation out of its replies and shows "Show thread", which opens its page.

What changed

  • ThreadRows::under() is recursive now. It caps the indent at the web's depth (MaxIndentDepth) and takes how deep replies open in place (opensInPlace). The commit page passes no limit. The Log still passes 1, so on the Log a reply's replies still open its page. That's one argument to change if you want the Log to go deeper too.
  • The commit page uses ExpandsThreads for replies of replies. It replaces the page's own one-level mechanism for a deleted reply's replies (tombstoneReplies, toggleTombstone), which is gone.
  • Rail drawing follows the existing style: an elbow for the first reply and a link from avatar to avatar after that, with lines from further up carried past as $spines (this was a single $spine). At the third step each reply hangs on its own elbow off the line of the reply it answers, like the web. A line from avatar to avatar would otherwise run through the flattened replies lined up under it.
  • "Show more" on the commit page is now a row of its own, as on the Log, rather than tucked into the last reply. The inline thread-more partial is deleted.
  • Related commits, and the series or thread parts below the commit, keep their old "N replies" button, which moves the page to them. The commits above the commit open theirs in place (16f3839, below).

Moving the page within the tree (a0032d3)

  • The tapped commit becomes the one the page is about. Its ancestors come from the tree above it and its replies come from what's already loaded (opened in place, read for the self-thread, or kept in the cache). So nothing goes blank, and devnull is asked for the rest behind it.
  • The commits above the one the page moves to start with their replies folded, showing only their "N replies" (d204792, below). Moving up, the commit the page moves to shows its replies, and the commit it was on and the ones in between open their kept replies under it, so you can still see where you came from.
  • Reply on a commit in the tree moves the page to it too, with the reply bar answering it.
  • Back still pops the whole screen, as you asked. There's no history of the commits the page moved through. The web does a full page visit for each commit, so there it's browser history, which we're not copying.
  • Deleting a commit the page moved to takes the page back to its parent. Deleting the commit the page opened on still leaves the screen.
  • The rows are now direct children of the scroll view, which lets auto-scroll-to bring the commit into view, with all its ancestors shown above it.

Animating the move (10cca47)

This needs NativePHP/mobile-air#736 and NativePHP/mobile-ui#225. Without them the app still works, but the move jumps and going back to a row the page already went to doesn't scroll.

  • The scroll view has animate-layout, so rows the page keeps slide to their new places and rows it adds or drops fade. It also has auto-scroll-animated, so the first move animates as well.
  • The focused commit is keyed commit-<id>, the same as the commits above it, so moving up the tree slides that row into place. A reply that becomes the focused commit is still a different row (thread-reply-<id> before, commit-<id> after), so that one fades across.
  • Going back to the top twice used to mount the scroll view again to make it scroll. It now passes $scrollRequest as auto-scroll-token, which goes up on every move. Remounting would have made every row new and spoiled the animation.
  • Vendor patches for a phone build are in storage/app/patches/ (mobile-air-736-layout-animation.patch, mobile-ui-225-layout-animation.patch).

Replies of the commits above (16f3839)

  • The commits above the one the page is on keep their "N replies" button, and it opens their replies in place under them, as the commit's and every reply's do. Their replies' replies open in place too.
  • The reply on the line down to the commit is left out of that list and of its count, since it already shows right below. So a commit above with only that reply has no button. The web doesn't do this: it only leaves out the part of a self-thread that carries the thread on, so there the rest of the line would show twice.
  • Closing a commit's replies used to close every thread opened inside it. For a commit above, that would have closed the replies of the commits on the line too, so ExpandsThreads now skips any reply the screen draws as its own row (drawsOnItsOwn, only overridden on the commit page).
  • Opening or closing them after a move leaves the scroll target alone, so the page doesn't jump back to the commit.

Folded replies above the commit (d204792)

You asked for the commits above to show their replies behind the button, folded, when you're on a reply. Before this, moving down to a reply kept the replies of the commit you left open under it, and any you'd opened on a commit above stayed open.

  • Every move now folds the replies of every commit above the new one, including the one the page was on when it moves down. Opening the page on a reply already started folded.
  • Moving up is unchanged for the commit you move to: its replies show, with the way back down opened under it. The commits above it fold like on any move.
  • The reply on the line down is still left out of each commit's list and count.
  • The scroll target after a move is the number of commits above again, since nothing is open above the commit then.
  • Moving back up to a commit takes its replies from the cache now, because folding drops what the page held for it. Only the first page comes back that way. Later pages load again with "Show more".

Counts for the commits above (89bff8d)

On a phone the commits above only showed their "N replies" if the page had moved through them before. devnull sends a commit page's ancestors without replies_count (CommitAncestorsQuery doesn't load the counts), and the button counted on it.

  • Each commit above that shows now takes its count from its own page, GET /commits/{id}, which does have it. A kept copy shows at once and a fresh one is asked for behind, once per refresh of the page. "↑ N earlier commits" asks for the ones it opens.
  • That's one extra request per commit above that shows, usually just the parent. It also keeps that commit's page, so tapping it moves there with nothing blank.
  • Deleted commits above are skipped. They never show the button.
  • This doesn't wait on feat: tell API clients which reply continues a commit as its author's thread dev-null-sh/dev-null.sh#1656. If devnull starts sending the count with the ancestors, the extra request just agrees with it.
  • f3e4adb only moves the new property so it merges cleanly with the phone build.

Six mentions at most (056deb8)

The reply bar's @mention suggestions could grow tall enough to push the field and the bar's buttons under the keyboard. devnull's search sends people and organizations with no limit the app sets.

  • Past six rows, partials/mention-suggestions puts the rows in a scroll view six rows tall (Display::MentionRowsShown times Display::MentionRowHeight, 6 x 44). Each row is then exactly 44 so six fill it. Six or fewer draw as before, as tall as their rows.
  • The scroll view is inside the suggestions column, inside the slot, so the field's row never moves among its siblings.
  • The Messages composer and the commit sheet use the same partial, so they get the cap too. Messages only suggests an org's members, ranked and already cut to six, so it never reaches the scroll view.
  • A caller that scrolls the list itself passes 'scrolls' => false (f9832b5), and the rows draw as tall as they are with no scroll view inside. It defaults to true. Fill the composer sheet with the field, and float mentions over it #198's sheet sizes and scrolls its own list and passes it, so once both merge a short phone doesn't show two scroll bars there.
  • Display::replyBarClearance doesn't count the suggestions, and didn't before. They only show while you type a handle, and the cap now bounds how far they can lift the bar.

Hash at the top right (5c5d26b)

The focused commit's short hash moved from under its text to the end of the name, handle and time row, pushed right by a spacer. Same size and ink, and still plain text as before. No other row on the page shows a hash, so nothing else moved.

Scrolling to a reply you sent (3b582bb)

Sending a reply from the bar or the composer sheet scrolls the page to the staged reply, animated. auto-scroll-to counts the scroll view's direct children, so CommitDetail::pageRows() now lists the rows from the top down to the end of the thread (earlier commits, each commit, the replies opened in place under it, "Show more"), and the view draws exactly that list instead of building it inline. scrollToRow() looks the staged reply up in the same list, so the index can't drift from what is drawn. The send already opens the replies, and staged replies sit before "Show more", so the row is always there.

When devnull's reply takes the staged one's place it is on the same row, so the target and token stay as they were and the page doesn't move again. The exception is a reply to your own commit, which becomes the next part of your thread below "Show more"; the page follows it there with a new token.

The scroll view brings a row to the top. A reply near the end can't go that high, so the page stops at its foot, and the reply bar clearance row keeps the reply above the bar and keyboard. A reply with plenty below it (related commits, say) lands at the top instead, which is fine. I didn't add any offset for the bar.

A line under replies with a commit after them (942a74c)

A commit row gives up its hairline when its replies open under it, and on the commit page the last reply never drew one. So the replies of a commit above ran straight into the next commit with no line between them. Same under the focused commit when later parts of its series follow.

ThreadRows::under() takes a hairline flag now. The replies of a commit above always end on the line, and the commit's own replies do when another commit row follows them. Replies at the foot of the page still end without one.

Watch for

  • The new $spines and the third-level elbows, and the replies opened under a commit above, have only been checked through the rendered tree in tests, not on a device. The x positions are 31.5 (rail), 75.5 and 107.5 (reply lines).
  • The mention scroll view sits in the bar above the keyboard, and iOS scroll views here dismiss the keyboard interactively. Scrolling the list shouldn't drag into the keyboard, but it's worth a try on a phone.
  • RowCacheScreensTest now expects one fewer rebuilt row when a page of replies arrives, because the last reply no longer carries "Show more".

Tests

php -d auto_prepend_file= vendor/bin/pest: 1996 passed, 1 skipped on current vendor. Before 16f3839 it was 1984 passed with the two vendor patches applied (in a scratch copy); that wasn't rerun. New: tests/Unit/Devnull/ThreadRowsTest.php (indent cap, flattened rows, third-level elbows and lines, open-in-place depth) and tests/Feature/Screens/NestedRepliesTest.php (opening five levels in place without navigating, closing a middle level, the indents and "replying to" labels, moving the page within the tree and back up, Reply retargeting the bar, commits outside the tree still pushing). Tests that expected a tap in the tree to push now expect the page to move. 10cca47 adds two to NestedRepliesTest: the focused row and the scroll view keep their node ids across a move, and the scroll view gets the new props with a fresh token when it goes back to a row it went to before (skips until vendor has #736, see Tests\Support\LayoutAnimation). 16f3839 adds three more: a commit above opening its other replies without the one on the way down, the scroll target after a move counting them, and closing a commit's replies above leaving the line's open. The hash test now checks it ends the name row. d204792 replaces two of 16f3839's tests and adds two: moving down folds the commits above (the commit left and one opened by hand), moving back up opens them again, and opening on a reply starts folded. 056deb8 adds two to CommitMentionsTest: eight suggestions scroll in a list six rows tall with the bar's slots in place, and six don't scroll. f9832b5 adds MentionSuggestionsTest, which renders the partial on its own through a test component and view (tests/Fixtures/views): eight rows scroll by default, and with 'scrolls' => false all eight draw with no scroll view. 89bff8d adds one to NestedRepliesTest with ancestors shaped like the API's, without counts and never opened before: the parent shows "2 replies" folded and opens them, and an earlier commit gets its count once "↑ N earlier commits" shows it. CommitDetailCacheTest now expects four requests on open, the fourth being the parent's own page. 3b582bb adds ScrollToReplyTest: sending from the bar and from the sheet, under ancestors, past ten replies and with a reply's own replies open, points the scroll view at the staged reply under a new token, and devnull's reply landing doesn't bump it. A reply to your own commit that carries your thread on is followed to its new row. 942a74c adds hairline checks to NestedRepliesTest (under a commit above's replies, moving down as deeper replies open, none at the foot) and SeriesTest (under the focused part's replies when later parts follow).

Screenshots

No device build for this one, so there are no screenshots yet. It does change what the commit page draws.

  • No visible change

🤖 Generated with Claude Code

simonhamp and others added 6 commits November 16, 2026 00:23
…ith the actions

Replies no longer show under a commit in a feed. The replies button moves
to its own line under the action row and opens the thread in place, ten
replies at a time, with Show more for the next ten. A reply has the same
button under its own actions, which opens its replies inline one step in.
Deeper than that, the button opens the reply's page.

devnull's API sends 50 replies a page whatever `limit` asks for, so the
app keeps what it was sent and shows ten at a time, asking for the next
page only once they all show.

The end dot of a commit's rail is now drawn inside its action row, so it
sits level with the actions whatever is above or below them. It used to
be placed a fixed distance from the row's bottom, which assumed the action
row's -my-[6] pulled it in. iOS does that, Android keeps the space and only
moves the drawing, and a row with a thread under it had no bottom padding,
so the dot sat above the actions in some rows and below in others. The
action row now has no vertical negative margins, and the rail's lines are
worked out from the fixed heights under it to meet the dot.

Opening and closing a thread fades its rows in and out, and the chevron
turns. Starring a commit pops the star as the web's star-pop does, and
giving a pastel bumps it as the web's pastel button does. EDGE only animates
from one frame to the next, so each step is a frame drawn when a short
background Beat comes back.

Quote now has its label beside its icon, as Reply always does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On the Log, opening or closing a commit's replies dropped or added the 7pt
under its replies line, where the hairline sits. When the commit's top was
off screen, the iPhone's list held the row below still instead, so the
commit's photo jumped by 7pt.

The row now keeps that padding, the hairline's 1pt included, with its
replies open, and only the hairline goes. The first reply takes the 7pt
off its own top, so the thread looks the same, and the elbow and the
lines beside a reply are placed from its avatar. The commit page is left
as it was: it's a scroll view, which holds its top.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e Log

The replies button's chevron only turned in feeds, where the replies open
in place. A commit page opens its commit's replies in place too, but there
the chevron kept pointing right with "Hide replies" beside it. It now
turns down there as well, over the same 220ms, and carries the animation
while shut so iOS animates the first turn. A reply's button on a commit
page still opens its page, so its chevron stays put.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Nested replies on the commit page reuse #179's ExpandsThreads and
ThreadRows, so this branch carries #179 on top of #195. Conflicts are
resolved as on the phone build (2c46223): #195's Show thread and
self-thread filtering sit in #179's ExpandsThreads, and the replies line
under a commit row leaves room only when its replies button shows. The
thread fixtures from 2c46223 are in too, so #179's tests don't turn
into self-threads.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A reply's "N replies" on the commit page used to open that reply's own
page. Now it opens its replies under it, and theirs under them, as deep
as they go, the way the web's commit page does. Tapping a reply still
opens its page.

The rows come from #179's ThreadRows, now recursive, and the threads
from ExpandsThreads, which replaces the page's separate mechanism for a
deleted reply's replies. Indentation stops at the web's depth of three
(maxIndentDepth in commit-thread.tsx). Replies at the third step hang
on their own elbow off the line of the reply they answer, and deeper
ones line up under them with no lines and a "replying to @handle" line.
"Show more" is a row of its own on the page too, as on the Log, and says
"to @handle" past that depth.

The Log keeps opening only the commit's replies in place.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Tapping an ancestor, a part of the series or the author's thread, or a
reply at any depth used to push a new commit screen. Now the same page
moves to it: the commit becomes the one the page is about, with what's
above it as its ancestors and its replies showing below, built from
what the page already has so nothing goes blank. The commit it was on
keeps its replies opened, so going back up shows where you came from.
Reply on a commit in the tree retargets the reply bar the same way.
Commits outside the tree still push.

Back still leaves the screen, as Simon asked. There's no history of the
commits the page moved through.

The scroll view's rows are its own children now, so auto-scroll-to can
bring the commit into view. Both platforms jump on the first request
and animate later ones. Deleting a commit the page moved to takes the
page back to its parent.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@simonhamp simonhamp changed the title Open every level of replies in place on the commit page Open every level of replies in place on the commit page, and move the page within its tree Nov 21, 2026
simonhamp and others added 5 commits November 21, 2026 03:05
The scroll view now has animate-layout, so the rows the page keeps slide
to their new places and the ones it adds or drops fade, and
auto-scroll-animated, so the first move animates too. The focused commit
is keyed commit-<id>, as it is among the commits above it, so moving up
the tree slides that row rather than redrawing it.

Going back to a row the scroll view already went to used to mount the
scroll view again, which would make every row new. It now passes a new
auto-scroll-token instead.

These need NativePHP/mobile-air#736 and NativePHP/mobile-ui#225. Without
them the move jumps, as before, and asking for the same row twice in a
row doesn't scroll. The test that reads the new props skips until vendor
has them (Tests\Support\LayoutAnimation).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
It sat under the commit's text. Now it ends the row with the name, handle
and time, pushed right by a spacer, in the same size and ink. Only the
focused commit shows a hash, so no other rows change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The commits above the one the page is on keep their "N replies" button,
and it now opens their replies in place under them, like the commit's and
every reply's, instead of moving the page there.

The reply on the line down to the commit is left out of the list and of
the count, since it already shows below. Closing an ancestor's replies
leaves the replies of the commits on the line open (drawsOnItsOwn in
ExpandsThreads). After a move the scroll target counts the rows opened
above the commit, and opening or closing them later doesn't scroll.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The commits above the one the page is on now start with their replies
folded behind "N replies", whether the page opened on a reply or moved
down to one. Before, moving down kept the replies of the commit the page
left open under it, and any opened on a commit above stayed open.

Moving up, the commit the page moves to shows its replies with the way
back down opened, as before. The scroll target after a move is just the
ancestor count again, since nothing is open above the commit then.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With more than six people and organizations to suggest, the rows sit in
a scroll view six rows tall inside the suggestions, so the list can't push
the field and the bar's buttons down under the keyboard. Six or fewer are
drawn as before, as tall as their rows. The slot around the list keeps its
place, so the field's row doesn't move among its siblings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…scroll

The composer sheet in #198 sizes its mention list and scrolls it. With more
than six rows the partial's own six-row scroll view sat inside that one, so
a short phone showed two scroll bars. 'scrolls' => false draws every row as
tall as it is with no scroll view inside. It defaults to true, so the reply
bar and the conversation bar keep their six-row list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
simonhamp added a commit that referenced this pull request Nov 21, 2026
The sheet sizes its mention list and scrolls it. #196 gives the shared
mention list a six-row scroll view of its own, so once both are merged a
list of more than six would show two scroll bars on a short phone. The
sheet now passes 'scrolls' => false, which #196 adds. Before #196 merges
the partial ignores it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
simonhamp and others added 2 commits November 22, 2026 10:24
devnull sends the ancestors on a commit's page without replies_count, so a
commit above only showed its "N replies" if the page had moved through it
before. Each ancestor that shows now reads its count from its own page,
kept from before at once and asked for behind, once per refresh.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Moves the new property away from $forceFullFrames, which the phone build
removes, so the two merge cleanly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
simonhamp and others added 4 commits November 22, 2026 12:23
Org threads ranked members on the phone and kept the first six, so the
list never scrolled. Now every member who matches is listed, and the list
scrolls past six rows like the reply bar's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sending a reply from the bar or the composer sheet now scrolls the page to
the staged reply. The scroll view counts its direct children, so the page's
rows are now listed by CommitDetail::pageRows() and the view draws exactly
that list. The component looks the staged reply up in the same list, so the
index can't drift from what's drawn.

When devnull's reply replaces the staged one it lands on the same row, so
the target and token stay put and the page doesn't move again. The one case
where it moves is a reply to your own commit that becomes the next part of
your thread; the page follows it there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A commit row gives its hairline up when its replies open under it, and on
a commit page the last reply never drew one. So the replies of a commit
above the focused one ran straight into the next commit with no line
between them. The same happened under the focused commit when later parts
of its series follow.

ThreadRows::under() takes a hairline flag now. Ancestor threads always end
on the line, and the focused commit's replies do when it isn't the last
row. Replies at the foot of the page still end without one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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