From 4e3def11e32ab6e5454c091d0aac58c07dfb11b0 Mon Sep 17 00:00:00 2001
From: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com>
Date: Wed, 12 Aug 2026 11:51:42 +0200
Subject: [PATCH] fix(ui): expose environment variable settings on mobile
Collapse environment variable rows to the key and settings action on small
screens, and let the key open the corresponding details modal.
---
resources/css/app.css | 25 +++++++++++++++++++
.../show-hardcoded.blade.php | 9 +++++--
.../environment-variable/show.blade.php | 10 +++++---
.../EnvironmentVariableTableLayoutTest.php | 13 ++++++++--
4 files changed, 50 insertions(+), 7 deletions(-)
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");
});