From 63f26aefd91aaf1879829095fba56b364448bc9c Mon Sep 17 00:00:00 2001 From: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com> Date: Wed, 16 Sep 2026 13:51:18 +0200 Subject: [PATCH] feat(previews): move pull request settings into a modal Add pull request loading, refreshing, and deployment controls to the preview settings modal, simplify modal subtitles, and update sponsor listings. --- README.md | 8 ++ .../configuration-sidebar.blade.php | 3 - .../views/components/modal-input.blade.php | 11 +- .../project/application/previews.blade.php | 123 +++++++++--------- .../ApplicationPreviewSettingsTest.php | 15 +++ tests/Feature/ModalScrollLockTest.php | 10 ++ .../ResourceHeadingUnifiedNavbarTest.php | 8 +- 7 files changed, 103 insertions(+), 75 deletions(-) diff --git a/README.md b/README.md index ee4028d6a0..97fcc2ce0f 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,9 @@ Thank you so much! ### Huge Sponsors +* [CubePath](https://cubepath.com/coolify) - Premium dedicated servers and cloud VPS hosting * [Context.dev](https://www.context.dev/) - Web scraping API for AI agents +* [Ginernet](https://ginernet.com/) - Hosting powerful servers in Spain * [SerpAPI](https://serpapi.com) - Google Search API — Scrape Google and other search engines from our fast, easy, and complete API. * [MVPS](https://www.mvps.net) - Cheap VPS servers at the highest possible quality * [ScreenshotOne](https://screenshotone.com) - Screenshot API for devs @@ -67,6 +69,7 @@ Thank you so much! ### Big Sponsors +* [Vanaways](https://www.vanaways.co.uk) - New vans for sale and lease across the UK * [Cloudways](https://www.cloudways.com/en/?id=2125302) - Managed cloud hosting platform by DigitalOcean * [ByteBase](https://www.bytebase.com) - Database CI/CD and Security at Scale * [Ramnode](https://ramnode.com/) - High Performance Cloud VPS Hosting @@ -105,6 +108,9 @@ Thank you so much! ### Small Sponsors +DarkVPS +Open Source Alternatives +Onserva Movavi ABXY LaunchFast Boilerplates @@ -133,6 +139,8 @@ Thank you so much! Cirun Puls Digital Group Jonathan Pereira +OutboundGateway +T4DT GmbH Internet Garden Evercam Web3 Jobs diff --git a/resources/views/components/application/configuration-sidebar.blade.php b/resources/views/components/application/configuration-sidebar.blade.php index 9a1405affb..5ac9f1f3dc 100644 --- a/resources/views/components/application/configuration-sidebar.blade.php +++ b/resources/views/components/application/configuration-sidebar.blade.php @@ -204,9 +204,6 @@ ], 'project.application.preview-deployments' => array_values(array_filter([ ['id' => 'preview-template-section', 'label' => 'URL template'], - $application->is_github_based() - ? ['id' => 'preview-pull-requests-section', 'label' => 'Pull requests'] - : null, $application->build_pack === 'dockerimage' ? ['id' => 'manual-preview-section', 'label' => 'Manual preview'] : null, diff --git a/resources/views/components/modal-input.blade.php b/resources/views/components/modal-input.blade.php index f5ba4417fb..58f70ab206 100644 --- a/resources/views/components/modal-input.blade.php +++ b/resources/views/components/modal-input.blade.php @@ -62,16 +62,9 @@ style="box-shadow: 0 0 0 1px var(--coollabs-hairline), var(--shadow-modal)">
+

{{ $title }}

@if ($subtitle) -

- - - {{ $title }} - - -

- @else -

{{ $title }}

+

{{ $subtitle }}

@endif
@isset($headerActions) diff --git a/resources/views/livewire/project/application/previews.blade.php b/resources/views/livewire/project/application/previews.blade.php index 54c8b9dfd3..36280e873b 100644 --- a/resources/views/livewire/project/application/previews.blade.php +++ b/resources/views/livewire/project/application/previews.blade.php @@ -7,6 +7,70 @@ helper="Automatic pull request deployments and who can trigger them."> @can('update', $application) + @if ($application->is_github_based()) + + + + Load pull requests + + + + @isset($rate_limit_remaining) + + {{ $rate_limit_remaining }} requests remaining + + @endisset + + Refresh + + + +
+ +
+ +
+ @forelse ($pull_requests as $pull_request) +
+
+ #{{ data_get($pull_request, 'number') }} +
+
+

