Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Refactor deployment indicator to use server-side route detection
Replace client-side JavaScript URL checking with Laravel's routeIs() for determining when to reduce indicator opacity. This simplifies the code and uses route names as the source of truth.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
  • Loading branch information
andrasbacsai and claude committed Dec 11, 2025
commit c6a89087c52412d64679ba9c4ed4d0dee94c2948
6 changes: 6 additions & 0 deletions app/Livewire/DeploymentsIndicator.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ public function deploymentCount()
return $this->deployments->count();
}

#[Computed]
public function shouldReduceOpacity(): bool
{
return request()->routeIs('project.application.deployment.*');
}

public function toggleExpanded()
{
$this->expanded = ! $this->expanded;
Expand Down
11 changes: 2 additions & 9 deletions resources/views/livewire/deployments-indicator.blade.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
<div wire:poll.3000ms x-data="{
expanded: @entangle('expanded'),
isDeploymentPage: false,
checkPage() {
this.isDeploymentPage = window.location.pathname.includes('/deployment');
},
init() {
this.checkPage();
document.addEventListener('livewire:navigated', () => this.checkPage());
}
reduceOpacity: @js($this->shouldReduceOpacity)
}" class="fixed bottom-0 z-60 mb-4 left-0 lg:left-56 ml-4">
@if ($this->deploymentCount > 0)
<div class="relative transition-opacity duration-200"
:class="{ 'opacity-100': expanded || !isDeploymentPage, 'opacity-60 hover:opacity-100': isDeploymentPage && !expanded }">
:class="{ 'opacity-100': expanded || !reduceOpacity, 'opacity-60 hover:opacity-100': reduceOpacity && !expanded }">
<!-- Indicator Button -->
<button @click="expanded = !expanded"
class="flex items-center gap-2 px-4 py-2 rounded-lg shadow-lg transition-all duration-200 dark:bg-coolgray-100 bg-white dark:border dark:border-coolgray-200 hover:shadow-xl">
Expand Down