diff --git a/resources/views/native/partials/commit-sheet.blade.php b/resources/views/native/partials/commit-sheet.blade.php index 67e43903..83f746db 100644 --- a/resources/views/native/partials/commit-sheet.blade.php +++ b/resources/views/native/partials/commit-sheet.blade.php @@ -91,8 +91,12 @@ @php($offersIssues = ! $quoting && ! $scheduling && ! $replying && ! $issueCommand && $sheetGuild === null) @php($issueCommands = $offersIssues && $sheetTyped ? \App\Devnull\IssueCommand::suggested($sheetBody) : []) @php($issueHint = $offersIssues && ! $issueHintsDismissed ? \App\Devnull\IssueCommand::hinted($sheetBody) : null) - @php($hasAbove = $postsAs || $sheetError || $issueCommand || $replying) + @php($hasAbove = $guildHint || $postsAs || $sheetError || $issueCommand || $replying) + @if ($guildHint) + Posted to this guild, not your profile log. + @endif + @if ($postsAs) @include('native.partials.post-as', ['ref' => 'sheet-post-as', 'me' => $postingMe, 'picked' => $sheetAuthor, 'method' => 'postAsInSheet', 'size' => 36, 'withName' => true]) @@ -154,12 +158,8 @@ class="w-full h-full text-theme-ink" a11y-label="Your commit" /> - @php($hasBelow = $guildHint || $linkTooLong || $sheetImages !== [] || $pollShown || $quoting || $scheduling || $issueCommands !== [] || $issueHint !== null) + @php($hasBelow = $linkTooLong || $sheetImages !== [] || $pollShown || $quoting || $scheduling || $issueCommands !== [] || $issueHint !== null) - @if ($guildHint) - Posted to this guild, not your profile log. - @endif - @if ($linkTooLong) Each link must not be greater than {{ \App\Devnull\Data\BodyLink::MaxLength }} characters. @endif diff --git a/tests/Feature/Screens/GuildPostTest.php b/tests/Feature/Screens/GuildPostTest.php index 30091fdb..df75584a 100644 --- a/tests/Feature/Screens/GuildPostTest.php +++ b/tests/Feature/Screens/GuildPostTest.php @@ -93,6 +93,11 @@ function pressEditOnToast(TestableComponent $screen, int $writeId): TestableComp expect(nodeByRef($screen, 'sheet')['props']['visible'])->toBeTrue() ->and(nodeByRef($screen, 'sheet-body')['props']['placeholder'])->toBe('What do you want to share with the guild?') + // At the top, under the sheet's bar, with the same gap above it as between it and the field. + ->and(childRefs($screen, 'sheet-above')[0] ?? null)->toBe('sheet-guild-hint') + ->and(nodeByRef($screen, 'sheet-above')['layout']['padding'][0])->toEqual(nodeByRef($screen, 'sheet-field-slot')['layout']['padding'][0]) + ->and(nodeByRef($screen, 'sheet-above')['layout']['padding'][2] ?? 0)->toEqual(0) + ->and(childRefs($screen, 'sheet-below'))->not->toContain('sheet-guild-hint') ->and(app(Stash::class)->get($this->userId, 'guild:rust')->body)->toBe('Crabs ahoy.') ->and(app(Stash::class)->get($this->userId, 'commit')->body)->toBe('');