+ {{ data_get($pull_request, 'title') }} +

+ + Open on GitHub + + +
+
+ + Configure + + @can('deploy', $application) + + Deploy preview + + @endcan +
+
+ @empty + + @endforelse +
+
+ @endif @if ($isPreviewDeploymentsEnabled) Disable preview deployments @@ -39,65 +103,6 @@ @endif - @if ($application->is_github_based()) - - - @isset($rate_limit_remaining) - - {{ $rate_limit_remaining }} requests remaining - - @endisset - @can('update', $application) - - Load pull requests - - @endcan - - -
- @forelse ($pull_requests as $pull_request) -
-
- #{{ data_get($pull_request, 'number') }} -
-
-

- {{ data_get($pull_request, 'title') }} -

- - Open on GitHub - - -
-
- @can('update', $application) - - Configure - - @endcan - @can('deploy', $application) - - Deploy preview - - @endcan -
-
- @empty - - @endforelse -
-
- @endif - @if ($application->build_pack === 'dockerimage') diff --git a/tests/Feature/ApplicationPreviewSettingsTest.php b/tests/Feature/ApplicationPreviewSettingsTest.php index e5f69f4ee1..a11ed783ec 100644 --- a/tests/Feature/ApplicationPreviewSettingsTest.php +++ b/tests/Feature/ApplicationPreviewSettingsTest.php @@ -117,6 +117,21 @@ it('renders preview deployment enablement as a section action', function () { expect($this->application->fresh()->settings->is_preview_deployments_enabled)->toBeTrue(); }); +it('renders GitHub pull requests in a modal opened from the preview settings', function () { + $view = file_get_contents(resource_path('views/livewire/project/application/previews.blade.php')); + $sidebar = file_get_contents(resource_path('views/components/application/configuration-sidebar.blade.php')); + + expect($view) + ->toContain('toContain(':isLarge="true"') + ->toContain('wire:click="load_prs"') + ->not->toContain('id="preview-pull-requests-section"') + ->and(strpos($view, 'toBeLessThan(strpos($view, 'not->toContain("['id' => 'preview-pull-requests-section', 'label' => 'Pull requests']"); +}); + it('does not show git preview settings for non-git applications', function (string $buildPack, ?string $dockerfile) { $this->application->update(['build_pack' => $buildPack, 'dockerfile' => $dockerfile]); diff --git a/tests/Feature/ModalScrollLockTest.php b/tests/Feature/ModalScrollLockTest.php index 18d69d20a6..1cd9770f29 100644 --- a/tests/Feature/ModalScrollLockTest.php +++ b/tests/Feature/ModalScrollLockTest.php @@ -17,6 +17,16 @@ test('input modal overlay is fixed to the viewport without its own page scrollba ->not->toContain('class="fixed inset-0 z-99 overflow-y-auto"'); }); +test('input modal renders its subtitle as static text instead of a tooltip', function () { + $html = Blade::render('Modal content'); + + expect($html) + ->toContain('Load repository pull requests.') + ->toContain('text-xs text-neutral-500 dark:text-fg-dim') + ->not->toContain('More information about Pull requests') + ->not->toContain('role="tooltip"'); +}); + test('confirmation modal closes before dispatching an event that can open another modal', function () { $modal = file_get_contents(resource_path('views/components/modal-confirmation.blade.php')); diff --git a/tests/Feature/ResourceHeadingUnifiedNavbarTest.php b/tests/Feature/ResourceHeadingUnifiedNavbarTest.php index 7b3f825758..838f665dc9 100644 --- a/tests/Feature/ResourceHeadingUnifiedNavbarTest.php +++ b/tests/Feature/ResourceHeadingUnifiedNavbarTest.php @@ -441,14 +441,14 @@ it('centers the rollback image loading state across the card', function () { ->toContain('flex items-center justify-center'); }); -it('shows pull request loading feedback only on the action button', function () { +it('shows pull request loading feedback in the modal body', function () { $previews = file_get_contents(resource_path('views/livewire/project/application/previews.blade.php')); expect($previews) ->toContain('wire:click="load_prs"') - ->not->toContain('wire:loading.remove wire:target="load_prs"') - ->not->toContain('wire:loading wire:target="load_prs"') - ->not->toContain('Loading pull requests…'); + ->toContain('wire:loading.remove wire:target="load_prs"') + ->toContain('wire:loading wire:target="load_prs"') + ->toContain('Loading pull requests…'); }); it('shows loading feedback while a service deployment starts', function () {