Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions resources/views/native/guilds.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ class="w-full text-theme-ink"
</native:column>
</native:row>
<native:text class="w-full text-xs text-theme-ink-muted">Search names, #handles, and descriptions.</native:text>
<native:row ref="guilds-create" class="w-full pt-1 gap-3 items-center">
<native:text class="flex-1 text-sm text-theme-ink-muted">Start a public group.</native:text>
{{-- At large text sizes the button moves under the sentence rather than squeezing it. --}}
<native:row ref="guilds-create" class="w-full pt-1 flex-wrap gap-3 items-center justify-between">
<native:text class="text-sm text-theme-ink-muted">Start a public group.</native:text>
<native:button ref="create-guild" variant="secondary" size="sm" :ios-icon="\App\Icons\Lucide::Plus->ios()" :android-icon="\App\Icons\Lucide::Plus->android()" @press="createGuild">Create a guild</native:button>
</native:row>
</native:column>
Expand Down
7 changes: 4 additions & 3 deletions resources/views/native/onboarding.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,12 @@
</native:pressable>
<native:column class="flex-1 gap-1 pt-[10]">
<native:text ref="terms-copy" class="text-[13px] leading-snug text-theme-ink">I agree to the terms of service and privacy policy. There's no tolerance for objectionable content or abusive users.</native:text>
<native:row class="gap-4">
<native:pressable ref="terms-link" @press="openTerms" class="h-[32] justify-center" a11y-label="Read the terms of service">
{{-- At large text sizes the privacy policy moves under the terms rather than being cut off. --}}
<native:row class="flex-wrap">
<native:pressable ref="terms-link" @press="openTerms" class="min-h-[32] mr-4 justify-center" a11y-label="Read the terms of service">
<native:text class="text-[13px] text-theme-primary">Terms of service</native:text>
</native:pressable>
<native:pressable ref="privacy-link" @press="openPrivacy" class="h-[32] justify-center" a11y-label="Read the privacy policy">
<native:pressable ref="privacy-link" @press="openPrivacy" class="min-h-[32] justify-center" a11y-label="Read the privacy policy">
<native:text class="text-[13px] text-theme-primary">Privacy policy</native:text>
</native:pressable>
</native:row>
Expand Down
15 changes: 8 additions & 7 deletions resources/views/native/partials/achievements.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,28 @@
are unlocked, a bar of the way to the next rank in the owner's lane, and the badges. An unlocked badge is a hairline
chip in ink; a locked one is muted, with its progress when it takes more than one step.

Like the web's compact shelf, only earned badges show here. Native rows don't wrap on iOS, so two fit beside
Like the web's compact shelf, only earned badges show here. Only two fit beside
the count of the rest; every badge, locked or earned, is in the sheet (see achievements-sheet). Tapping an earned
badge opens it marked. The empty shelf offers View achievements.
--}}
<native:column ref="achievements" class="w-full py-3 gap-[10] bg-theme-surface" a11y-label="Developer achievements">
<native:pressable ref="achievements-open" @press="openAchievements" class="w-full" a11y-label="{{ $achievements->label() }}, {{ $achievements->xp }} XP, {{ $achievements->unlockedCount() }} of {{ count($achievements->badges) }} badges unlocked" a11y-hint="Shows the achievements">
<native:column class="w-full px-4 gap-[10]">
<native:row class="w-full gap-2 items-center">
<native:icon :ios="\App\Icons\Lucide::Award->ios()" :android="\App\Icons\Lucide::Award->android()" :size="16" class="text-theme-ink" />
<native:text font="mono-medium" class="text-[13px] text-theme-ink flex-shrink" :max-lines="1">{{ $achievements->label() }}</native:text>
<native:spacer />
{{-- At large text sizes the unlocked count moves under the rank rather than being cut off. --}}
<native:row class="w-full flex-wrap gap-2 items-center justify-between">
<native:row class="gap-2 items-center flex-shrink">
<native:icon :ios="\App\Icons\Lucide::Award->ios()" :android="\App\Icons\Lucide::Award->android()" :size="16" class="text-theme-ink" />
<native:text font="mono-medium" class="text-[13px] text-theme-ink flex-shrink" :max-lines="1">{{ $achievements->label() }}</native:text>
</native:row>
<native:row class="gap-1 items-center">
<native:text ref="badges-unlocked" font="mono" class="text-xs text-theme-ink-muted" :max-lines="1">{{ $achievements->unlockedCount() }} / {{ count($achievements->badges) }} unlocked</native:text>
<native:icon :ios="\App\Icons\Lucide::ChevronRight->ios()" :android="\App\Icons\Lucide::ChevronRight->android()" :size="14" class="text-theme-ink-muted" />
</native:row>
</native:row>

