fix: reorganize data loading and auto-refresh logic in SiteDashboardP… #25

Merged
uz1mani merged 1 commits from staging into main 2026-02-12 08:02:48 +00:00
uz1mani commented 2026-02-12 08:00:24 +00:00 (Migrated from github.com)

fix: reorganize data loading and auto-refresh logic in SiteDashboardPage for improved clarity and maintainability

fix: reorganize data loading and auto-refresh logic in SiteDashboardPage for improved clarity and maintainability
greptile-apps[bot] commented 2026-02-12 08:01:48 +00:00 (Migrated from github.com)

Greptile Overview

Greptile Summary

This PR reorganizes the placement of the auto-refresh useEffect hook in SiteDashboardPage, moving it from line 130 to line 209 (after the loadData and loadRealtime callback definitions). This is a code maintainability improvement that groups the effect closer to the callbacks it depends on, making the code easier to understand.

Key changes:

  • Moved auto-refresh useEffect hook to appear after loadData and loadRealtime callbacks
  • No functional changes - dependencies, logic, and behavior remain identical
  • Improved code organization by placing the effect near the functions it uses

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The change is purely organizational - moving a useEffect hook without modifying its logic, dependencies, or behavior. The hook still has the same dependencies ([siteId, dateRange, todayInterval, multiDayInterval, isSettingsLoaded, loadData, loadRealtime]) and executes the same logic. Moving it after the callback definitions it depends on is actually a best practice improvement.
  • No files require special attention

Important Files Changed

Filename Overview
app/sites/[id]/page.tsx Repositioned auto-refresh effect hook after callback definitions for better code organization - no functional changes
<h2>Greptile Overview</h2> <h3>Greptile Summary</h3> This PR reorganizes the placement of the auto-refresh `useEffect` hook in `SiteDashboardPage`, moving it from line 130 to line 209 (after the `loadData` and `loadRealtime` callback definitions). This is a code maintainability improvement that groups the effect closer to the callbacks it depends on, making the code easier to understand. **Key changes:** - Moved auto-refresh `useEffect` hook to appear after `loadData` and `loadRealtime` callbacks - No functional changes - dependencies, logic, and behavior remain identical - Improved code organization by placing the effect near the functions it uses <h3>Confidence Score: 5/5</h3> - This PR is safe to merge with minimal risk - The change is purely organizational - moving a useEffect hook without modifying its logic, dependencies, or behavior. The hook still has the same dependencies ([siteId, dateRange, todayInterval, multiDayInterval, isSettingsLoaded, loadData, loadRealtime]) and executes the same logic. Moving it after the callback definitions it depends on is actually a best practice improvement. - No files require special attention <details><summary><h3>Important Files Changed</h3></summary> | Filename | Overview | |----------|----------| | app/sites/[id]/page.tsx | Repositioned auto-refresh effect hook after callback definitions for better code organization - no functional changes | </details> </details>
Sign in to join this conversation.
No description provided.