Skip to content

Compose in a sheet from the nav bar, where you are in the log - #3

Merged
simonhamp merged 1 commit into
mainfrom
feat/floating-composer
Oct 18, 2026
Merged

simonhamp merged 1 commit into
mainfrom
feat/floating-composer

Conversation

@simonhamp

Copy link
Copy Markdown
Member

The compose button in the Log's nav bar used to take the log back to its top and focus the composer there, so you lost your place. Now it opens a composer in the bottom sheet that Quote uses: "New commit", a focused field, the body counter and Commit. There's no quoted card.

On success the sheet closes and the commit goes to the top of the log through Log::showCommitted(), as a quote does. There's no toast and the list isn't rebuilt, so you stay down in the feed. If devnull says no, the reason shows in the sheet and the draft stays. Swiping the sheet away drops the draft, like a quote. A draft in the inline composer isn't touched by any of this.

The inline composer at the top of the log works as before when you tap into it.

Why the button always opens the sheet

The idea was to open the sheet only when you're scrolled down. EDGE doesn't tell PHP where a list is scrolled, so the button can't know whether the inline composer is on screen. native:list only sends pull to refresh and end reached:

  • vendor/nativephp/mobile-ui/src/Elements/NativeList.php:127-140 registers only on_refresh and on_end_reached.
  • vendor/nativephp/mobile-ui/resources/ios/NativeUIListRenderer.swift:35-37 reads only those, and the rows' .onAppear (:70-74, :83-87) only feeds fireEndReached (:155-163).
  • vendor/nativephp/mobile-ui/resources/android/ListRenderer.kt:64-80 keeps a LazyListState but only watches it for end reached.
  • native:virtual-list does report a visible range, but only near the edge of the window PHP sent, and it has placeholder rows and no pull to refresh, so it doesn't suit the Log.

A small mobile-ui addition, an event that fires once when the first row leaves or comes back, would allow the "only when scrolled down" version. I don't think it's worth it here. The sheet works fine at the top too, and on the Log every such event re-renders the whole screen ($forceFullFrames) in the middle of a scroll.

Other changes

The sheet's draft and send method are named for the sheet now rather than the quote: sheetBody and commitFromSheet(), with refs sheet-body, sheet-commit, sheet-budget and sheet-composer. QuoteTest is updated to match. Log::compose(), $focusComposer and the inline composer's autofocus are gone, since only the old nav bar behaviour used them. The two ComposerTest tests for that behaviour are replaced by ComposeSheetTest.

What to check

commitFromSheet() should only send from the quote or compose view, never from More or Report, since they share the sheet's draft and error. Other open branches that touch the sheet will need the rename.

After a commit from the sheet the list keeps its scroll offset, so the rows you were reading move down by the height of what was added above them. On the simulator that was about 300pt. Quotes already behave this way, and PHP can't anchor a list's scroll.

How it was verified

php artisan test passes (632 tests) and Pint is clean. On a fresh iPhone 17 Pro simulator against a local devnull running dev-null-sh/dev-null.sh#130's API, signed in as local_dev: I scrolled down the Following log, tapped compose, swiped away a draft and reopened the sheet empty, then wrote and committed from the sheet. The sheet closed and the log stayed down in the feed. Scrolling up showed the new commit at the top. The inline composer at the top still committed as before. I have screenshots and a recording of the run locally.

🤖 Generated with Claude Code

The nav bar's compose button used to take the log back to its top and focus the composer there, which lost your place. Now it opens a composer in the bottom sheet that Quote uses: New commit, the focused field, the body counter and Commit. It has no quoted card. On success the sheet closes and the commit goes to the top of the log, with no toast and no jump. If devnull says no, the reason shows in the sheet and the draft stays. Swiping the sheet away drops the draft, as it does for a quote.

EDGE doesn't tell PHP where a list is scrolled, so the button can't know whether the composer at the top is on screen. It always opens the sheet. The composer at the top of the log works as before when you tap into it, and keeps its own draft.

The sheet's draft and Commit are now named for the sheet rather than the quote: sheetBody and commitFromSheet, with refs sheet-body, sheet-commit and sheet-budget. The inline composer's autofocus went, since only the old nav bar button asked for it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@simonhamp
simonhamp force-pushed the feat/floating-composer branch from 3698057 to e16f168 Compare October 18, 2026 17:28
@simonhamp
simonhamp merged commit 8bc8096 into main Oct 18, 2026
1 check passed
@simonhamp
simonhamp deleted the feat/floating-composer branch October 19, 2026 09:26
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