<native:column class="w-full gap-1">
<native:row class="w-full items-center">
<native:row class="w-full flex-wrap gap-2 items-center justify-between">
<native:text ref="xp" font="mono" class="text-[11px] text-theme-ink-muted">{{ $achievements->xpLabel() }}</native:text>
<native:spacer />
<native:text ref="next-rank" font="mono" class="text-[11px] text-theme-ink-muted">{{ $achievements->nextRankLabel() }}</native:text>
</native:row>
@include('native.partials.progress-bar', ['ref' => 'level-progress', 'percent' => $achievements->levelProgress, 'fill' => 'bg-theme-'.\App\Devnull\Lane::token($lane), 'label' => "{$achievements->levelProgress}% of the way to the next rank"])
Expand Down
3 changes: 2 additions & 1 deletion resources/views/native/partials/activity.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
@php($gap = $activity->scale === 'year' ? 2 : 3)
@php($summary = $activity->isEmpty() ? 'No commits yet' : \App\Devnull\Display::count($activity->total(), 'commit', 'commits').' '.$activity->window())
<native:column ref="activity" class="w-full px-4 py-5 gap-3 bg-theme-surface">
<native:row class="w-full gap-4 items-center justify-between">
{{-- At large text sizes the summary moves under the heading rather than squeezing beside it. --}}
<native:row class="w-full flex-wrap gap-2 items-center justify-between">
<native:text font="semibold" class="text-sm text-theme-ink">Commit activity</native:text>
@if ($activity->isEmpty())
<native:text class="text-sm text-theme-ink-muted">No commits yet</native:text>
Expand Down
4 changes: 3 additions & 1 deletion resources/views/native/partials/guild-badge.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@

Tapping the pill opens the guild's own screen (see OpensGuilds). A guild's own board
leaves the badge off its commits, since they're all posted there (see Guild).

