feat(ui): OS-aware search shortcuts and mobile settings titles

Show ⌘K or Ctrl+K by platform in the sidebar and command palette.
Add mobile-only section headers and descriptions on settings layouts.
This commit is contained in:
Andras Bacsai committed 2026-08-05 18:26:24 +02:00
1 parent 5de6f97256
commit d6db943453
11 files changed
+112 -10

No files matched your search

@@ -33,3 +33,25 @@ it('draws a single border between the desktop sidebar and main content', functio
expect($navbar)->toContain('border-r border-neutral-200')
->and($layout)->not->toContain('lg:border-l border-neutral-200');
});
it('shows section titles and descriptions above settings navigation on smaller screens', function (string $view, string $title, string $description) {
$layout = file_get_contents(resource_path("views/components/{$view}"));
$css = file_get_contents(resource_path('css/app.css'));
expect($layout)
->toContain('<header class="settings-mobile-header xl:hidden">')
->toContain("<h1 class=\"settings-mobile-title\">{$title}</h1>")
->toContain("<p class=\"settings-mobile-description\">{$description}</p>")
->toContain('<section class="application-settings-workspace w-full max-w-[1180px]">')
->and($css)
->toContain('.settings-mobile-title')
->toContain('.settings-mobile-description')
->toContain('color: #000000;')
->toContain('.dark .settings-mobile-title')
->toContain('color: #ffffff;');
})->with([
['notification/settings-layout.blade.php', 'Notifications', 'Configure how your team receives deployment and system alerts.'],
['security/settings-layout.blade.php', 'Keys & Tokens', 'Manage SSH keys, cloud credentials, and API access tokens.'],
['settings/layout.blade.php', 'Instance Settings', 'Configure global settings for this Coolify instance.'],
['team/settings-layout.blade.php', 'Team', 'Manage your team, members, and access settings.'],
]);
@@ -57,7 +57,8 @@ test('unsubscribed cloud sidebar does not expose global search', function () {
$response->assertSuccessful();
// Search button is gated; global-search listener markup may still be present.
$response->assertDontSee('title="Search (Press / or ⌘K)"', false);
// Search button is gated; OS-aware title uses Alpine :title, so assert on the trigger instead.
$response->assertDontSee("\$dispatch('open-global-search')", false);
$response->assertDontSee('>Search</span>', false);
});
@@ -0,0 +1,23 @@
<?php
it('uses OS-aware modifier key labels in the global search palette', function () {
$bladeFile = file_get_contents(__DIR__.'/../../resources/views/livewire/global-search.blade.php');
expect($bladeFile)
->toContain('modKeyLabel')
->toContain("return /Mac|iPhone|iPad|iPod/i.test(platform) || /Mac OS X|Macintosh/i.test(ua) ? '⌘' : 'Ctrl+';")
->toContain("x-text=\"modKeyLabel + 'K'\"")
->not->toContain('>⌘K</span>');
});
it('uses OS-aware modifier key labels in the sidebar search trigger', function () {
$bladeFile = file_get_contents(__DIR__.'/../../resources/views/components/navbar.blade.php');
expect($bladeFile)
->toContain('modKeyLabel')
->toContain("return /Mac|iPhone|iPad|iPod/i.test(platform) || /Mac OS X|Macintosh/i.test(ua) ? '⌘' : 'Ctrl+';")
->toContain(":title=\"'Search (Press / or ' + modKeyLabel + 'K)'\"")
->toContain("x-text=\"modKeyLabel + 'K'\"")
->not->toContain('>⌘K</kbd>')
->not->toContain('title="Search (Press / or ⌘K)"');
});