fix(ui): respect sidebar toggle and show application domains

Honor an explicit sidebarCollapsed preference instead of always auto-collapsing with a second nav. Show the primary domain on the application access card, use a persisted GitLab name in the page title after delete, and shrink the compose view switcher.
This commit is contained in:
Andras Bacsai
2026-09-10 08:36:15 +02:00
parent 424dbd36ff
commit fbb569a4b3
8 changed files with 75 additions and 24 deletions
@@ -10,13 +10,18 @@ it('shows internal Docker access details in application general settings', funct
expect($generalSettings)
->toContain('id="access-section" title="Access"')
->toContain('<h3 class="mb-3 text-sm font-semibold text-black dark:text-fg">Public access</h3>')
->toContain("Str::plural('domain', \$domainCount)")
->toContain('Domains, DNS checks, and redirect settings')
->toContain('class="flex items-center gap-3 rounded-lg')
->toContain('class="icon-button ml-auto shrink-0"')
->toContain('aria-label="Manage domains"')
->toContain('<x-reicon name="settings" class="size-4" />')
->not->toContain('<x-reicon name="arrow-right" class="size-3.5" />')
->toContain('$primaryDomain = null;')
->toContain('$additionalDomainCount = max(0, $domainCount - 1);')
->toContain("aria-label=\"{{ \$domainCount > 0 ? 'Manage application domains' : 'Add an application domain' }}\"")
->toContain('{{ $primaryDomain }}')
->toContain("+{{ \$additionalDomainCount }} more {{ Str::plural('domain', \$additionalDomainCount) }}")
->toContain('No public domain configured')
->toContain('Make this application available from a URL')
->toContain("{{ \$domainCount > 0 ? 'Manage domains' : 'Add domain' }}")
->toContain('class="button relative z-10 ml-auto shrink-0"')
->toContain('aria-label="{{ $domainCount > 0 ? \'Manage application domains\' : \'Add an application domain\' }}"')
->toContain('<x-reicon name="arrow-right" class="size-4" />')
->not->toContain('<x-reicon name="settings" class="size-4" />')
->toContain('<livewire:project.application.internal-access')
->not->toContain('wire:init="loadCurrentInternalHostname"')
->and($internalAccessSettings)
@@ -57,6 +57,23 @@ describe('GitLab source setup view', function () {
->assertSet('apiUrl', 'https://gitlab.example.com/api/v4');
});
test('redirects without rendering an error after the gitlab app is deleted', function () {
Livewire::withQueryParams(['gitlab_app_uuid' => $this->gitlabApp->uuid])
->test(Change::class)
->call('delete')
->assertRedirect(route('source.all'));
$this->assertModelMissing($this->gitlabApp);
});
test('uses the persisted name for the title during a post-delete update', function () {
$view = file_get_contents(resource_path('views/livewire/source/gitlab/change.blade.php'));
expect($view)
->toContain("{{ \$name ?: 'GitLab App' }} | Sources | Coolify")
->not->toContain("{{ \$gitlab_app->name ?: 'GitLab App' }} | Sources | Coolify");
});
test('saves and reloads the application secret after refresh', function () {
Livewire::withQueryParams(['gitlab_app_uuid' => $this->gitlabApp->uuid])
->test(Change::class)
@@ -12,6 +12,8 @@ it('provides grid and table views for compose resources without sorting controls
->toContain('aria-label="Grid view"')
->toContain('mb-3 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between')
->toContain('flex w-full items-center justify-between gap-2 sm:w-auto sm:justify-start')
->toContain('flex h-8 items-center rounded-lg border border-neutral-200 bg-white')
->not->toContain('flex h-9 items-center rounded-lg border border-neutral-200 bg-white')
->toContain("localStorage.setItem('service-compose-resources-view', mode)")
->not->toContain('>Sort</button>')
->and($resourceCard)
@@ -27,8 +27,10 @@ it('initializes persisted sidebar state before enabling layout transitions', fun
$layout = file_get_contents(resource_path('views/layouts/app.blade.php'));
expect($layout)
->toContain("hasSidebarPreference: localStorage.getItem('sidebarCollapsed') !== null")
->toContain("userCollapsed: localStorage.getItem('sidebarCollapsed') === 'true'")
->toContain('return this.userCollapsed || (this.autoCollapse && this.hasSecondBar);')
->toContain('return this.hasSidebarPreference ? this.userCollapsed : (this.autoCollapse && this.hasSecondBar);')
->toContain('this.hasSidebarPreference = true;')
->toContain('this.userCollapsed = this.collapsed;')
->toContain("localStorage.setItem('sidebarCollapsed', this.userCollapsed);")
->toContain('sidebarReady: false')