At large text sizes "· not shown in general logs" moves whole to the next line rather than squeezing.
--}}
@php($guild = $commit->guild)
<native:row ref="guild-badge-{{ $commit->id }}" class="w-full gap-1 items-center">
<native:row ref="guild-badge-{{ $commit->id }}" class="w-full flex-wrap gap-1 items-center">
<native:text class="text-xs text-theme-ink-muted">posted in</native:text>
<native:pressable ref="guild-pill-{{ $commit->id }}" @press="openGuild('{{ $guild->handle }}')" class="flex-row flex-shrink gap-1 items-center rounded-sm bg-theme-wash px-1 py-[2]" a11y-label="{{ $guild->name }}, {{ $guild->hashtag() }}">
@include('native.partials.guild-mark', ['guild' => $guild, 'size' => 14, 'ref' => 'guild-pill-mark-'.$commit->id])
Expand Down
7 changes: 4 additions & 3 deletions resources/views/native/partials/guild-mention.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
A guild mentioned in a commit, as the web's guild mention: the guild's mark (see guild-mark), then its name in
medium mono, in a rounded tag edged with a hairline on the wash, like the "posted in" pill and a bio's tags.
A tap opens the guild. Scaled to $size, the size of the text around it. The tag is a little shorter than a line,
with the rest above and below it, so tags on wrapped lines don't touch.
with the rest above and below it, so tags on wrapped lines don't touch. Its height comes from its name plus
padding, not a fixed number, so it grows with the system text size instead of cutting the name off.
--}}
@php($height = round($size * 1.35))
@php($padding = round($size * 0.1))
@php($mark = round($size * 1.05))
<native:pressable ref="{{ $ref }}" @press="openGuild('{{ $guild->handle }}')" class="flex-shrink-0 py-[2] {{ $space }}" a11y-label="{{ $guild->name }}, {{ $guild->hashtag() }}">
<native:row :height="$height" class="items-center gap-[5] pl-[4] pr-[7] rounded-md border border-theme-hairline bg-theme-wash">
<native:row class="items-center gap-[5] pl-[4] pr-[7] py-[{{ $padding }}] rounded-md border border-theme-hairline bg-theme-wash">
@include('native.partials.guild-mark', ['guild' => $guild, 'size' => $mark, 'ref' => $ref.'-mark'])
<native:text font="mono-medium" :font-size="round($size * 0.93)" class="text-theme-ink" :max-lines="1">{{ $guild->name }}</native:text>
</native:row>
Expand Down
16 changes: 8 additions & 8 deletions resources/views/native/partials/guild-row.blade.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{{--
A guild in the directory, as the web's card shows it: its uploaded icon, or its emoji (see guild-mark). One
you've joined has a mark at the end of its row, apart from anything about moderating it, which doesn't need joining.
you've joined says so after its member count, apart from anything about moderating it, which doesn't need joining.
It sits on that line rather than at the end of the row so the description keeps the row's full width.

Tapped, it opens the guild's screen (see OpensGuilds).
--}}
Expand All @@ -15,12 +16,11 @@
@if ($guild->description !== '')
<native:text class="w-full text-sm text-theme-ink" :max-lines="2">{{ $guild->description }}</native:text>
@endif
<native:text class="text-[13px] text-theme-ink-muted">{{ $members }}</native:text>
</native:column>
{{-- Kept on every row, so a description wraps in the same place whether you've joined or not. --}}
<native:column class="w-[18] self-center">
@if ($guild->isJoined)
<native:icon ref="guild-joined-{{ $guild->handle }}" :ios="\App\Icons\Lucide::UserCheck->ios()" :android="\App\Icons\Lucide::UserCheck->android()" :size="18" class="text-theme-ink-muted" />
@endif
<native:row ref="guild-members-{{ $guild->handle }}" class="w-full flex-wrap gap-1 items-center">
<native:text class="text-[13px] text-theme-ink-muted">{{ $members }}</native:text>
@if ($guild->isJoined)
<native:text ref="guild-joined-{{ $guild->handle }}" class="text-[13px] text-theme-ink-muted">· Joined</native:text>
@endif
</native:row>
</native:column>
</native:pressable>
16 changes: 10 additions & 6 deletions resources/views/native/partials/profile-header.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,12 @@
<native:text font="semibold" class="text-2xl tracking-tight text-theme-ink">{{ $user->name }}</native:text>
{{--
The handle, then what the web marks beside it: Follows you, Muted, and the Unix rank in the
owner's lane. EDGE's rows don't wrap on iOS, so the handle gives way first.
owner's lane. At large text sizes the rank's name gives way first, so the handle stays whole and
the level still shows.
--}}
<native:row ref="profile-handle" class="w-full gap-2 items-center">
<native:column :width="8" :height="8" class="rounded-full bg-theme-{{ \App\Devnull\Lane::token($user->lane()) }} flex-shrink-0" />
<native:text font="mono" class="text-[13px] text-theme-ink-muted flex-shrink" :max-lines="1">{{ $user->handle() }}</native:text>
<native:text font="mono" class="text-[13px] text-theme-ink-muted flex-shrink-0" :max-lines="1">{{ $user->handle() }}</native:text>
@if ($profile->followsYou && ! $sketched)
<native:column class="px-2 py-[2] rounded bg-theme-wash flex-shrink-0">
<native:text class="text-xs text-theme-ink-muted">Follows you</native:text>
Expand All @@ -79,8 +80,11 @@
</native:column>
@endif
@if ($profile->achievements && ! $sketched)
<native:column ref="rank" class="px-2 py-[2] rounded-full border border-theme-{{ \App\Devnull\Lane::token($user->lane()) }}/25 bg-theme-{{ \App\Devnull\Lane::token($user->lane()) }}/10 flex-shrink-0" a11y-label="Level {{ $profile->achievements->level }}, {{ $profile->achievements->rank }}">
<native:text font="mono-medium" class="text-[11px] text-theme-{{ \App\Devnull\Lane::token($user->lane()) }}">{{ $profile->achievements->label() }}</native:text>
<native:column ref="rank" class="px-2 py-[2] rounded-full border border-theme-{{ \App\Devnull\Lane::token($user->lane()) }}/25 bg-theme-{{ \App\Devnull\Lane::token($user->lane()) }}/10 flex-shrink" a11y-label="Level {{ $profile->achievements->level }}, {{ $profile->achievements->rank }}">
<native:row class="items-center">
<native:text font="mono-medium" class="text-[11px] text-theme-{{ \App\Devnull\Lane::token($user->lane()) }} flex-shrink-0">Lv. {{ $profile->achievements->level }}</native:text>
<native:text font="mono-medium" class="text-[11px] text-theme-{{ \App\Devnull\Lane::token($user->lane()) }} flex-shrink" :max-lines="1">{{ "\u{00A0}· ".$profile->achievements->rank }}</native:text>
</native:row>
</native:column>
@endif
</native:row>
Expand Down Expand Up @@ -111,8 +115,8 @@
</native:column>

@if (! $sketched)
{{-- Following and followers open their lists, as the web links them. --}}
<native:row ref="counts" class="w-full gap-4">
{{-- Following and followers open their lists, as the web links them. At large text sizes a count that won't fit moves whole to the next line. --}}
<native:row ref="counts" class="w-full flex-wrap gap-4">
@foreach ([[$profile->commitsCount, 'commit', 'commits', null], [$profile->followingCount, 'following', 'following', 'following'], [$profile->followersCount, 'follower', 'followers', 'followers']] as [$count, $singular, $plural, $list])
@if ($list === null)
<native:row class="gap-1 items-center">
Expand Down
17 changes: 11 additions & 6 deletions resources/views/native/partials/streaks.blade.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
{{-- The streaks under the activity strip, in mono: muted labels, ink numbers, a lane dot before a streak still going. --}}
{{--
The streaks under the activity strip, in mono: muted labels, ink numbers, a lane dot before a streak still going.
At large text sizes the current streak moves whole, separator and all, to the next line rather than squeezing.
--}}
@if ($streaks->longest > 0)
<native:row ref="streaks" class="w-full px-4 py-3 gap-2 items-center bg-theme-surface">
<native:row ref="streaks" class="w-full px-4 py-3 flex-wrap gap-2 items-center bg-theme-surface">
<native:text font="mono" class="text-[13px] text-theme-ink-muted">longest streak <native:text font="mono-medium" class="text-theme-ink">{{ $streaks->longest }}</native:text> {{ $streaks->longest === 1 ? 'day' : 'days' }}</native:text>
@if ($streaks->current > 0)
<native:text font="mono" class="text-[13px] text-theme-ink-muted">·</native:text>
<native:row class="gap-[6] items-center">
<native:column :width="8" :height="8" class="rounded-full bg-theme-{{ \App\Devnull\Lane::token($lane) }}" />
<native:text font="mono" class="text-[13px] text-theme-ink-muted">current <native:text font="mono-medium" class="text-theme-ink">{{ $streaks->current }}</native:text></native:text>
<native:row class="gap-2 items-center">
<native:text font="mono" class="text-[13px] text-theme-ink-muted">·</native:text>
<native:row class="gap-[6] items-center">
<native:column :width="8" :height="8" class="rounded-full bg-theme-{{ \App\Devnull\Lane::token($lane) }}" />
<native:text font="mono" class="text-[13px] text-theme-ink-muted">current <native:text font="mono-medium" class="text-theme-ink">{{ $streaks->current }}</native:text></native:text>
</native:row>
</native:row>
@endif
</native:row>
Expand Down
4 changes: 2 additions & 2 deletions tests/Feature/Screens/GuildsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -280,12 +280,12 @@ function serveGuilds(array $pages): void
expect(app(Account::class)->guildsTabShown())->toBeFalse();
});

it('marks the guilds you have joined at the end of their row', function () {
it('marks the guilds you have joined on their members line', function () {
serveApi(['GET /api/v1/guilds' => [guildsPage([guildJson(['handle' => 'rust', 'is_joined' => true]), guildJson(['handle' => 'go'])])]]);

$screen = finishRefreshes(Native::visit('/guilds'));

expect(nodeByRef($screen, 'guild-rust')['props']['a11y_label'] ?? nodeByRef($screen, 'guild-rust')['a11y_label'] ?? null)->toBe('Rust, #rust, 3 members, joined')
->and(findNode($screen->tree(), fn (array $node): bool => ($node['ref'] ?? null) === 'guild-joined-rust'))->not->toBeNull()
->and(childRefs($screen, 'guild-members-rust'))->toContain('guild-joined-rust')
->and(findNode($screen->tree(), fn (array $node): bool => ($node['ref'] ?? null) === 'guild-joined-go'))->toBeNull();
});