Skip to content

Commit screen: photos and preview in the reply bar, drop any time, related commits folded - #180

Draft
simonhamp wants to merge 8 commits into
feat/remote-composerfrom
feat/commit-screen
Draft

simonhamp wants to merge 8 commits into
feat/remote-composerfrom
feat/commit-screen

Conversation

@simonhamp

@simonhamp simonhamp commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Depends on #177. This branches off feat/remote-composer and should merge after it.

Reworks the commit screen's reply bar and related commits.

Reply bar

The bar uses #177's composer-box and send-button, the same as Remotes. On iOS it's Liquid Glass, so the page shows through it blurred, and the glass fades in over the bar's top 28pt and runs on under the home indicator. On Android it's the surface, with the page fading out above it. The field runs across the top. Under it, from the left: a photo button, Preview, then drop, the count near the limit, and a round Reply in your colour. The text Reply button is gone.

A reply never needs the composer sheet now. Presenting a sheet takes the keyboard down and back up on both platforms (I checked stock SwiftUI and UIKit sheets on iOS, and Android's ModalBottomSheet is its own window), so the bar does what the sheet did for a reply:

  • Photos. The photo button opens a menu with Choose photos and Take a photo, as the sheet's two buttons did. Photos show above the field with their ✕ and ALT (the same composer-photos partial), go in the reply's stash with its text, and send with it. Up to three, then the button greys out. While the sheet is up its photos are still the sheet's, through the same AttachesPhotos hooks.
  • Preview. The eye shows the reply as it will look, in the field's place: the body as written at once, then devnull's version with its code and mentions (POST commits/preview, as the sheet does), with its photos. It's held to 320pt and scrolls past that. The keyboard goes down with the field. Pressing it again brings the field back with the keyboard. composer-preview now takes its draft as parameters, so the sheet and the bar share it.
  • Drop. Drop shows beside Reply as soon as there's anything in the reply, so you can throw a draft away at any time, photos too. stash@{0} still shows in front of it only for a draft that came back from the stash. Both sit in the row, so the bar no longer gets taller for them. Remotes has no stash or drop, so nothing to match there.

The expand button and the in-place grow are gone, with their icons. The field grows with the reply to five lines and then scrolls inside. Mentions still show above the field, the link-length error under it, and Reply is a muted circle until there's something to send. The sheet stays for new commits and quotes, and replyInSheet() stays for a reply written in the sheet before this that devnull turned down.

The mention and photo slots keep their keys and places above the field, empty and h-[0.1] when there's nothing in them, so Android never rebuilds the field's row and drops the keyboard.

Liquid Glass on iOS

The reply bar takes #177's glass: <native:bottom-bar class="glass"> with the rows tinted by the surface at 40% (Display::composerBarGlass(), composerSurface()). #177 has the details and the variants I tried. It needs the same mobile-air patch to NativeRootTabsRenderer, which so far is only in the iPhone build's vendor. Without it the bar on iOS is just the 40% tint with nothing blurred behind it.

The text jumping as you type

On Simon's phone the field's text scrolled as he typed a long reply, with the top line half cut off. I checked the prime suspect first: PHP doesn't size the field. The page only sets max-lines (5 here, 8 to 12 in the old grown box), which doesn't change as you type. replyBarClearance() does change per keystroke, but it pads the end of the page's scroll view, not the field.

The cause is mobile-ui's iOS multiline input (NativeUITextInputCore.swift). It draws a TextEditor and sizes it from an invisible Text(text + " ") with lineLimit(min...max), pulling the UITextView's insets back with negative padding. SwiftUI's Text and the UITextView lay out the app's font (Geist) at different line heights, so the frame is never a whole number of the editor's own lines. Once the reply passes five lines the text view scrolls the caret line to the bottom of a frame that holds about 5.4 of its lines, and the top line shows cut in half. How much depends on the Dynamic Type size, which is why it was worse on the phone. I reproduced it in a standalone SwiftUI app with only Geist and that code, outside NativePHP, at three text sizes.

The fix belongs upstream in mobile-ui: size the editor from the UITextView behind it instead of a mirror. Find the text view the way ReturnKeyInterceptorAnchor finds its UITextField, set textContainerInset and lineFragmentPadding to zero, observe contentSize, and make the frame whole lines of font.lineHeight (plus line spacing) between min-lines and max-lines. I tried exactly that in the vendor copy here: no cut line at medium, large and XXL text, and the field grows a line at a time and then scrolls with the caret line in full view. It isn't part of this PR, since the app doesn't own that code. Android was fine already (BasicTextField with maxLines).

Fitting in #182

#182 puts a "post as" avatar at the start of the old reply row and conflicts in commit-detail.blade.php. After this it goes in as composer-box's $lead, ahead of the photo button: 'lead' => [['native.partials.post-as', [...]]] when PostAs::offered(). Reply in the org's lane needs send-button to take a colour (say $colour ??= $myColour). Its "carry the choice into the reply sheet" part goes away, since the bar no longer opens the sheet. The row has room: avatar, photo, Preview, stash@{0} drop, the count and Reply fit on a 402pt-wide phone.

Related commits

The section starts closed under a header with the count and a chevron. Tapping it fades the commits in one after another (40ms apart) while the chevron turns; tapping again fades them out together, then removes them. This is #179's approach: draw the rows see-through, then let a Beat task come back to draw them visible, since EDGE can't animate rows coming in or going out. Beat.php is copied byte for byte from #179 so the two merge cleanly. The test file has its own landBeats() helper rather than #179's finishBeats(), because AsyncTaskTransport::readPayload() deletes the payload and so finishBeats() would eat held refreshes. Worth folding into one helper in Pest.php once both are in.

Overlap with #179

A trial merge of #179 onto this branch is clean. #179's action row and RepliesPerPage change don't touch the reply bar or related commits code.

Things to watch

  • On the iOS 27 simulator, taps and typed keys sometimes stopped reaching the app after presses with the keyboard up, until the simulator was rebooted. Typing a shifted character (@) with axe also made the simulator treat it as a hardware keyboard and hide the soft one. Both look like the simulator, but worth a look on a real phone.
  • Typing word by word with axe on the iOS simulator, one word ("in") went missing from a long reply once. A long reply typed in one go arrived whole on both platforms. I couldn't tell whether that was the simulator's input or the text input's echo handling, which this PR doesn't touch.
  • The Android tab bar sits between the bar and the keyboard on this screen. That was already the case before this change.
  • After reinstalling the Android build, the cached account was empty until the app was restarted, so Reply was blue (no lane). Not from this change.

Testing

Tested on an iOS 27.0 simulator (iPhone 18 Pro, software keyboard) and an Android 35 emulator against a local API, light and dark, keyboard up: typing a reply past five lines with a screenshot after each word (the text never jumped with the mobile-ui fix in place, and did jump without it), attaching two photos from the library, taking one off, previewing with photos, going back to the field, sending with two photos (both arrived), mentions, drop on a fresh draft and on a restored one, opening related commits, and the fade over images in both appearances. The glass I checked on the iOS simulator in light and dark, keyboard up and down, with photos scrolled under the bar, a long reply, photos on the draft, Preview and mentions. 1,916 tests pass, run serially.

Screenshots

The iOS After shots of the reply bar show the glass. Android is unchanged.

The related-close and related-open recordings were made before the reply bar changed. The related commits animation itself hasn't changed.

mention

iOS light iOS dark Android light Android dark
After

related

iOS light iOS dark Android light Android dark
Before
After

Recordings: Android light, after

related-close

Recordings: iOS light, after

related-open

Recordings: iOS light, after

reply

iOS light iOS dark Android light Android dark
Before
After

reply-fade

iOS light iOS dark Android light Android dark
After

reply-photos

iOS light iOS dark Android light Android dark
After

reply-preview

iOS light iOS dark Android light Android dark
After
  • No visible change

🤖 Generated with Claude Code

The reply bar is now the same rounded box as the Remotes composer: the
field across the top, and under it the expand button on the left and a
round send button in your colour on the right. The bar is Liquid Glass on
iOS and the solid surface on Android. The text Reply button is gone.

The expand button no longer opens the composer sheet. Presenting a sheet
takes the keyboard down and puts it back up on both platforms, however
early its field asks for focus, so the box grows in place instead (8 lines,
up to 12) and the keyboard stays where it is. Grown, the box gets a photos
and preview button that opens the sheet as before. Photos attached there
show as a count in the box. A restored draft's stash@{0} and drop sit under
the box, since the grown row has no room for them.

A reply long enough to be folded in feeds now says "folded in feeds" in
small muted text, here and in the sheet. The FoldVertical icon read as a
button that did nothing, so it's gone.

Related commits start closed under a header with their count. Tapping it
fades them in one after another and turns the chevron; tapping again fades
them out, then takes them out. It uses the Beat task from the Log threads
work (PR 179), copied as is so the two branches merge cleanly.

The old composer-plate partial had no users left, so it's deleted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
simonhamp and others added 5 commits November 18, 2026 00:14
Brings in the fade over the foot of the screen, the box without its border
and the fold hint's removal. The reply bar passes its counter as a trail
now, and the fold test checks the hint is gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The reply bar no longer has the expand button or grows in place, and it
never opens the composer sheet. Its row has a photo button (a menu with
the library and the camera) and Preview. Photos show above the field with
their ✕ and ALT, go in the reply's stash, and send with it. Preview shows
the reply as it will look in the field's place, with the body devnull
keeps, and pressed again brings the field back with the keyboard.

The field grows with the reply to five lines and then scrolls. Nothing
in PHP changes its line limits any more.

Drop shows beside Reply as soon as the reply has anything in it, so a
draft can be thrown away at any time. stash@{0} still marks a draft that
came back from the stash. Both moved into the row, so the bar no longer
gets taller for them.

The page fades out above the bar, as Remotes does, from the stack now
around its scroll view. composer-preview takes its draft as parameters so
the sheet and the bar share it. The expand icons are gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings in the fade drawn in the bar on iOS.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The page runs on under the bar on iOS, so the fade is the bar's first row
there, over the reply's rows, which have the surface. On Android it stays
over the foot of the page.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings in the fix for photos picked together pruning each other.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@simonhamp simonhamp changed the title Commit screen: reply bar in the Remotes box, grow in place, related commits folded Commit screen: photos and preview in the reply bar, drop any time, related commits folded Nov 18, 2026
simonhamp and others added 2 commits November 18, 2026 02:05
Brings in the Liquid Glass composer bar on iOS. Display.php conflicted
only on a docblock beside the new ComposerGlassTint constant.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The commit page's reply bar takes the same glass as the Remotes
composer: the page shows through it blurred, the glass fades in at the
top and runs on under the home indicator, and the rows tint it with the
surface. It needs the same patched mobile-air. Android is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
simonhamp added a commit that referenced this pull request Nov 18, 2026
Puts post-as-org on top of #180's reply bar. The Post as avatar now
leads the row under the field through composer-box's lead slot, ahead
of the photo button. The round send button takes a colour, so Reply is
filled with the org's lane while replying as it.

The bar no longer opens the reply sheet, so the code that handed the
bar's choice to the sheet and back is gone. A reply sheet reopened for
an old sheet reply that devnull turned down still has Post as, starting
as you or as the org that reply was going out as.

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