diff --git a/resources/css/app.css b/resources/css/app.css index 67562aa08..67989a000 100644 --- a/resources/css/app.css +++ b/resources/css/app.css @@ -2026,6 +2026,31 @@ input[type="search"]::-webkit-search-results-decoration { grid-template-columns: minmax(14rem, 2.5fr) 4.8rem 4rem 4.5rem 4.8rem 4.2rem 3rem; } +@media (max-width: 768px) { + .environment-table-scroll .env-table-grid { + min-width: 0; + } + + .data-table-header.env-table-grid { + display: none; + } + + .data-table-row.env-table-grid { + grid-template-columns: minmax(0, 1fr) auto; + gap: 0.75rem; + padding: 0.75rem 1rem; + } + + .data-table-row.env-table-grid > :not(:first-child):not(:last-child) { + display: none; + } + + .data-table-row.env-table-grid > :last-child { + display: block; + justify-self: end; + } +} + /* Shared variables only store value shape (multiline), not per-resource flags. */ .env-table-grid-shared { grid-template-columns: minmax(0, 1.6fr) 6rem minmax(0, 1fr) 4.5rem 3rem; diff --git a/resources/views/livewire/project/shared/environment-variable/show-hardcoded.blade.php b/resources/views/livewire/project/shared/environment-variable/show-hardcoded.blade.php index 301a4f882..84d03c0fe 100644 --- a/resources/views/livewire/project/shared/environment-variable/show-hardcoded.blade.php +++ b/resources/views/livewire/project/shared/environment-variable/show-hardcoded.blade.php @@ -2,7 +2,12 @@ x-show="typeof envFilter === 'undefined' || envFilter === 'all' || envFilter === '{{ $isPreview ? 'preview' : 'production' }}'">
- {{ $key }} + @if (filled($comment)) @endif @@ -26,7 +31,7 @@
- diff --git a/resources/views/livewire/project/shared/environment-variable/show.blade.php b/resources/views/livewire/project/shared/environment-variable/show.blade.php index 134f55589..eaa680bbc 100644 --- a/resources/views/livewire/project/shared/environment-variable/show.blade.php +++ b/resources/views/livewire/project/shared/environment-variable/show.blade.php @@ -24,8 +24,12 @@ @endif - {{ $env->key }} + @if (! $isSharedVariable && filled($comment)) @endif @@ -84,7 +88,7 @@ - diff --git a/tests/Feature/EnvironmentVariableTableLayoutTest.php b/tests/Feature/EnvironmentVariableTableLayoutTest.php index f3bcccad3..7402fc350 100644 --- a/tests/Feature/EnvironmentVariableTableLayoutTest.php +++ b/tests/Feature/EnvironmentVariableTableLayoutTest.php @@ -80,16 +80,25 @@ test('resource environment variables table has a Managed column and no name-cell expect($show)->toContain(''); }); -test('resource environment variables table remains horizontally scrollable on mobile', function () { +test('resource environment variables expose their settings action without horizontal scrolling on mobile', function () { $view = file_get_contents(resource_path('views/livewire/project/shared/environment-variable/all.blade.php')); + $show = file_get_contents(resource_path('views/livewire/project/shared/environment-variable/show.blade.php')); + $hardcoded = file_get_contents(resource_path('views/livewire/project/shared/environment-variable/show-hardcoded.blade.php')); $css = file_get_contents(resource_path('css/app.css')); expect($view) ->toContain('environment-table-scroll') + ->and($show) + ->toContain('data-env-name-trigger') + ->toContain('data-env-settings-trigger') + ->and($hardcoded) + ->toContain('data-env-name-trigger') + ->toContain('data-env-settings-trigger') ->and($css) ->toContain(".environment-table-scroll {\n overflow-x: auto;") ->toContain(".environment-table-scroll .env-table-grid {\n min-width: 53rem;") - ->not->toContain('.data-table-row.env-table-grid > :nth-child') + ->toContain('.data-table-header.env-table-grid') + ->toContain('.data-table-row.env-table-grid > :last-child') ->not->toContain(".env-type-desktop {\n display: none"); });