Repository navigation
feat: add plant overview header and live line states to the dashboard - #379
Merged
Merged
Conversation
Foundation for the "Plant overview" dashboard rebuild. - PlantOverviewService: current plant shift via ShiftWindow (fallback window flagged is_default) and per-line state (running / idle / blocked / down) with since, reason and source (machine / manual), in a fixed number of queries regardless of line count, constrained to tenant-scoped lines. - ShiftMonitorService::currentStates(): open state + open stop per station, without board()'s counters/OEE. Existing payloads unchanged. - DashboardController: new lazy `overview` prop; existing props untouched. - Dashboard.jsx: new header (title, Live dot, shift and time left, "+ New work order" for users with the orders tab), empty section registry + grid under components/dashboard/overview, 60 s partial reload of `overview` while the tab is visible (dot greys on failure). Existing widgets and line filter moved under a "Last 30 days" heading. - fix: OEE overview widget matched "today" by the UTC date; it now uses the plant date (todayInPlant) and tolerates datetime-shaped record_date. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are limited based on label configuration. 🏷️ Required labels (at least one): 1
Please check the settings in the CodeRabbit UI or the
|
jakub-przepiora
marked this pull request as ready for review
October 25, 2026 09:33
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The admin dashboard had no at-a-glance view of the current shift or of what each line is doing right now. This adds the foundation of the "Plant overview" redesign.
Why
The redesign needs a shared base before individual sections are built: a single source for the current shift and for per-line state, and a page layout that sections can be added to without merge conflicts.
PlantOverviewServiceis the single source for shift and line state. It is separate from the controller, reusesShiftWindowfor shifts and extendsShiftMonitorServicewith a new method only.running,idle,blockedordown.LineStatusis deliberately not used.new Date().toISOString()returns the UTC date, which is wrong around midnight for plants outside UTC.How it was verified
Laravel feature tests in
tests/Feature/Web/DashboardPlantOverviewTest.php:overviewprop returns{ shift, lines }.tab:dashboardis redirected as before.orderstab being absent is covered.overview.Click-through demo recorded by an independent QA agent on a fresh instance. The demo video will be added in a follow-up comment.
Review notes
en.jsonandpl.json.GET /api/v1/admin/dashboard, the shared synced collections,OeeGauge,OeeCalculationServiceand the existingShiftMonitorServicepayloads are untouched. Only one method was added toShiftMonitorService.Math.roundor "2 h 59 min".ShiftMonitorService::currentStates(), once inPlantOverviewService). This is one extra query and the count stays fixed.currentStates()keeps only the latest open stop per station. An older open stop on a station that reports machine data is dropped, so its reason is never shown. It is rare, and needs documenting or a test.needs_reason, unlike FAULT and STOPPED.useOverviewRefresh.js, thestarthandler skips settingvisitingwhen navigation begins during a background refresh. It is harmless, but the comment promises more than the code does.🤖 Generated with Claude Code