From 624267e2b5c6c5fd90645161b127d8001e499c82 Mon Sep 17 00:00:00 2001 From: Simon Hamp Date: Sun, 15 Nov 2026 22:55:09 +0000 Subject: [PATCH 1/5] Put the Remotes composer in one box on a blurred bar The field now sits across the top of a rounded box with the + and a round Push button under it, like the Claude app's composer. That settles the old height mismatch between the field and the Push button, and Push takes less room. On iOS the bar is Liquid Glass tinted with the surface, so messages scrolling behind it blur instead of showing through. Android keeps its solid surface bar. The box is a shared partial (composer-box, with send-button) so the commit reply bar can move to it later. body-counter gains a text form of the fold hint for that box, and the Remotes length counter moves into its own partial. Empty slots above the box now take 0.1pt: on iOS an empty one took 10pt of the bar, which showed as a gap once the bar had a backdrop. Co-Authored-By: Claude Opus 5.5 --- app/Devnull/Display.php | 21 +++++++ app/NativeComponents/Conversation.php | 10 ++-- resources/views/native/conversation.blade.php | 51 ++++++++-------- .../native/partials/body-counter.blade.php | 14 ++++- .../native/partials/composer-box.blade.php | 29 +++++++++ .../native/partials/message-field.blade.php | 8 +-- .../native/partials/message-length.blade.php | 8 +++ .../native/partials/send-button.blade.php | 23 +++++++ .../native/partials/voice-recorder.blade.php | 6 +- tests/Feature/Screens/RemotesComposerTest.php | 60 +++++++++++++------ .../Feature/Screens/RemotesVoiceNotesTest.php | 15 ++--- tests/Pest.php | 9 +++ tests/Unit/Devnull/DisplayTest.php | 10 ++++ 13 files changed, 200 insertions(+), 64 deletions(-) create mode 100644 resources/views/native/partials/composer-box.blade.php create mode 100644 resources/views/native/partials/message-length.blade.php create mode 100644 resources/views/native/partials/send-button.blade.php diff --git a/app/Devnull/Display.php b/app/Devnull/Display.php index 09d43f94..d8da90be 100644 --- a/app/Devnull/Display.php +++ b/app/Devnull/Display.php @@ -28,6 +28,18 @@ final class Display */ public const int ReplyBarStashLabelHeight = 28; + /** + * A bar holding partials/composer-box with one line of draft, as drawn on an iPhone: the bar's hairline and + * padding, then the box with its field over the row of tools and the send button. + */ + public const int ComposerBoxBarHeight = 97; + + /** + * About how many characters fit on a line of the box's field. It runs the width of the box, so more fit than + * beside the reply bar's tools and button. + */ + public const int ComposerBoxCharactersPerLine = 46; + /** * The strip under the home indicator on Face ID iPhones. EDGE doesn't * hand pushed screens the real inset (it's 0 inside a tab), so this errs @@ -230,6 +242,15 @@ public static function replyBarClearance(string $draft, bool $draftRow = false): + self::HomeIndicatorHeight; } + /** + * How much taller a composer-box bar is than with one line, as the draft grows to its five lines. A screen pads + * its end by this on top of ComposerBoxBarHeight to keep its last row clear of the bar. + */ + public static function composerBoxGrowth(string $draft): int + { + return (min(self::ReplyBarMaxLines, self::lineCount($draft, self::ComposerBoxCharactersPerLine)) - 1) * self::ReplyBarLineHeight; + } + /** * About how many lines some text wraps to where $perLine characters fit on one, counting each of its own lines. */ diff --git a/app/NativeComponents/Conversation.php b/app/NativeComponents/Conversation.php index ef23ac67..1ed3abdb 100644 --- a/app/NativeComponents/Conversation.php +++ b/app/NativeComponents/Conversation.php @@ -243,10 +243,10 @@ class Conversation extends NativeComponent public bool $composing = false; /** - * The composer bar's height with one line in its field, the same as the reply bar on a commit's page: its top - * line, then the field, its tools and Push with 8 points above and below. + * The composer bar's height with one line in its field: its top line, then the box holding the field over the + + * and Push (see partials/composer-box), with 8 points above and below. */ - public const int ComposerBarHeight = Display::ReplyBarHeight; + public const int ComposerBarHeight = Display::ComposerBoxBarHeight; /** * The "Replying to …" bar above the field. @@ -1836,9 +1836,7 @@ private function longPins(): array */ private static function composerClearance(string $draft, bool $replying, bool $hasPhotos, bool $describing): int { - $grownBy = Display::replyBarClearance($draft) - Display::ReplyBarHeight - Display::HomeIndicatorHeight; - - return self::ComposerBarHeight + $grownBy + return self::ComposerBarHeight + Display::composerBoxGrowth($draft) + ($replying ? self::ReplyingBarHeight : 0) + ($hasPhotos ? self::PhotosHeight : 0) + ($hasPhotos && $describing ? self::DescriptionHeight : 0) diff --git a/resources/views/native/conversation.blade.php b/resources/views/native/conversation.blade.php index c01b14b7..18da1ed8 100644 --- a/resources/views/native/conversation.blade.php +++ b/resources/views/native/conversation.blade.php @@ -73,25 +73,28 @@ @if ($loaded) {{-- - The composer, drawn as the reply bar on a commit's page is (see partials/composer-plate): on iOS the bar is - bare and the field is a Liquid Glass plate with the tools inside it, on Android the bar is the surface with - a hairline and the tools lead it. The web's tools, photos, the microphone and Ping, open from one + here. Above the field - sit what you're replying to and the photos on the draft, on glass of their own on iOS. While the thread - can't take a message, the bar is solid on both, with why in the field's place. + The composer: one rounded box with the field over a row holding the + and the round send button (see + partials/composer-box), on a bar that is Liquid Glass on iOS, tinted with the surface so the thread + scrolling under it is blurred out of the way, and the solid surface with a hairline on Android. The web's + tools, photos, the microphone and Ping, open from the one +. Above the box sit the people to mention, what + you're replying to and the photos on the draft. While the thread can't take a message, the bar is solid + on both, with why in the box's place. --}} - + @if ($canPush) {{-- The members to mention, what you're replying to and the photos on the draft each keep a slot, empty and no height when there's nothing in it, so the field's row never moves. Android rebuilds - a row that moves among its siblings, field and all, which drops the keyboard. + a row that moves among its siblings, field and all, which drops the keyboard. An empty slot is + h-[0.1]: on iOS an empty one otherwise takes 10 points of the bar, and EDGE drops a height of 0. --}} - + @php($mentioning = ($mention['field'] ?? null) === 'draft' && ($mentionPeople !== [] || $mentionOrganizations !== [])) + @include('native.partials.mention-suggestions', ['field' => 'draft', 'heading' => ($mention['query'] ?? null) === '' ? 'Members' : null]) - + @if ($replyTo) @@ -105,30 +108,28 @@ @endif - + @include('native.partials.composer-photos', ['photos' => $photos, 'photoRef' => 'photo', 'describeClass' => 'ios:glass']) - {{-- The same room above and below the field, so the bar sits evenly on the keyboard. --}} - - {{-- - The web's tools, photos, a voice note and Ping, are one + here, which opens them in a menu (see - ComposerMenu), so the field keeps its room. A voice note takes the field's place, and the +'s, - while it's recorded and waits to be pushed. - --}} - @include('native.partials.composer-plate', [ + {{-- + The box keeps its row, and the row its place among the bar's, so the field inside never moves. + A voice note takes the field's place, and the +'s, while it's recorded and waits to be pushed. + --}} + + @include('native.partials.composer-box', [ 'ref' => 'message', 'field' => $recorder === null ? 'native.partials.message-field' : 'native.partials.voice-recorder', 'tools' => $recorder !== null ? [] : [ ['ref' => 'composer-tools', 'icon' => \App\Icons\Lucide::Plus, 'label' => 'Photos, a voice note or a ping', 'menu' => \App\Devnull\ComposerMenu::items(count($photos) >= \App\Devnull\DraftImages::MaxImages, trim($draft) !== '' || $photos !== [], $pingLabel)], ], + 'counter' => ['native.partials.message-length'], + 'send' => [ + 'ref' => 'push', + 'label' => 'Push', + 'press' => 'send', + 'disabled' => $recorder === null ? trim($draft) === '' && $photos === [] : $recorder === 'stopping' || ($recorder === 'recording' && ! $recordingStarted), + ], ]) - @php($length = mb_strlen($draft)) - @if ($length >= 1600) - {{ number_format($length) }}/2,000 - @endif - - Push - @else diff --git a/resources/views/native/partials/body-counter.blade.php b/resources/views/native/partials/body-counter.blade.php index 0c50a5c2..6bdd9736 100644 --- a/resources/views/native/partials/body-counter.blade.php +++ b/resources/views/native/partials/body-counter.blade.php @@ -1,11 +1,21 @@ {{-- The web's BodyCounter, next to Commit or Reply: nothing until 200 characters are left, then the count in mono, amber - from 20 and Rm Red at none. Before that, a body long enough to be folded in lists shows the fold icon instead. + from 20 and Rm Red at none. Before that, a body long enough to be folded in lists says so. + + The composer sheet and the reply bar show the fold icon. In partials/composer-box ($foldHint), where the row has + room for words, it says "folded in feeds" in small muted text instead: people read the icon alone as a button they + couldn't work out, and text that isn't a button can't be mistaken for one. --}} +@php($foldHint ??= false) @php($remaining = \App\Devnull\Data\Commit::MaxLength - (($literal ?? false) ? mb_strlen(\App\Devnull\Data\CommitBody::normalize($body)) : \App\Devnull\Data\CommitBody::characterCount($body))) @php($isCounting = $remaining <= \App\Devnull\Data\Commit::CountFrom) +@php($foldExplained = 'Feeds show the first '.\App\Devnull\Data\Commit::PreviewLength.' characters or '.\App\Devnull\Data\Commit::PreviewLines.' lines, then Show more.') @if ($isCounting) {{ $remaining }} @elseif (\App\Devnull\Data\Commit::isFoldedInLists($body)) - + @if ($foldHint) + folded in feeds + @else + + @endif @endif diff --git a/resources/views/native/partials/composer-box.blade.php b/resources/views/native/partials/composer-box.blade.php new file mode 100644 index 00000000..5ffec607 --- /dev/null +++ b/resources/views/native/partials/composer-box.blade.php @@ -0,0 +1,29 @@ +{{-- + A composer bar's field, tools and send button in one rounded box, the way the Claude and Messages apps draw theirs: + the field across the top, growing to its five lines, and under it a row with the tools on the left and a round + send button in your colour on the right, with anything that counts the draft beside it. The same on both + platforms. The bar around it is the backdrop: Liquid Glass tinted with the surface on iOS, so the thread + scrolling under it blurs instead of showing through, and the solid surface with a hairline on Android. + + $ref names the box ("{$ref}-box", also its key, so the field keeps its place as rows above it come and go) and its + rows ("{$ref}-field-row", "{$ref}-actions"). $field is the partial that draws the field, keyed itself, so it stays + the same view while the tools and the counter under it change. $tools are composer-tool's, in the web's order. + $counter, when there is one, is a partial and its data ([view, data]) for the count left of the send button. + $send is send-button's: its ref, label, method, and whether it can send yet. +--}} +@php($counter ??= null) + + + @include($field) + + + @foreach ($tools as $tool) + @include('native.partials.composer-tool', $tool) + @endforeach + + @if ($counter !== null) + @include($counter[0], $counter[1] ?? []) + @endif + @include('native.partials.send-button', $send) + + diff --git a/resources/views/native/partials/message-field.blade.php b/resources/views/native/partials/message-field.blade.php index 339424b9..f990d826 100644 --- a/resources/views/native/partials/message-field.blade.php +++ b/resources/views/native/partials/message-field.blade.php @@ -1,12 +1,12 @@ {{-- - A Remotes thread's message field (see partials/composer-plate). It keeps the keyboard up through presses elsewhere - in the thread (keep-focus), as the web keeps its field focused through Reply and Push, and its column is keyed, so - the reply strip or photos coming and going above it never rebuild it. It mounts afresh only to take focus + A Remotes thread's message field, across the top of partials/composer-box. It keeps the keyboard up through presses + elsewhere in the thread (keep-focus), as the web keeps its field focused through Reply and Push, and its column is + keyed, so the reply strip or photos coming and going above it never rebuild it. It mounts afresh only to take focus ($composerKey): replying while the field is idle, or attaching photos. EDGE sends no focus event, so a press into the field tells the thread it's in use. Where the caret is goes to the thread as it moves, for the "@" suggestions in an org (see SuggestsMentions), and a picked mention comes back with where the caret goes, after it. --}} - + = 1600) + {{ number_format($length) }}/{{ number_format(\App\Devnull\Data\Message::MaxLength) }} +@endif diff --git a/resources/views/native/partials/send-button.blade.php b/resources/views/native/partials/send-button.blade.php new file mode 100644 index 00000000..00123656 --- /dev/null +++ b/resources/views/native/partials/send-button.blade.php @@ -0,0 +1,23 @@ +{{-- + A composer's send button: a 32pt circle in your colour with an up arrow, as the Claude and Messages apps send. + It names what it does for screen readers ($label: Push, Reply). While there's nothing to send ($disabled) it's a + muted circle, and not a button, as a disabled button would be. Its 36pt tap target fits the composer-tool row. +--}} +@php($disabled ??= false) +@php($circle = 'rounded-full '.($disabled ? 'bg-theme-surface-variant' : 'bg-theme-'.$myColour)) +@php($arrow = $disabled ? 'text-theme-ink-muted' : 'text-theme-on-'.$myColour) +@if ($disabled) + + + + + +@else + + + + + + + +@endif diff --git a/resources/views/native/partials/voice-recorder.blade.php b/resources/views/native/partials/voice-recorder.blade.php index 3c19a267..989ecc54 100644 --- a/resources/views/native/partials/voice-recorder.blade.php +++ b/resources/views/native/partials/voice-recorder.blade.php @@ -1,5 +1,5 @@ {{-- - The voice note in the composer, in the field's place (see partials/composer-plate), as the web's recorder draws + The voice note in the composer, in the field's place (see partials/composer-box), as the web's recorder draws it: the trash, then "opening microphone…" until it records, then a pulsing dot, the microphone's level coming in on the right, and the clock counting to the minute, amber in the last ten seconds, with Stop; then the recording itself, to listen to before Push sends it. The same height as the field with one line, so the bar doesn't move. @@ -7,9 +7,9 @@ While it records, the thread renders five times a second for the meter (RecordsVoiceNotes::MeterInterval). --}} @if ($recorder === 'recording') - + @else - + @endif diff --git a/tests/Feature/Screens/RemotesComposerTest.php b/tests/Feature/Screens/RemotesComposerTest.php index b06a389a..67c20610 100644 --- a/tests/Feature/Screens/RemotesComposerTest.php +++ b/tests/Feature/Screens/RemotesComposerTest.php @@ -129,11 +129,11 @@ function threadWithAda(string $platform = 'ios'): TestableComponent $screen = threadWithAda(); - expect(nodeByRef($screen, 'push')['props']['disabled'] ?? false)->toBeTrue(); + expect(canSend($screen, 'push'))->toBeFalse(); photosPicked($screen, [testPhoto(), testPhoto()])->tap('photo-0-alt')->input('photo-description-input', 'A terminal.'); - expect(nodeByRef($screen, 'push')['props']['disabled'] ?? false)->toBeFalse(); + expect(canSend($screen, 'push'))->toBeTrue(); finishRefreshes($screen->tap('push'))->assertSet('pending', []); @@ -252,31 +252,57 @@ function threadWithAda(string $platform = 'ios'): TestableComponent ->and(childRefs($screen, 'composer-bar'))->toBe($rows); }); -it('puts a + for photos, a voice note and Ping inside the Liquid Glass field on iOS', function () { +it('draws one box with the field over the + and a round Push, on both platforms', function (string $platform) { serveThreadWithAda([remoteMessageJson(['id' => 1])], ['read_through_id' => 1]); - $screen = threadWithAda('ios'); - $bar = findNode($screen->tree(), fn (array $node): bool => ($node['type'] ?? null) === 'bottom_bar'); + $screen = threadWithAda($platform); + $actions = childRefs($screen, 'message-actions'); - expect(childRefs($screen, 'message-plate'))->toBe(['message-field', 'composer-tools']) + expect(childRefs($screen, 'message-row'))->toBe(['message-box']) + ->and(childRefs($screen, 'message-box'))->toBe(['message-field-row', 'message-actions']) + ->and(childRefs($screen, 'message-field-row'))->toBe(['message-field']) + ->and($actions[0])->toBe('composer-tools') + ->and(end($actions))->toBe('push') ->and(array_slice(childRefs($screen, 'composer-tools'), 0, 3))->toBe(['attach-photos', 'record-voice-note', 'ping']) - ->and(nodeByRef($screen, 'message-plate')['props']['glass'] ?? null)->toBe(1) - ->and($bar['children'][0]['ref'] ?? null)->toBe('composer-bar') - ->and($bar['children'][0]['style']['bg_color'] ?? null)->toBeNull() - ->and(nodeByRef($screen, 'ping')['props']['label'])->toBe('Ping @ada'); -}); + ->and(nodeByRef($screen, 'ping')['props']['label'])->toBe('Ping @ada') + ->and(nodeByRef($screen, 'push')['props']['a11y_label'] ?? nodeByRef($screen, 'push')['a11y_label'] ?? null)->toBe('Push'); +})->with(['ios', 'android']); -it('leads the bar with the + on Android, on a solid bar', function () { +it('puts the bar on Liquid Glass tinted with the surface on iOS, and on the solid surface on Android', function () { serveThreadWithAda([remoteMessageJson(['id' => 1])], ['read_through_id' => 1]); - $screen = threadWithAda('android'); + $ios = nodeByRef(threadWithAda('ios'), 'composer-bar'); + $android = nodeByRef(threadWithAda('android'), 'composer-bar'); - expect(array_slice(childRefs($screen, 'message-row'), 0, 2))->toBe(['composer-tools', 'message-plate']) - ->and(childRefs($screen, 'message-plate'))->toBe(['message-field']) - ->and(nodeByRef($screen, 'message-plate')['props']['glass'] ?? null)->toBeNull() - ->and(nodeByRef($screen, 'composer-bar')['style']['bg_color'] ?? null)->toBe(config('native-ui.theme.light.surface')); + expect($ios['props']['glass'] ?? null)->toBe(1) + ->and($ios['style']['bg_color'] ?? null)->not->toBeNull() + ->and($android['props']['glass'] ?? null)->toBeNull() + ->and($android['style']['bg_color'] ?? null)->toBe(config('native-ui.theme.light.surface')); }); +it('counts a long message beside Push from 1,600 characters, amber from 1,900 and red at 2,000', function (int $length, ?string $colour) { + serveThreadWithAda([remoteMessageJson(['id' => 1])], ['read_through_id' => 1]); + + $screen = threadWithAda()->input('message-input', str_repeat('a', $length)); + + if ($colour === null) { + expect(rendersRef($screen, 'message-length'))->toBeFalse(); + + return; + } + + $actions = childRefs($screen, 'message-actions'); + + expect(nodeByRef($screen, 'message-length')['props']['text'])->toBe(number_format($length).'/2,000') + ->and(strtolower(nodeByRef($screen, 'message-length')['props']['color'] ?? ''))->toBe(strtolower(config("native-ui.theme.light.{$colour}"))) + ->and(array_slice($actions, -2))->toBe(['message-length', 'push']); +})->with([ + 'short' => [1599, null], + 'long' => [1600, 'ink-muted'], + 'nearly full' => [1900, 'pending'], + 'full' => [2000, 'destructive'], +]); + it('pings Ada, logging it in the thread as the web does and buzzing the phone', function () { serveThreadWithAda([remoteMessageJson(['id' => 1, 'body' => 'you there?'])], ['read_through_id' => 1]); diff --git a/tests/Feature/Screens/RemotesVoiceNotesTest.php b/tests/Feature/Screens/RemotesVoiceNotesTest.php index 7dee858e..01a2038a 100644 --- a/tests/Feature/Screens/RemotesVoiceNotesTest.php +++ b/tests/Feature/Screens/RemotesVoiceNotesTest.php @@ -184,10 +184,11 @@ function playedBars(TestableComponent $screen, string $ref): int && $params['maxDuration'] == 60 && $params['id'] === $screen->instance()->recordingId); - expect(childRefs($screen, 'message-plate'))->toBe(['voice-recorder']) + expect(childRefs($screen, 'message-field-row'))->toBe(['voice-recorder']) + ->and(childRefs($screen, 'message-actions'))->not->toContain('composer-tools') ->and(nodeByRef($screen, 'voice-elapsed')['props']['text'] ?? null)->toBe('0:00/1:00') ->and(rendersEvery($screen))->toBe([200]) - ->and(nodeByRef($screen, 'push')['props']['disabled'] ?? false)->toBeFalse(); + ->and(canSend($screen, 'push'))->toBeTrue(); // The level is the loudest sample since the last look, square-rooted as the web draws it, and the clock turns amber // in the last ten seconds. @@ -207,7 +208,7 @@ function playedBars(TestableComponent $screen, string $ref): int $screen = voiceThread()->tap('record-voice-note')->assertSee('opening microphone…'); - expect(nodeByRef($screen, 'push')['props']['disabled'] ?? false)->toBeTrue(); + expect(canSend($screen, 'push'))->toBeFalse(); // The clock counts from when the microphone starts, not from the tap. $this->travel(5)->seconds(); @@ -217,7 +218,7 @@ function playedBars(TestableComponent $screen, string $ref): int $screen->call('poll'); expect(nodeByRef($screen, 'voice-elapsed')['props']['text'])->toBe('0:02/1:00') - ->and(nodeByRef($screen, 'push')['props']['disabled'] ?? false)->toBeFalse(); + ->and(canSend($screen, 'push'))->toBeTrue(); }); it('stops to listen to the recording first, then pushes it staged at once and pushed once devnull has it', function () { @@ -228,7 +229,7 @@ function playedBars(TestableComponent $screen, string $ref): int $screen = voiceThread()->tap('record-voice-note')->tap('stop-voice-note'); $screen->assertNativeCalled('Microphone.Stop')->assertSee('encoding…'); - expect(nodeByRef($screen, 'push')['props']['disabled'] ?? false)->toBeTrue(); + expect(canSend($screen, 'push'))->toBeFalse(); voiceRecorded($screen, $recording); $kept = $screen->instance()->recorded->url; @@ -245,7 +246,7 @@ function playedBars(TestableComponent $screen, string $ref): int $screen->tap('push')->assertSee('staged')->assertSet('recorder', null)->assertNativeCalled('MediaPlayer.Stop'); $clientId = $screen->instance()->pending[0]->clientId; - expect(childRefs($screen, 'message-plate'))->toBe(['message-field', 'composer-tools']) + expect(childRefs($screen, 'message-field-row'))->toBe(['message-field']) ->and(nodeByRef($screen, 'voice-'.$clientId.'-clock')['props']['text'])->toBe('0:02'); finishRefreshes($screen)->assertSee('pushed')->assertSet('pending', []); @@ -321,7 +322,7 @@ function playedBars(TestableComponent $screen, string $ref): int } expect(file_exists($recording))->toBeFalse() - ->and(childRefs($screen, 'message-plate'))->toBe(['message-field', 'composer-tools']) + ->and(childRefs($screen, 'message-field-row'))->toBe(['message-field']) ->and(voiceUploads())->toBe([]); })->with(['while recording' => [true], 'once recorded' => [false]]); diff --git a/tests/Pest.php b/tests/Pest.php index 41e32e2e..d1bf556c 100644 --- a/tests/Pest.php +++ b/tests/Pest.php @@ -771,6 +771,15 @@ function sheetButtonEnabled(TestableComponent $screen, string $ref): bool return nodeByRef($screen, $ref)['type'] === 'pressable'; } +/** + * Whether a composer's round send button (partials/send-button) can be tapped. A disabled one is drawn as a plain + * circle, not a pressable. + */ +function canSend(TestableComponent $screen, string $ref): bool +{ + return nodeByRef($screen, $ref)['type'] === 'pressable'; +} + /** * The circle of a round button in a sheet's bar, whether it can be tapped or not. * diff --git a/tests/Unit/Devnull/DisplayTest.php b/tests/Unit/Devnull/DisplayTest.php index fe38524f..e7c8ed64 100644 --- a/tests/Unit/Devnull/DisplayTest.php +++ b/tests/Unit/Devnull/DisplayTest.php @@ -8,6 +8,16 @@ expect(Display::replyBarClearance($url))->toBe(Display::replyBarClearance(str_repeat('a', mb_strlen($url))) + 3 * Display::ReplyBarLineHeight); }); +it('grows a composer box by a line height for each line the draft wraps to, up to five lines', function (string $draft, int $lines) { + expect(Display::composerBoxGrowth($draft))->toBe(($lines - 1) * Display::ReplyBarLineHeight); +})->with([ + 'empty' => ['', 1], + 'one line' => [str_repeat('a', Display::ComposerBoxCharactersPerLine), 1], + 'wraps once' => [str_repeat('a', Display::ComposerBoxCharactersPerLine + 1), 2], + 'its own lines' => ["one\ntwo\nthree", 3], + 'past five' => [str_repeat("line\n", 9), 5], +]); + it('prints compact counts from a thousand as the web does', function (int $count, string $expected) { expect(Display::compactCount($count))->toBe($expected); })->with([ From 259fc2142ef024a4afe27f986b98a0c90e727be3 Mon Sep 17 00:00:00 2001 From: Simon Hamp Date: Wed, 18 Nov 2026 00:13:30 +0000 Subject: [PATCH 2/5] Fade the thread out above the composer, drop the box and the fold hint The composer bar was a bordered box on Liquid Glass tinted at 70%, which looked heavy, with a hard top edge. Now the field and its row sit straight on the surface, and a 28pt gradient over the foot of the thread fades it out above the bar on both platforms. Android gets the same fade, since it lies over the scroll view rather than relying on a blur. EDGE's gradient stops have no dark companion, so the stops come from theme('surface') and the screen draws again on AppearanceChanged. "folded in feeds" (and the FoldVertical icon before it) is gone from body-counter, so nothing in the composers says a long commit gets folded. The countdown near the limit stays. composer-box takes $lead and $trail partials for the start and end of its row, in place of $counter, so the commit page can put the drop and a "post as" avatar there. Co-Authored-By: Claude Opus 5.5 --- app/Devnull/Data/Commit.php | 19 -------- app/Devnull/Display.php | 25 ++++++++-- app/Icons/Lucide.php | 2 - .../Concerns/RedrawsOnAppearanceChange.php | 19 ++++++++ app/NativeComponents/Conversation.php | 15 +++--- resources/icons/fold-vertical.svg | 1 - resources/views/native/conversation.blade.php | 21 +++++---- .../native/partials/body-counter.blade.php | 17 +------ .../native/partials/composer-box.blade.php | 34 ++++++++------ .../native/partials/composer-fade.blade.php | 8 ++++ tests/Feature/Screens/ConversationTest.php | 11 +++-- tests/Feature/Screens/RemotesComposerTest.php | 47 +++++++++++++++---- 12 files changed, 136 insertions(+), 83 deletions(-) create mode 100644 app/NativeComponents/Concerns/RedrawsOnAppearanceChange.php delete mode 100644 resources/icons/fold-vertical.svg create mode 100644 resources/views/native/partials/composer-fade.blade.php diff --git a/app/Devnull/Data/Commit.php b/app/Devnull/Data/Commit.php index 6d19fdde..941f4ce3 100644 --- a/app/Devnull/Data/Commit.php +++ b/app/Devnull/Data/Commit.php @@ -34,13 +34,6 @@ */ public const int CountFrom = 200; - /** - * A list shows a body longer than this, or longer than PreviewLines lines, as its start and "Show more". - */ - public const int PreviewLength = 280; - - public const int PreviewLines = 8; - /** * The status of a commit you made that devnull doesn't have yet, which * stands in for it on the screen (see PendingWrite::stagedCommit()). @@ -211,18 +204,6 @@ public static function fits(string $body): bool && ! CommitBody::hasOversizedUrl($body); } - /** - * Whether a list would show only the start of a body, as the web's composer - * works it out: more than PreviewLength characters or PreviewLines lines, - * once blank lines in a run are counted as one. - */ - public static function isFoldedInLists(string $body): bool - { - $normalized = CommitBody::normalize($body); - - return mb_strlen($normalized) > self::PreviewLength || count(explode("\n", $normalized)) > self::PreviewLines; - } - /** * This commit with $update applied to the replies under it, as a feed draws them. * diff --git a/app/Devnull/Display.php b/app/Devnull/Display.php index d8da90be..d9b611a3 100644 --- a/app/Devnull/Display.php +++ b/app/Devnull/Display.php @@ -29,10 +29,15 @@ final class Display public const int ReplyBarStashLabelHeight = 28; /** - * A bar holding partials/composer-box with one line of draft, as drawn on an iPhone: the bar's hairline and - * padding, then the box with its field over the row of tools and the send button. + * A bar holding partials/composer-box with one line of draft, as drawn on an iPhone: the bar's padding, then the + * field over the row of tools and the send button. */ - public const int ComposerBoxBarHeight = 97; + public const int ComposerBoxBarHeight = 94; + + /** + * The fade over the foot of a screen, just above its composer bar (see partials/composer-fade). + */ + public const int ComposerFadeHeight = 28; /** * About how many characters fit on a line of the box's field. It runs the width of the box, so more fit than @@ -251,6 +256,20 @@ public static function composerBoxGrowth(string $draft): int return (min(self::ReplyBarMaxLines, self::lineCount($draft, self::ComposerBoxCharactersPerLine)) - 1) * self::ReplyBarLineHeight; } + /** + * The fade's classes (see partials/composer-fade): a gradient down from see-through to the surface, where the bar + * starts. EDGE takes a gradient's stops as they are, without the dark companion a theme colour gets, so the stops + * are the surface of the appearance the phone is in now, and a screen with the fade draws again when that + * changes (see RedrawsOnAppearanceChange). It climbs to 70% of the surface by halfway, so what's under it has + * mostly faded before it reaches the bar. + */ + public static function composerFade(): string + { + $surface = strtolower((string) theme('surface', '#ffffff')); + + return "bg-gradient-to-b from-{$surface}/0 via-{$surface}/70 to-{$surface}"; + } + /** * About how many lines some text wraps to where $perLine characters fit on one, counting each of its own lines. */ diff --git a/app/Icons/Lucide.php b/app/Icons/Lucide.php index b6ea5bb9..06a56187 100644 --- a/app/Icons/Lucide.php +++ b/app/Icons/Lucide.php @@ -49,7 +49,6 @@ enum Lucide case UserPlus; case UserCheck; case AtSign; - case FoldVertical; case Award; case Ellipsis; case Flag; @@ -189,7 +188,6 @@ public function custom(bool $filled = false): string self::UserPlus => 'user-plus', self::UserCheck => 'user-check', self::AtSign => 'at-sign', - self::FoldVertical => 'fold-vertical', self::Award => 'award', self::Ellipsis => 'ellipsis', self::Flag => 'flag', diff --git a/app/NativeComponents/Concerns/RedrawsOnAppearanceChange.php b/app/NativeComponents/Concerns/RedrawsOnAppearanceChange.php new file mode 100644 index 00000000..0a003add --- /dev/null +++ b/app/NativeComponents/Concerns/RedrawsOnAppearanceChange.php @@ -0,0 +1,19 @@ + diff --git a/resources/views/native/conversation.blade.php b/resources/views/native/conversation.blade.php index 18da1ed8..7e833e2f 100644 --- a/resources/views/native/conversation.blade.php +++ b/resources/views/native/conversation.blade.php @@ -69,20 +69,23 @@ @if ($pinned !== []) @include('native.partials.pinned-bar') @endif + + {{-- The thread fades out above the composer instead of meeting it at a hard edge. --}} + @if ($loaded) + @include('native.partials.composer-fade', ['ref' => 'composer-fade']) + @endif @if ($loaded) {{-- - The composer: one rounded box with the field over a row holding the + and the round send button (see - partials/composer-box), on a bar that is Liquid Glass on iOS, tinted with the surface so the thread - scrolling under it is blurred out of the way, and the solid surface with a hairline on Android. The web's - tools, photos, the microphone and Ping, open from the one +. Above the box sit the people to mention, what - you're replying to and the photos on the draft. While the thread can't take a message, the bar is solid - on both, with why in the box's place. + The composer: the field over a row holding the + and the round send button (see partials/composer-box), on + the surface, with the thread fading out above it (see partials/composer-fade) rather than a line or a + blur. The surface also fills the strip under the home indicator. The web's tools, photos, the microphone + and Ping, open from the one +. Above the field sit the people to mention, what you're replying to and the + photos on the draft. While the thread can't take a message, why goes in the field's place. --}} - - + @if ($canPush) {{-- The members to mention, what you're replying to and the photos on the draft each keep a slot, @@ -122,7 +125,7 @@ 'tools' => $recorder !== null ? [] : [ ['ref' => 'composer-tools', 'icon' => \App\Icons\Lucide::Plus, 'label' => 'Photos, a voice note or a ping', 'menu' => \App\Devnull\ComposerMenu::items(count($photos) >= \App\Devnull\DraftImages::MaxImages, trim($draft) !== '' || $photos !== [], $pingLabel)], ], - 'counter' => ['native.partials.message-length'], + 'trail' => [['native.partials.message-length']], 'send' => [ 'ref' => 'push', 'label' => 'Push', diff --git a/resources/views/native/partials/body-counter.blade.php b/resources/views/native/partials/body-counter.blade.php index 6bdd9736..327a2a86 100644 --- a/resources/views/native/partials/body-counter.blade.php +++ b/resources/views/native/partials/body-counter.blade.php @@ -1,21 +1,8 @@ {{-- The web's BodyCounter, next to Commit or Reply: nothing until 200 characters are left, then the count in mono, amber - from 20 and Rm Red at none. Before that, a body long enough to be folded in lists says so. - - The composer sheet and the reply bar show the fold icon. In partials/composer-box ($foldHint), where the row has - room for words, it says "folded in feeds" in small muted text instead: people read the icon alone as a button they - couldn't work out, and text that isn't a button can't be mistaken for one. + from 20 and Rm Red at none. --}} -@php($foldHint ??= false) @php($remaining = \App\Devnull\Data\Commit::MaxLength - (($literal ?? false) ? mb_strlen(\App\Devnull\Data\CommitBody::normalize($body)) : \App\Devnull\Data\CommitBody::characterCount($body))) -@php($isCounting = $remaining <= \App\Devnull\Data\Commit::CountFrom) -@php($foldExplained = 'Feeds show the first '.\App\Devnull\Data\Commit::PreviewLength.' characters or '.\App\Devnull\Data\Commit::PreviewLines.' lines, then Show more.') -@if ($isCounting) +@if ($remaining <= \App\Devnull\Data\Commit::CountFrom) {{ $remaining }} -@elseif (\App\Devnull\Data\Commit::isFoldedInLists($body)) - @if ($foldHint) - folded in feeds - @else - - @endif @endif diff --git a/resources/views/native/partials/composer-box.blade.php b/resources/views/native/partials/composer-box.blade.php index 5ffec607..4976653f 100644 --- a/resources/views/native/partials/composer-box.blade.php +++ b/resources/views/native/partials/composer-box.blade.php @@ -1,29 +1,35 @@ {{-- - A composer bar's field, tools and send button in one rounded box, the way the Claude and Messages apps draw theirs: - the field across the top, growing to its five lines, and under it a row with the tools on the left and a round - send button in your colour on the right, with anything that counts the draft beside it. The same on both - platforms. The bar around it is the backdrop: Liquid Glass tinted with the surface on iOS, so the thread - scrolling under it blurs instead of showing through, and the solid surface with a hairline on Android. + A composer bar's field, tools and send button, laid out the way the Claude and Messages apps lay theirs out: the + field across the top, growing to its five lines, and under it a row with the tools on the left and a round send + button in your colour on the right. The same on both platforms. Nothing is drawn around them: they sit straight on + the bar, which is the surface, under the fade the screen lays over its foot (see partials/composer-fade). $ref names the box ("{$ref}-box", also its key, so the field keeps its place as rows above it come and go) and its rows ("{$ref}-field-row", "{$ref}-actions"). $field is the partial that draws the field, keyed itself, so it stays - the same view while the tools and the counter under it change. $tools are composer-tool's, in the web's order. - $counter, when there is one, is a partial and its data ([view, data]) for the count left of the send button. - $send is send-button's: its ref, label, method, and whether it can send yet. + the same view while the tools and everything else in the row under it change. $tools are composer-tool's, in the + web's order. $lead and $trail, when there are any, are partials with their data ([view, data]) for the start of the + row, ahead of the tools, and for the end, left of the send button, such as the count of a long draft. $send is + send-button's: its ref, label, method, and whether it can send yet. + + The field's text lines up with the tools' icons under it. --}} -@php($counter ??= null) - - +@php($lead ??= []) +@php($trail ??= []) + + @include($field) + @foreach ($lead as $part) + @include($part[0], $part[1] ?? []) + @endforeach @foreach ($tools as $tool) @include('native.partials.composer-tool', $tool) @endforeach - @if ($counter !== null) - @include($counter[0], $counter[1] ?? []) - @endif + @foreach ($trail as $part) + @include($part[0], $part[1] ?? []) + @endforeach @include('native.partials.send-button', $send) diff --git a/resources/views/native/partials/composer-fade.blade.php b/resources/views/native/partials/composer-fade.blade.php new file mode 100644 index 00000000..6caefabd --- /dev/null +++ b/resources/views/native/partials/composer-fade.blade.php @@ -0,0 +1,8 @@ +{{-- + The soft edge over the foot of a screen, just above its composer bar: a gradient from see-through at the top to + the surface at the bottom, where the bar starts, so whatever scrolls down to the bar fades out instead of meeting a + hard line. It lies over the screen's scroll view, at the bottom of the stack around it, on both platforms: on iOS + the thread runs on under the bar, which hides it, and on Android it stops at the bar. Its colours come from + Display::composerFade(). $ref names it. +--}} + diff --git a/tests/Feature/Screens/ConversationTest.php b/tests/Feature/Screens/ConversationTest.php index 5e0634ef..ede1ed9c 100644 --- a/tests/Feature/Screens/ConversationTest.php +++ b/tests/Feature/Screens/ConversationTest.php @@ -2,6 +2,7 @@ use App\Devnull\Account; use App\Devnull\Data\Remotes; +use App\Devnull\Display; use App\NativeComponents\Conversation; use Illuminate\Http\Client\Request; use Illuminate\Support\Facades\Http; @@ -760,18 +761,18 @@ function pulledAvatars(TestableComponent $screen, int $id): array ->assertNativeNotCalled('Browser.OpenInApp'); }); -it('pads the end of the thread for the composer bar alone, and for the reply bar while replying', function () { +it('pads the end of the thread for the fade and the composer bar alone, and for the reply bar while replying', function () { serveRemoteThread(threadJson([remoteMessageJson(['id' => 1])], ['read_through_id' => 1])); $screen = finishRefreshes(Native::visit('/remotes/conversations/ada')); $clearance = fn (): mixed => nodeByRef($screen, 'composer-clearance')['layout']['height'] ?? null; // The scroll view adds the home indicator itself while the keyboard is down, so it isn't counted here. - expect($clearance())->toEqual(Conversation::ComposerBarHeight + 8); + expect($clearance())->toEqual(Display::ComposerFadeHeight + Conversation::ComposerBarHeight + 8); $screen->trigger('swipe-1'); - expect($clearance())->toEqual(Conversation::ComposerBarHeight + Conversation::ReplyingBarHeight + 8); + expect($clearance())->toEqual(Display::ComposerFadeHeight + Conversation::ComposerBarHeight + Conversation::ReplyingBarHeight + 8); }); // ── Pins ──────────────────────────────── @@ -1025,8 +1026,8 @@ function serveOrgThread(array $thread, ?array $poll = null, ?Closure $pins = nul ->assertSee('pinned · 2') ->assertSee(' release checklist'); - // It lies over the thread, which clears it at the top. - expect(childRefs($screen, 'thread-stack'))->toBe(['thread', 'pinned-bar']) + // It lies over the thread, which clears it at the top, under the fade over the thread's foot. + expect(childRefs($screen, 'thread-stack'))->toBe(['thread', 'pinned-bar', 'composer-fade']) ->and(childRefs($screen, 'thread')[0])->toBe('pinned-clearance') ->and(nodeByRef($screen, 'pinned-bar')['props']['a11y_label'] ?? null)->toBe('2 pinned messages. Latest from Ada Lovelace: release checklist'); diff --git a/tests/Feature/Screens/RemotesComposerTest.php b/tests/Feature/Screens/RemotesComposerTest.php index 67c20610..7dff8702 100644 --- a/tests/Feature/Screens/RemotesComposerTest.php +++ b/tests/Feature/Screens/RemotesComposerTest.php @@ -1,10 +1,13 @@ toEqual(Conversation::ComposerBarHeight + Conversation::PhotosHeight + 8); + expect($clearance())->toEqual(Display::ComposerFadeHeight + Conversation::ComposerBarHeight + Conversation::PhotosHeight + 8); $screen->tap('photo-0-alt'); - expect($clearance())->toEqual(Conversation::ComposerBarHeight + Conversation::PhotosHeight + Conversation::DescriptionHeight + 8); + expect($clearance())->toEqual(Display::ComposerFadeHeight + Conversation::ComposerBarHeight + Conversation::PhotosHeight + Conversation::DescriptionHeight + 8); }); it('keeps the keyboard up through presses in the thread, and the field in place as the reply strip and photos come and go', function () { @@ -268,16 +271,42 @@ function threadWithAda(string $platform = 'ios'): TestableComponent ->and(nodeByRef($screen, 'push')['props']['a11y_label'] ?? nodeByRef($screen, 'push')['a11y_label'] ?? null)->toBe('Push'); })->with(['ios', 'android']); -it('puts the bar on Liquid Glass tinted with the surface on iOS, and on the solid surface on Android', function () { +it('puts the bar on the surface with no glass or line, and fades the thread out above it, on both platforms', function (string $platform) { serveThreadWithAda([remoteMessageJson(['id' => 1])], ['read_through_id' => 1]); - $ios = nodeByRef(threadWithAda('ios'), 'composer-bar'); - $android = nodeByRef(threadWithAda('android'), 'composer-bar'); + $screen = threadWithAda($platform); + $bar = nodeByRef($screen, 'composer-bar'); + $fade = nodeByRef($screen, 'composer-fade'); + $surface = strtoupper(config('native-ui.theme.light.surface')); + + expect($bar['props']['glass'] ?? null)->toBeNull() + ->and($bar['style']['bg_color'] ?? null)->toBe(config('native-ui.theme.light.surface')) + ->and(childRefs($screen, 'composer-bar')[0])->toBe('mention-slot') + ->and(nodeByRef($screen, 'message-box')['style']['border_width'] ?? 0)->toEqual(0) + ->and(nodeByRef($screen, 'message-box')['style']['bg_color'] ?? null)->toBeNull() + ->and(array_slice(childRefs($screen, 'thread-stack'), -1))->toBe(['composer-fade']) + ->and($fade['props']['gradient_stops'] ?? null)->toBe('#00'.substr($surface, 1).',#B3'.substr($surface, 1).','.$surface) + ->and($fade['layout']['height'] ?? null)->toEqual(Display::ComposerFadeHeight); +})->with(['ios', 'android']); + +it('fades to the dark surface in dark mode, and draws again when the phone switches', function () { + serveThreadWithAda([remoteMessageJson(['id' => 1])], ['read_through_id' => 1]); + + $screen = threadWithAda(); + $light = strtoupper(config('native-ui.theme.light.surface')); + $dark = strtoupper(config('native-ui.theme.dark.surface')); + + expect(str_ends_with(nodeByRef($screen, 'composer-fade')['props']['gradient_stops'], $light))->toBeTrue(); + + System::rememberAppearance('dark'); - expect($ios['props']['glass'] ?? null)->toBe(1) - ->and($ios['style']['bg_color'] ?? null)->not->toBeNull() - ->and($android['props']['glass'] ?? null)->toBeNull() - ->and($android['style']['bg_color'] ?? null)->toBe(config('native-ui.theme.light.surface')); + try { + $screen->emitNative(AppearanceChanged::class, ['mode' => 'dark']); + + expect(str_ends_with(nodeByRef($screen, 'composer-fade')['props']['gradient_stops'], $dark))->toBeTrue(); + } finally { + System::rememberAppearance('light'); + } }); it('counts a long message beside Push from 1,600 characters, amber from 1,900 and red at 2,000', function (int $length, ?string $colour) { From ae2b4635487ef5ba415e73eef47cb8091245b1d3 Mon Sep 17 00:00:00 2001 From: Simon Hamp Date: Wed, 18 Nov 2026 00:44:35 +0000 Subject: [PATCH 3/5] Draw the fade in the bar on iOS, where the thread runs under it On iOS the screen runs on under its bottom bar, so a fade lying over the foot of the thread sat under the bar and never showed. The bar now draws it as its first row there, and its rows (composer-rows) have the surface of their own. The bar itself has no background on iOS: mobile-air paints a bar's background colour behind the whole bar, which hid the fade. The strip under the home indicator still shows the surface, from the scroll view's background. Android keeps the fade over the foot of the thread, since its screen stops at the bar. Co-Authored-By: Claude Opus 5.5 --- app/Devnull/Display.php | 22 +++++++++++++++++ resources/views/native/conversation.blade.php | 11 ++++++--- .../native/partials/composer-fade.blade.php | 15 +++++++----- tests/Feature/Screens/ConversationTest.php | 4 ++-- tests/Feature/Screens/RemotesComposerTest.php | 24 ++++++++++++++----- 5 files changed, 59 insertions(+), 17 deletions(-) diff --git a/app/Devnull/Display.php b/app/Devnull/Display.php index d9b611a3..defd42ed 100644 --- a/app/Devnull/Display.php +++ b/app/Devnull/Display.php @@ -5,6 +5,7 @@ use App\Devnull\Data\CommitBody; use Carbon\CarbonImmutable; use Carbon\CarbonInterface; +use Native\Mobile\Platform; /** * How the machine prints things: relative times and short hashes, as the web does. @@ -270,6 +271,27 @@ public static function composerFade(): string return "bg-gradient-to-b from-{$surface}/0 via-{$surface}/70 to-{$surface}"; } + /** + * Whether the fade goes at the top of the composer bar itself, rather than over the foot of the screen above it. + * On iOS the screen runs on under its bottom bar, so a fade lying over the screen's foot would be under the bar, + * and the bar has to draw it. On Android the screen stops where the bar starts, so the fade lies over the screen. + */ + public static function fadesInBar(): bool + { + return Platform::isIos(); + } + + /** + * The composer bar's own classes. On Android it's the surface. On iOS it has no background at all: mobile-air + * paints a bar's background colour behind the whole bar, which would cover what the fade at its top should show, + * so only the bar's rows have the surface (see partials/composer-fade). The strip under the home indicator still + * comes out the surface there, from the scroll view's background running on under it. + */ + public static function composerBar(): string + { + return self::fadesInBar() ? '' : 'bg-theme-surface'; + } + /** * About how many lines some text wraps to where $perLine characters fit on one, counting each of its own lines. */ diff --git a/resources/views/native/conversation.blade.php b/resources/views/native/conversation.blade.php index 7e833e2f..f540820d 100644 --- a/resources/views/native/conversation.blade.php +++ b/resources/views/native/conversation.blade.php @@ -70,8 +70,8 @@ @include('native.partials.pinned-bar') @endif - {{-- The thread fades out above the composer instead of meeting it at a hard edge. --}} - @if ($loaded) + {{-- The thread fades out above the composer instead of meeting it at a hard edge. On iOS the bar draws the fade. --}} + @if ($loaded && ! \App\Devnull\Display::fadesInBar()) @include('native.partials.composer-fade', ['ref' => 'composer-fade']) @endif @@ -85,7 +85,11 @@ photos on the draft. While the thread can't take a message, why goes in the field's place. --}} - + + @if (\App\Devnull\Display::fadesInBar()) + @include('native.partials.composer-fade', ['ref' => 'composer-fade', 'inBar' => true]) + @endif + @if ($canPush) {{-- The members to mention, what you're replying to and the photos on the draft each keep a slot, @@ -157,6 +161,7 @@ @endif @endif + @endif diff --git a/resources/views/native/partials/composer-fade.blade.php b/resources/views/native/partials/composer-fade.blade.php index 6caefabd..b7bb3b91 100644 --- a/resources/views/native/partials/composer-fade.blade.php +++ b/resources/views/native/partials/composer-fade.blade.php @@ -1,8 +1,11 @@ {{-- - The soft edge over the foot of a screen, just above its composer bar: a gradient from see-through at the top to - the surface at the bottom, where the bar starts, so whatever scrolls down to the bar fades out instead of meeting a - hard line. It lies over the screen's scroll view, at the bottom of the stack around it, on both platforms: on iOS - the thread runs on under the bar, which hides it, and on Android it stops at the bar. Its colours come from - Display::composerFade(). $ref names it. + The soft edge between a screen and its composer bar: a gradient from see-through at the top to the surface at the + bottom, where the bar's rows start, so whatever scrolls down to the bar fades out instead of meeting a hard line. + Its colours come from Display::composerFade(). + + Where it goes depends on the platform (Display::fadesInBar()). On iOS the screen runs on under the bar, so the fade + is the bar's first row ($inBar), over what runs under it. On Android the screen stops at the bar, so the fade lies + over the foot of the screen's scroll view, at the bottom of the stack around it. $ref names it. --}} - +@php($inBar ??= false) + diff --git a/tests/Feature/Screens/ConversationTest.php b/tests/Feature/Screens/ConversationTest.php index ede1ed9c..4a22b9cc 100644 --- a/tests/Feature/Screens/ConversationTest.php +++ b/tests/Feature/Screens/ConversationTest.php @@ -1026,8 +1026,8 @@ function serveOrgThread(array $thread, ?array $poll = null, ?Closure $pins = nul ->assertSee('pinned · 2') ->assertSee(' release checklist'); - // It lies over the thread, which clears it at the top, under the fade over the thread's foot. - expect(childRefs($screen, 'thread-stack'))->toBe(['thread', 'pinned-bar', 'composer-fade']) + // It lies over the thread, which clears it at the top. + expect(array_slice(childRefs($screen, 'thread-stack'), 0, 2))->toBe(['thread', 'pinned-bar']) ->and(childRefs($screen, 'thread')[0])->toBe('pinned-clearance') ->and(nodeByRef($screen, 'pinned-bar')['props']['a11y_label'] ?? null)->toBe('2 pinned messages. Latest from Ada Lovelace: release checklist'); diff --git a/tests/Feature/Screens/RemotesComposerTest.php b/tests/Feature/Screens/RemotesComposerTest.php index 7dff8702..fcd54ee6 100644 --- a/tests/Feature/Screens/RemotesComposerTest.php +++ b/tests/Feature/Screens/RemotesComposerTest.php @@ -228,7 +228,7 @@ function threadWithAda(string $platform = 'ios'): TestableComponent $screen = threadWithAda()->input('message-input', 'on it'); $field = idsDownTo($screen->tree(), 'message-input'); - $rows = childRefs($screen, 'composer-bar'); + $rows = childRefs($screen, 'composer-rows'); expect(nodeByRef($screen, 'message-input')['props']['keep_focus_on_submit'] ?? false)->toBeTrue(); @@ -238,7 +238,7 @@ function threadWithAda(string $platform = 'ios'): TestableComponent // The strip fills a slot the bar always has, so the field's row keeps its place among the bar's rows, which // Android needs as well as the same id to keep the field. expect(idsDownTo($screen->tree(), 'message-input'))->toBe($field) - ->and(childRefs($screen, 'composer-bar'))->toBe($rows); + ->and(childRefs($screen, 'composer-rows'))->toBe($rows); $screen->tap('cancel-reply'); @@ -252,7 +252,7 @@ function threadWithAda(string $platform = 'ios'): TestableComponent expect($withPhotos)->not->toBe($field) ->and(idsDownTo($screen->tree(), 'message-input'))->toBe($withPhotos) - ->and(childRefs($screen, 'composer-bar'))->toBe($rows); + ->and(childRefs($screen, 'composer-rows'))->toBe($rows); }); it('draws one box with the field over the + and a round Push, on both platforms', function (string $platform) { @@ -280,13 +280,25 @@ function threadWithAda(string $platform = 'ios'): TestableComponent $surface = strtoupper(config('native-ui.theme.light.surface')); expect($bar['props']['glass'] ?? null)->toBeNull() - ->and($bar['style']['bg_color'] ?? null)->toBe(config('native-ui.theme.light.surface')) - ->and(childRefs($screen, 'composer-bar')[0])->toBe('mention-slot') + ->and(nodeByRef($screen, 'composer-rows')['style']['bg_color'] ?? null)->toBe(config('native-ui.theme.light.surface')) + ->and(childRefs($screen, 'composer-rows')[0])->toBe('mention-slot') ->and(nodeByRef($screen, 'message-box')['style']['border_width'] ?? 0)->toEqual(0) ->and(nodeByRef($screen, 'message-box')['style']['bg_color'] ?? null)->toBeNull() - ->and(array_slice(childRefs($screen, 'thread-stack'), -1))->toBe(['composer-fade']) ->and($fade['props']['gradient_stops'] ?? null)->toBe('#00'.substr($surface, 1).',#B3'.substr($surface, 1).','.$surface) ->and($fade['layout']['height'] ?? null)->toEqual(Display::ComposerFadeHeight); + + if ($platform === 'ios') { + // The thread runs on under the bar, so the bar draws the fade at its top, and has no background of its own, + // which iOS would paint behind the fade. + expect(childRefs($screen, 'composer-bar'))->toBe(['composer-fade', 'composer-rows']) + ->and($bar['style']['bg_color'] ?? null)->toBeNull() + ->and(childRefs($screen, 'thread-stack'))->not->toContain('composer-fade'); + } else { + // The thread stops at the bar, so the fade lies over its foot, and the bar is the surface. + expect(childRefs($screen, 'composer-bar'))->toBe(['composer-rows']) + ->and($bar['style']['bg_color'] ?? null)->toBe(config('native-ui.theme.light.surface')) + ->and(array_slice(childRefs($screen, 'thread-stack'), -1))->toBe(['composer-fade']); + } })->with(['ios', 'android']); it('fades to the dark surface in dark mode, and draws again when the phone switches', function () { From 18652b82498a538d2e3b25affe29637f5788797a Mon Sep 17 00:00:00 2001 From: Simon Hamp Date: Wed, 18 Nov 2026 00:54:52 +0000 Subject: [PATCH 4/5] Keep every photo picked at once, however old Picking two photos from the library kept only the last. A photo moved into the draft folder keeps its own time, often years ago, and until the draft holds it nothing does, so keeping the second one pruned the first as long forgotten. The kept file's time is now the time it was picked. Co-Authored-By: Claude Opus 5.5 --- app/Devnull/DraftImages.php | 4 ++++ tests/Feature/Screens/RemotesComposerTest.php | 14 ++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/app/Devnull/DraftImages.php b/app/Devnull/DraftImages.php index cf3b3042..852eb88b 100644 --- a/app/Devnull/DraftImages.php +++ b/app/Devnull/DraftImages.php @@ -98,6 +98,10 @@ public function keep(string $path): DraftImage throw new InvalidDraftImage(self::Unreadable); } + // A moved file keeps its own time, which for a photo from the library can be years ago. Until the draft holds + // it, nothing does, so the next photo picked with it would prune it as long forgotten. + @touch($kept); + return new DraftImage($kept, self::Types[$info[2]], $info[0], $info[1]); } diff --git a/tests/Feature/Screens/RemotesComposerTest.php b/tests/Feature/Screens/RemotesComposerTest.php index fcd54ee6..9cc246f3 100644 --- a/tests/Feature/Screens/RemotesComposerTest.php +++ b/tests/Feature/Screens/RemotesComposerTest.php @@ -196,6 +196,20 @@ function threadWithAda(string $platform = 'ios'): TestableComponent expect(nodeByRef($screen, 'attach-photos')['props']['disabled'] ?? false)->toBeTrue(); }); +it('keeps every photo picked at once, however long ago they were taken', function () { + serveThreadWithAda([remoteMessageJson(['id' => 1])], ['read_through_id' => 1]); + + // The library hands photos over with the time they were taken, which a photo nothing holds yet shares with one + // forgotten a day ago. + $picked = [testPhoto(), testPhoto()]; + array_walk($picked, fn (string $path): bool => touch($path, now()->subYears(5)->getTimestamp())); + + $screen = photosPicked(threadWithAda(), $picked); + + expect($screen->instance()->photos)->toHaveCount(2) + ->and(array_filter($screen->instance()->photos, fn ($photo): bool => file_exists($photo->path)))->toHaveCount(2); +}); + it('takes a photo off the draft and the phone with its ✕', function () { serveThreadWithAda([remoteMessageJson(['id' => 1])], ['read_through_id' => 1]); From 44ac045217875044fb8fdcba7480ddc4eb6e5273 Mon Sep 17 00:00:00 2001 From: Simon Hamp Date: Wed, 18 Nov 2026 02:05:24 +0000 Subject: [PATCH 5/5] Put the composer bar on Liquid Glass on iOS, faded in at the top On iOS the thread now shows through the bar, blurred, instead of stopping at a solid surface. The bottom-bar carries glass, and a patched mobile-air draws the glass behind the whole bar, under the home indicator too, faded in over the bar's top 28pt so it has no hard edge. The fade row ends at the glass's tint and the rows tint the glass with the surface at 40%, so in dark mode the bar matches the screen. EDGE's glass on an element can't do this: it draws a rim and lenses the content along its top edge, and it stops above the home indicator, where the thread showed through unblurred. Android is unchanged. Co-Authored-By: Claude Opus 5.5 --- app/Devnull/Display.php | 53 +++++++++++++++---- resources/views/native/conversation.blade.php | 16 +++--- .../native/partials/composer-box.blade.php | 2 +- .../native/partials/composer-fade.blade.php | 11 ++-- tests/Feature/Screens/RemotesComposerTest.php | 30 +++++++---- 5 files changed, 79 insertions(+), 33 deletions(-) diff --git a/app/Devnull/Display.php b/app/Devnull/Display.php index defd42ed..e07528b6 100644 --- a/app/Devnull/Display.php +++ b/app/Devnull/Display.php @@ -36,10 +36,16 @@ final class Display public const int ComposerBoxBarHeight = 94; /** - * The fade over the foot of a screen, just above its composer bar (see partials/composer-fade). + * The fade over the foot of a screen, just above its composer bar (see partials/composer-fade). On iOS the glass + * under the bar fades in over the same height (see composerBarGlass()). */ public const int ComposerFadeHeight = 28; + /** + * How much of the surface, in percent, tints the glass under a composer bar on iOS (see composerSurface()). + */ + public const int ComposerGlassTint = 40; + /** * About how many characters fit on a line of the box's field. It runs the width of the box, so more fit than * beside the reply bar's tools and button. @@ -258,16 +264,23 @@ public static function composerBoxGrowth(string $draft): int } /** - * The fade's classes (see partials/composer-fade): a gradient down from see-through to the surface, where the bar - * starts. EDGE takes a gradient's stops as they are, without the dark companion a theme colour gets, so the stops - * are the surface of the appearance the phone is in now, and a screen with the fade draws again when that - * changes (see RedrawsOnAppearanceChange). It climbs to 70% of the surface by halfway, so what's under it has - * mostly faded before it reaches the bar. + * The fade's classes (see partials/composer-fade): a gradient down from see-through to the bar's surface, where + * the bar's rows start. EDGE takes a gradient's stops as they are, without the dark companion a theme colour gets, + * so the stops are the surface of the appearance the phone is in now, and a screen with the fade draws again when + * that changes (see RedrawsOnAppearanceChange). + * + * On Android it climbs to 70% of the surface by halfway and ends solid, so what's under it has mostly faded before + * it reaches the bar. On iOS it ends at the glass's tint (composerSurface()), since the bar is glass there and the + * glass fades in under it over the same height. */ public static function composerFade(): string { $surface = strtolower((string) theme('surface', '#ffffff')); + if (self::fadesInBar()) { + return "bg-gradient-to-b from-{$surface}/0 to-{$surface}/".self::ComposerGlassTint; + } + return "bg-gradient-to-b from-{$surface}/0 via-{$surface}/70 to-{$surface}"; } @@ -281,17 +294,39 @@ public static function fadesInBar(): bool return Platform::isIos(); } + /** + * The classes for a composer's native:bottom-bar. On iOS that's Liquid Glass: what scrolls under the bar shows + * through it, blurred. A patched mobile-air draws the glass behind the whole bar, under the home indicator too, + * and fades it in over the bar's top ComposerFadeHeight points, so it has no hard top edge. EDGE's own glass on + * an element can't be faded, and stops short of the home indicator. Android has no glass, so the bar stays the + * surface there. + */ + public static function composerBarGlass(): string + { + return self::fadesInBar() ? 'glass' : ''; + } + /** * The composer bar's own classes. On Android it's the surface. On iOS it has no background at all: mobile-air - * paints a bar's background colour behind the whole bar, which would cover what the fade at its top should show, - * so only the bar's rows have the surface (see partials/composer-fade). The strip under the home indicator still - * comes out the surface there, from the scroll view's background running on under it. + * paints a bar's background colour behind the whole bar, which would cover the fade at its top, so the bar's + * rows carry the tint instead (composerSurface()). */ public static function composerBar(): string { return self::fadesInBar() ? '' : 'bg-theme-surface'; } + /** + * The classes for the rows of a composer bar, under its fade. On Android it's the surface. On iOS it's the + * surface at ComposerGlassTint percent, which tints the glass behind the bar to the screen's own colour, so in + * dark mode the bar doesn't come out lighter than the screen. A fill reaches under the home indicator, so the + * tint runs on there with the glass. + */ + public static function composerSurface(): string + { + return self::fadesInBar() ? 'bg-theme-surface/'.self::ComposerGlassTint : 'bg-theme-surface'; + } + /** * About how many lines some text wraps to where $perLine characters fit on one, counting each of its own lines. */ diff --git a/resources/views/native/conversation.blade.php b/resources/views/native/conversation.blade.php index f540820d..e5642545 100644 --- a/resources/views/native/conversation.blade.php +++ b/resources/views/native/conversation.blade.php @@ -78,18 +78,20 @@ @if ($loaded) {{-- - The composer: the field over a row holding the + and the round send button (see partials/composer-box), on - the surface, with the thread fading out above it (see partials/composer-fade) rather than a line or a - blur. The surface also fills the strip under the home indicator. The web's tools, photos, the microphone - and Ping, open from the one +. Above the field sit the people to mention, what you're replying to and the - photos on the draft. While the thread can't take a message, why goes in the field's place. + The composer: the field over a row holding the + and the round send button (see partials/composer-box), + with the thread fading out above it (see partials/composer-fade) rather than meeting a line. On iOS the bar + is Liquid Glass, faded in at the top, so the thread shows through it blurred (see + Display::composerBarGlass()). On Android it's the surface. Either fills the strip under the home indicator. + The web's tools, photos, the microphone and Ping, open from the one +. Above the field sit the people to + mention, what you're replying to and the photos on the draft. While the thread can't take a message, why + goes in the field's place. --}} - + @if (\App\Devnull\Display::fadesInBar()) @include('native.partials.composer-fade', ['ref' => 'composer-fade', 'inBar' => true]) @endif - + @if ($canPush) {{-- The members to mention, what you're replying to and the photos on the draft each keep a slot, diff --git a/resources/views/native/partials/composer-box.blade.php b/resources/views/native/partials/composer-box.blade.php index 4976653f..5cb53133 100644 --- a/resources/views/native/partials/composer-box.blade.php +++ b/resources/views/native/partials/composer-box.blade.php @@ -2,7 +2,7 @@ A composer bar's field, tools and send button, laid out the way the Claude and Messages apps lay theirs out: the field across the top, growing to its five lines, and under it a row with the tools on the left and a round send button in your colour on the right. The same on both platforms. Nothing is drawn around them: they sit straight on - the bar, which is the surface, under the fade the screen lays over its foot (see partials/composer-fade). + the bar, which is glass on iOS and the surface on Android, under the fade at its top (see partials/composer-fade). $ref names the box ("{$ref}-box", also its key, so the field keeps its place as rows above it come and go) and its rows ("{$ref}-field-row", "{$ref}-actions"). $field is the partial that draws the field, keyed itself, so it stays diff --git a/resources/views/native/partials/composer-fade.blade.php b/resources/views/native/partials/composer-fade.blade.php index b7bb3b91..7a817f43 100644 --- a/resources/views/native/partials/composer-fade.blade.php +++ b/resources/views/native/partials/composer-fade.blade.php @@ -1,11 +1,12 @@ {{-- - The soft edge between a screen and its composer bar: a gradient from see-through at the top to the surface at the - bottom, where the bar's rows start, so whatever scrolls down to the bar fades out instead of meeting a hard line. - Its colours come from Display::composerFade(). + The soft edge between a screen and its composer bar: a gradient from see-through at the top to the bar's surface at + the bottom, where the bar's rows start, so whatever scrolls down to the bar fades out instead of meeting a hard + line. Its colours come from Display::composerFade(). Where it goes depends on the platform (Display::fadesInBar()). On iOS the screen runs on under the bar, so the fade - is the bar's first row ($inBar), over what runs under it. On Android the screen stops at the bar, so the fade lies - over the foot of the screen's scroll view, at the bottom of the stack around it. $ref names it. + is the bar's first row ($inBar), over what runs under it, and the bar's glass fades in under it over the same + height (see Display::composerBarGlass()). On Android the screen stops at the bar, so the fade lies over the foot of + the screen's scroll view, at the bottom of the stack around it. $ref names it. --}} @php($inBar ??= false) diff --git a/tests/Feature/Screens/RemotesComposerTest.php b/tests/Feature/Screens/RemotesComposerTest.php index 9cc246f3..637ed790 100644 --- a/tests/Feature/Screens/RemotesComposerTest.php +++ b/tests/Feature/Screens/RemotesComposerTest.php @@ -285,32 +285,40 @@ function threadWithAda(string $platform = 'ios'): TestableComponent ->and(nodeByRef($screen, 'push')['props']['a11y_label'] ?? nodeByRef($screen, 'push')['a11y_label'] ?? null)->toBe('Push'); })->with(['ios', 'android']); -it('puts the bar on the surface with no glass or line, and fades the thread out above it, on both platforms', function (string $platform) { +it('puts the bar on glass on iOS and the surface on Android, with no box or line, and fades the thread out above it', function (string $platform) { serveThreadWithAda([remoteMessageJson(['id' => 1])], ['read_through_id' => 1]); $screen = threadWithAda($platform); + $bottomBar = findNode($screen->tree(), fn (array $node): bool => ($node['type'] ?? null) === 'bottom_bar'); $bar = nodeByRef($screen, 'composer-bar'); $fade = nodeByRef($screen, 'composer-fade'); - $surface = strtoupper(config('native-ui.theme.light.surface')); + $surface = substr(strtoupper(config('native-ui.theme.light.surface')), 1); + $darkSurface = substr(strtoupper(config('native-ui.theme.dark.surface')), 1); expect($bar['props']['glass'] ?? null)->toBeNull() - ->and(nodeByRef($screen, 'composer-rows')['style']['bg_color'] ?? null)->toBe(config('native-ui.theme.light.surface')) ->and(childRefs($screen, 'composer-rows')[0])->toBe('mention-slot') ->and(nodeByRef($screen, 'message-box')['style']['border_width'] ?? 0)->toEqual(0) ->and(nodeByRef($screen, 'message-box')['style']['bg_color'] ?? null)->toBeNull() - ->and($fade['props']['gradient_stops'] ?? null)->toBe('#00'.substr($surface, 1).',#B3'.substr($surface, 1).','.$surface) ->and($fade['layout']['height'] ?? null)->toEqual(Display::ComposerFadeHeight); if ($platform === 'ios') { - // The thread runs on under the bar, so the bar draws the fade at its top, and has no background of its own, - // which iOS would paint behind the fade. - expect(childRefs($screen, 'composer-bar'))->toBe(['composer-fade', 'composer-rows']) + // The thread runs on under the bar, which is glass, so it shows through blurred. The bar draws the fade at its + // top, ending at the glass's tint, and its rows carry the tint, in either appearance. The bar itself has no + // background, which iOS would paint behind the fade. + expect($bottomBar['props']['glass'] ?? null)->toBe(1) + ->and(childRefs($screen, 'composer-bar'))->toBe(['composer-fade', 'composer-rows']) ->and($bar['style']['bg_color'] ?? null)->toBeNull() + ->and(nodeByRef($screen, 'composer-rows')['style']['bg_color'] ?? null)->toBe('#66'.$surface) + ->and(nodeByRef($screen, 'composer-rows')['props']['dark_bg_color'] ?? null)->toBe('#66'.$darkSurface) + ->and($fade['props']['gradient_stops'] ?? null)->toBe('#00'.$surface.',#66'.$surface) ->and(childRefs($screen, 'thread-stack'))->not->toContain('composer-fade'); } else { - // The thread stops at the bar, so the fade lies over its foot, and the bar is the surface. - expect(childRefs($screen, 'composer-bar'))->toBe(['composer-rows']) + // No glass on Android. The thread stops at the bar, so the fade lies over its foot, and the bar is the surface. + expect($bottomBar['props']['glass'] ?? null)->toBeNull() + ->and(childRefs($screen, 'composer-bar'))->toBe(['composer-rows']) ->and($bar['style']['bg_color'] ?? null)->toBe(config('native-ui.theme.light.surface')) + ->and(nodeByRef($screen, 'composer-rows')['style']['bg_color'] ?? null)->toBe(config('native-ui.theme.light.surface')) + ->and($fade['props']['gradient_stops'] ?? null)->toBe('#00'.$surface.',#B3'.$surface.',#'.$surface) ->and(array_slice(childRefs($screen, 'thread-stack'), -1))->toBe(['composer-fade']); } })->with(['ios', 'android']); @@ -319,8 +327,8 @@ function threadWithAda(string $platform = 'ios'): TestableComponent serveThreadWithAda([remoteMessageJson(['id' => 1])], ['read_through_id' => 1]); $screen = threadWithAda(); - $light = strtoupper(config('native-ui.theme.light.surface')); - $dark = strtoupper(config('native-ui.theme.dark.surface')); + $light = substr(strtoupper(config('native-ui.theme.light.surface')), 1); + $dark = substr(strtoupper(config('native-ui.theme.dark.surface')), 1); expect(str_ends_with(nodeByRef($screen, 'composer-fade')['props']['gradient_stops'], $light))->toBeTrue();