From 1d9bcefb4159233dd320c24dfc96bf8c9afa83c7 Mon Sep 17 00:00:00 2001 From: Petri Saarinen Date: Mon, 30 Nov 2026 11:00:53 +0200 Subject: [PATCH] Fix editor colour refresh, task row layout, dark date icons and time cell width - The job editor redraws its customer-coloured header when the board saves a customer colour (customer-color-changed). - Service units and members in the editor's sidebar are in two columns. - Native controls follow the dark theme (color-scheme), so the date picker's calendar icon is light. - Task status, assignee and due date sit side by side in the editor. - Each task in the editor has its checklist, comments and images. - The time sheet's time field shows five characters (00:00). Co-Authored-By: Claude Opus 5.5 --- .../Presentation/Livewire/⚡board.blade.php | 1 + .../Livewire/⚡job-editor.blade.php | 62 ++++++++++++++----- lang/en/jobs.php | 1 + lang/fi/jobs.php | 1 + resources/css/app.css | 9 +++ .../views/components/checkbox-group.blade.php | 4 +- .../components/time/sheet-section.blade.php | 2 +- tests/Browser/JobsAccessibilityTest.php | 2 + tests/Feature/Modules/Jobs/JobEditorTest.php | 24 +++++++ 9 files changed, 89 insertions(+), 17 deletions(-) diff --git a/app/Modules/Jobs/Presentation/Livewire/⚡board.blade.php b/app/Modules/Jobs/Presentation/Livewire/⚡board.blade.php index 08fd041..4bfab05 100644 --- a/app/Modules/Jobs/Presentation/Livewire/⚡board.blade.php +++ b/app/Modules/Jobs/Presentation/Livewire/⚡board.blade.php @@ -387,6 +387,7 @@ new class extends Component } $this->refreshBoard(); + $this->dispatch('customer-color-changed', customerId: $customerId); $this->statusMessage = __('jobs.board.customer_color_saved', ['customer' => $card->customerName ?? '']); } diff --git a/app/Modules/Jobs/Presentation/Livewire/⚡job-editor.blade.php b/app/Modules/Jobs/Presentation/Livewire/⚡job-editor.blade.php index 8cc3a06..6e2b7a5 100644 --- a/app/Modules/Jobs/Presentation/Livewire/⚡job-editor.blade.php +++ b/app/Modules/Jobs/Presentation/Livewire/⚡job-editor.blade.php @@ -130,6 +130,23 @@ new class extends Component return $this->jobId === null ? [] : app(TaskQueries::class)->pinnedTaskIds($this->jobId); } + /** + * The colour picker lives on the board, so the board tells the editor + * when a customer's colour changed; the header colour is read on render. + */ + #[On('customer-color-changed')] + public function customerColorChanged(): void + { + unset($this->job); + } + + #[On('task-comments-changed')] + #[On('task-images-changed')] + public function refreshTasks(): void + { + unset($this->tasks); + } + public function canEdit(): bool { return Gate::allows('jobs.manage'); @@ -436,6 +453,7 @@ new class extends Component $staff = collect($this->users)->reject(fn ($user) => $user->role === Role::Subcontractor); $headerColor = new HexColor($job?->customer->id !== null ? (app(\App\Modules\Customers\Application\Contracts\CustomerQueries::class)->headerColorsByIds([$job->customer->id])[$job->customer->id] ?? '#23476a') : '#23476a'); $fieldClass = 'w-full rounded-lg border border-neutral-400 bg-white px-2.5 py-1.5 text-xs text-neutral-900 focus-visible:outline-2 focus-visible:outline-primary-600 dark:border-[#6b7079] dark:bg-[#24262a] dark:text-white dark:focus-visible:outline-primary-300'; + $controlClass = 'w-auto max-w-full rounded-lg border border-neutral-400 bg-white px-2.5 py-1.5 text-xs text-neutral-900 focus-visible:outline-2 focus-visible:outline-primary-600 dark:border-[#6b7079] dark:bg-[#24262a] dark:text-white dark:focus-visible:outline-primary-300'; $labelClass = 'mb-1 block text-[11px] font-semibold text-neutral-800 dark:text-neutral-100'; $boxClass = 'space-y-2.5 rounded-xl border border-neutral-200 bg-neutral-100 p-3.5 dark:border-[#36393f] dark:bg-[#18191b]'; $boxHeading = 'text-[10px] font-extrabold tracking-wider text-neutral-700 uppercase dark:text-neutral-200'; @@ -598,7 +616,7 @@ new class extends Component @if (Gate::allows('jobs.manage-tasks', [$job->id]) && $this->templates !== [] && $job->status->allowsTasks())
- @foreach ($this->templates as $template) @@ -616,7 +634,7 @@ new class extends Component
    @foreach ($this->tasks as $task) @php($canManageTask = Gate::allows('jobs.manage-tasks', [$job->id])) -
  • +
  • - @foreach (TaskStatus::cases() as $taskStatus) @endforeach - @foreach ($this->users as $user) @endforeach - + @if ($job->status === JobStatus::Ongoing) @php($pinned = $this->pinnedTasks[$task->id] ?? false) -
    - +
    + + + + + + + + +
  • @@ -699,7 +732,7 @@ new class extends Component - @foreach ($this->users as $user) @@ -809,6 +842,7 @@ new class extends Component @endforeach

    {{ __('jobs.editor.units_section') }}

    - +

    {{ __('jobs.fields.tags') }}

    @if ($form->tags !== []) diff --git a/lang/en/jobs.php b/lang/en/jobs.php index e5c1bbe..af7e0e0 100644 --- a/lang/en/jobs.php +++ b/lang/en/jobs.php @@ -308,6 +308,7 @@ return [ ], 'editor' => [ + 'details' => 'Details (comments :comments, images :images)', 'heading' => 'Customer job :number', 'close' => 'Close the card', 'color' => 'Colour', diff --git a/lang/fi/jobs.php b/lang/fi/jobs.php index 085182c..769112b 100644 --- a/lang/fi/jobs.php +++ b/lang/fi/jobs.php @@ -308,6 +308,7 @@ return [ ], 'editor' => [ + 'details' => 'Lisätiedot (kommentit :comments, kuvat :images)', 'heading' => 'Asiakastyö :number', 'close' => 'Sulje kortti', 'color' => 'Väri', diff --git a/resources/css/app.css b/resources/css/app.css index 11f33a0..bceb565 100644 --- a/resources/css/app.css +++ b/resources/css/app.css @@ -60,6 +60,15 @@ html { overflow-y: scroll; } +/* + * Native controls (the date picker's calendar icon and popup, select arrows, + * scrollbars) follow the page theme. html.dark, not .dark: the header always + * carries .dark. + */ +html.dark { + color-scheme: dark; +} + [x-cloak] { display: none !important; } diff --git a/resources/views/components/checkbox-group.blade.php b/resources/views/components/checkbox-group.blade.php index 364a088..b35ae84 100644 --- a/resources/views/components/checkbox-group.blade.php +++ b/resources/views/components/checkbox-group.blade.php @@ -10,7 +10,7 @@ 'model', 'options', 'hint' => null, - 'columns' => true, + 'columns' => true, // true: 2 from sm and 3 from lg; 2: always two; false: one ]) @php @@ -28,7 +28,7 @@

    {{ $hint }}

    @endif -
    $columns])> +
    $columns === 2, 'sm:grid-cols-2 lg:grid-cols-3' => $columns === true])> @foreach ($options as $option)