diff --git a/resources/views/components/applications/links.blade.php b/resources/views/components/applications/links.blade.php
index 2c183e254..761d88fed 100644
--- a/resources/views/components/applications/links.blade.php
+++ b/resources/views/components/applications/links.blade.php
@@ -1,4 +1,4 @@
-@props(['application', 'fullWidth' => false])
+@props(['application', 'fullWidth' => false, 'compact' => false])
@php
$hasLinks =
@@ -13,15 +13,22 @@
$linkItemClasses = 'listbox-option justify-start! gap-2.5!';
@endphp
-
$fullWidth]) x-data="{ open: false }"
+
!$compact,
+ 'static' => $compact,
+ 'w-full' => $fullWidth,
+]) x-data="{ open: false }"
x-effect="$dispatch('resource-actions-toggled', { open })" @keydown.escape.window="open = false">
@@ -147,9 +150,6 @@
@endif
-
false])")
+ expect($applicationLinks)->toContain("@props(['application', 'fullWidth' => false, 'compact' => false])")
->toContain('and($serviceLinksComponent)->toContain('public bool $fullWidth = false')
->and($serviceLinks)
@@ -610,25 +610,34 @@ it('visually distinguishes production and pull request application links', funct
->not->toContain("PR{{ data_get(\$preview, 'pull_request_id') }} |");
});
-it('shows application and service Links on mobile headings', function () {
+it('shows application Links as a compact badge beside the mobile status', function () {
$application = file_get_contents(resource_path('views/livewire/project/application/heading.blade.php'));
- $service = file_get_contents(resource_path('views/livewire/project/service/heading.blade.php'));
-
- $mobileApplicationSection = str($application)->between('class="w-full xl:hidden"', 'class="hidden w-full items-center xl:fixed')->toString();
- $mobileServiceSection = str($service)->between('class="w-full md:hidden"', 'class="hidden w-full items-center md:flex')->toString();
-
- expect($mobileApplicationSection)
- ->toContain('toContain('full-width')
- ->toContain('resource-heading-menus')
- ->not->toContain('not->toContain("'label' => 'Settings'");
-
$applicationLinks = file_get_contents(resource_path('views/components/applications/links.blade.php'));
+ $mobileApplicationTitle = str($application)->between('class="mb-3 w-full xl:hidden"', '')->toString();
+ $mobileApplicationActions = str($application)->between('
', '
')->toString();
+
+ expect($mobileApplicationTitle)
+ ->toContain('toContain('toContain('relative flex w-full min-w-0 items-center gap-2')
+ ->toContain('compact')
+ ->not->toContain('full-width');
+
+ expect($mobileApplicationActions)
+ ->not->toContain('toContain("'button w-full justify-between' => \$fullWidth")
- ->toContain("'left-0! right-0! w-full! min-w-0! max-w-none!' => \$fullWidth")
+ ->toContain("'compact' => false")
+ ->toContain("'static' => \$compact")
+ ->toContain("'inline-flex h-6 shrink-0 items-center gap-1.5 rounded-full border border-neutral-200 bg-neutral-100 px-2 text-xs font-medium leading-none text-neutral-700 dark:border-white/[0.12] dark:bg-white/[0.07] dark:text-white' => \$compact")
+ ->toContain('@unless ($compact)')
+ ->toContain("'left-1/2! right-auto! w-[calc(100vw-2rem)]! max-w-md! min-w-0! -translate-x-1/2' => \$compact")
->toContain('between('class="w-full md:hidden"', 'class="hidden w-full items-center md:flex')->toString();
expect($mobileServiceSection)
->toContain('toContain('toContain('No links available');
- // One mobile + one desktop instance.
- expect(substr_count($application, 'toBe(2);
expect(substr_count($service, 'toBe(2);
});