Skip to content

Conversation

@bansalhimanshu0296
Copy link

@bansalhimanshu0296 bansalhimanshu0296 commented Oct 17, 2025

Describe your changes

###Summary:
This PR introduces a new feature that allows users to toggle and view a Response Time Chart for monitors on the public status page. It adds both frontend and backend support to manage the visibility of this chart.
Key Changes:
🖥️ Frontend Updates

  • Added ResponseTimeChart component integration
    • Imported and rendered the new chart in MonitorsList under each monitor (visible if showResponseTimeChart is enabled).
    • Connected to useFetchUptimeMonitorById for fetching groupedChecks data.
  • Created configuration toggle
    • Added new checkbox showResponseTimeChart in Status Page → Create/Edit → Features tab (Content.jsx).
    • Updated Create/index.jsx form state and submission logic to include showResponseTimeChart.
  • Form & validation
    • Extended NetworkService.js to include showResponseTimeChart in API form submission.
    • Added Joi validation for showResponseTimeChart in validation.js.
  • Localization
    • Added "showResponseTimeChart" key across all locale files (EN, DE, FR, PT-BR, etc.) for internationalization support.
  • UI Components
    • Refactored and fixed naming in ResponseTimeChart component (typo fix from ResponseTImeChart → ResponseTimeChart).
    • Added skeleton loader for loading states.

⚙️ Backend Updates

  • Database Schema
    • Added showResponseTimeChart field to StatusPage Mongoose schema with default true.
  • Modules & Data Flow
    • Updated statusPageModule.js to:
      • Include showResponseTimeChart in both creation and response payloads.
      • Preserve the value across status page reads/writes.
  • Validation
    • Added showResponseTimeChart to Joi validation in server/src/validation/joi.js.
  • User Impact:
    • User can now choose whether to show a response time chart on their public status page.
    • End users viewing the status page will see an additional visualization of response time trends (if enabled).
Screen.Recording.2025-10-17.at.12.00.17.AM-2.mov

Write your issue number after "Fixes "

Fixes #2924

Please ensure all items are checked off before requesting a review. "Checked off" means you need to add an "x" character between brackets so they turn into checkmarks.

  • (Do not skip this or your PR will be closed) I deployed the application locally.
  • (Do not skip this or your PR will be closed) I have performed a self-review and testing of my code.
  • I have included the issue # in the PR.
  • I have added i18n support to visible strings (instead of <div>Add</div>, use):
const { t } = useTranslation();
<div>{t('add')}</div>
  • I have not included any files that are not related to my pull request, including package-lock and package-json if dependencies have not changed
  • I didn't use any hardcoded values (otherwise it will not scale, and will make it difficult to maintain consistency across the application).
  • I made sure font sizes, color choices etc are all referenced from the theme. I don't have any hardcoded dimensions.
  • My PR is granular and targeted to one specific feature.
  • I ran npm run format in server and client directories, which automatically formats your code.
  • I took a screenshot or a video and attached to this PR if there is a UI change.

Summary by CodeRabbit

  • Bug Fixes

    • Fixed a component naming typo affecting chart rendering.
  • New Features

    • Per-monitor response time charts with date-range support.
    • Added a "Show Response Time Chart" toggle (enabled by default); setting is persisted and served by the backend.
  • Localization

    • Added translations for the response time chart option across multiple locales.

@coderabbitai
Copy link

coderabbitai bot commented Oct 17, 2025

Walkthrough

Adds showResponseTimeChart end-to-end: UI toggle, form state, submission, client/server validation, DB schema, locale entries, per-monitor conditional ResponseTimeChart rendering, and renames/prop rename of the ResponseTimeChart component to use monitorIsLoading.

Changes

Cohort / File(s) Summary
Chart Component Rename & Prop Change
client/src/Components/v1/Charts/ResponseTimeChart/ResponseTimeChart.jsx
Renamed component ResponseTImeChartResponseTimeChart; prop renamed isLoadingmonitorIsLoading; updated PropTypes, import path, and default export.
Status Page Create UI & Flow
client/src/Pages/v1/StatusPage/Create/Components/Tabs/Content.jsx, client/src/Pages/v1/StatusPage/Create/index.jsx
Added showResponseTimeChart checkbox to features UI, integrated into form state (default true), included in tab/error mapping, and persisted via form submit/load.
Monitors List & Per-monitor Charts
client/src/Pages/v1/StatusPage/Status/Components/MonitorsList/index.jsx
Introduced MonitorListItem component, per-monitor fetch (useFetchUptimeMonitorById), and conditional ResponseTimeChart rendering based on statusPage.showResponseTimeChart.
Uptime Details Import Update
client/src/Pages/v1/Uptime/Details/index.jsx
Updated ResponseTimeChart import path and call site to pass monitorIsLoading instead of isLoading.
Client Validation & NetworkService
client/src/Validation/validation.js, client/src/Utils/NetworkService.js
Added showResponseTimeChart: joi.boolean() to client validation and included showResponseTimeChart in createStatusPage FormData when defined.
Server Validation & Model
server/src/validation/joi.js, server/src/db/v1/models/StatusPage.js
Added showResponseTimeChart to server Joi schema and to StatusPage Mongoose schema with default true.
Status Page Module Projection
server/src/db/v1/modules/statusPageModule.js
Propagated showResponseTimeChart through aggregation projection and included it in early-return statusPage object.
Localization
client/src/locales/*
client/src/locales/ar.json, .../cs.json, .../de.json, .../en.json, .../es.json, .../fi.json, .../fr.json, .../ja.json, .../pt-BR.json, .../ru.json, .../th.json, .../tr.json, .../uk.json, .../vi.json, .../zh-CN.json, .../zh-TW.json
Added showResponseTimeChart translation key across locale files (some translated, others empty).
Build Metadata
client/tsconfig.tsbuildinfo
Non-functional newline/EOL differences only.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant UI as StatusPage Create UI
    participant Form as Form State
    participant API as NetworkService
    participant Server
    participant DB as Database
    participant View as Status Page View
    participant Monitors as MonitorsList

    User->>UI: Toggle showResponseTimeChart
    UI->>Form: handleFormChange(showResponseTimeChart)
    User->>UI: Submit form
    UI->>API: createStatusPage(form with showResponseTimeChart)
    API->>Server: POST payload
    Server->>Server: Joi validation (includes showResponseTimeChart)
    Server->>DB: Save StatusPage (showResponseTimeChart default true)
    Server-->>API: Success
    API-->>UI: Confirm

    Note over View,Monitors: Rendering status page monitors
    View->>Monitors: pass statusPage.showResponseTimeChart
    alt showResponseTimeChart enabled
        Monitors->>Monitors: fetch monitor stats per monitor
        Monitors->>Monitors: render ResponseTimeChart per monitor (passes monitorIsLoading)
    else disabled
        Monitors->>Monitors: skip chart rendering
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 I hopped into code with a curious twitch,
A tiny new toggle — a neat little switch,
Charts tucked beneath each heartbeat bar,
Translated and saved, now visible far,
Cheers from the burrow — a status page stitch!

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (4 passed)
Check name Status Explanation
Title Check ✅ Passed The pull request title "Add Response Time Chart option to Status Page configuration and display Closes #2924" accurately and clearly describes the main change in the changeset. It specifies what feature is being added (Response Time Chart option), where it's being added (Status Page configuration), and references the associated issue number. The title is concise, specific, and would be immediately understandable to someone reviewing commit history.
Linked Issues Check ✅ Passed The code changes comprehensively address all requirements from issue #2924. The frontend implementation adds the showResponseTimeChart configuration toggle in the Status Page Create/Edit Features tab [Content.jsx, Create/index.jsx], renders the ResponseTimeChart component conditionally beneath each monitor's heartbeat bar using the new MonitorListItem component [MonitorsList/index.jsx], and includes i18n support across all locale files. The backend implementation adds the showResponseTimeChart field to the StatusPage database schema with default true [StatusPage.js], persists the field through the data module [statusPageModule.js], and includes server-side validation [joi.js]. All changes directly support the stated objectives of allowing users to toggle response time chart visibility and displaying response time trends to end users.
Out of Scope Changes Check ✅ Passed All code changes in this pull request are directly scoped to implementing the Response Time Chart feature on status pages. Changes include component integration (ResponseTimeChart renamed and refactored), UI configuration (showResponseTimeChart checkbox added), form and validation layer updates, database schema changes, and localization across all supported languages. The only minor observation is that client/tsconfig.tsbuildinfo (a TypeScript build artifact) shows only a newline change with no functional impact, and ideally auto-generated build artifacts should not be committed to version control, though this does not represent out-of-scope functionality.
Description Check ✅ Passed The pull request description is comprehensive and well-structured, covering all required template sections with clear organization into Frontend Updates, Backend Updates, and User Impact. The author has completed all checklist items (marked with [x]), included the issue number after "Fixes #2924", provided a detailed summary of changes, and attached a video demonstrating the feature. The description accurately reflects the code changes in the raw summary and provides context for reviewers to understand both the scope and implementation approach.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (7)
client/src/locales/ar.json (1)

286-286: Consider providing Arabic translation for completeness.

The showResponseTimeChart key has an empty translation value. While this doesn't break functionality (will fall back to the key), providing the Arabic translation would improve the user experience for Arabic-speaking users.

client/src/locales/vi.json (1)

287-287: Consider providing Vietnamese translation for completeness.

The showResponseTimeChart key has an empty translation value. Providing the Vietnamese translation would improve the user experience for Vietnamese-speaking users.

client/src/locales/es.json (1)

286-286: Consider providing Spanish translation for completeness.

The showResponseTimeChart key has an empty translation value. Providing the Spanish translation would improve the user experience for Spanish-speaking users.

client/src/locales/uk.json (1)

287-287: Consider providing Ukrainian translation for completeness.

The showResponseTimeChart key has an empty translation value. Providing the Ukrainian translation would improve the user experience for Ukrainian-speaking users.

client/src/Pages/v1/StatusPage/Status/Components/MonitorsList/index.jsx (3)

25-25: Remove unused state setter or wire it up.

setDateRange isn’t used; simplify to avoid lints unless a control will be added soon.

Apply this diff if no date range control yet:

- const [dateRange, setDateRange] = useState("recent");
+ const [dateRange] = useState("recent");

46-46: Drop redundant key on child.

The parent Stack already has a stable key. Remove the key on Host to reduce noise.

-            <Host
-              key={monitor._id}
+            <Host
               url={monitor.url}
               title={monitor.name}
               ...

72-85: Consider batching chart data fetches to reduce N+1 requests.

Per‑monitor fetches scale poorly on status pages with many monitors. Longer term, expose grouped checks in the status page payload or add a batch endpoint to fetch multiple monitors’ grouped checks in one request.

📜 Review details

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0898011 and 729be8b.

📒 Files selected for processing (27)
  • client/src/Components/v1/Charts/ResponseTimeChart/ResponseTimeChart.jsx (2 hunks)
  • client/src/Pages/v1/StatusPage/Create/Components/Tabs/Content.jsx (1 hunks)
  • client/src/Pages/v1/StatusPage/Create/index.jsx (3 hunks)
  • client/src/Pages/v1/StatusPage/Status/Components/MonitorsList/index.jsx (4 hunks)
  • client/src/Pages/v1/Uptime/Details/index.jsx (1 hunks)
  • client/src/Utils/NetworkService.js (1 hunks)
  • client/src/Validation/validation.js (1 hunks)
  • client/src/locales/ar.json (1 hunks)
  • client/src/locales/cs.json (1 hunks)
  • client/src/locales/de.json (1 hunks)
  • client/src/locales/en.json (1 hunks)
  • client/src/locales/es.json (1 hunks)
  • client/src/locales/fi.json (1 hunks)
  • client/src/locales/fr.json (1 hunks)
  • client/src/locales/ja.json (1 hunks)
  • client/src/locales/pt-BR.json (1 hunks)
  • client/src/locales/ru.json (1 hunks)
  • client/src/locales/th.json (1 hunks)
  • client/src/locales/tr.json (1 hunks)
  • client/src/locales/uk.json (1 hunks)
  • client/src/locales/vi.json (1 hunks)
  • client/src/locales/zh-CN.json (1 hunks)
  • client/src/locales/zh-TW.json (1 hunks)
  • client/tsconfig.tsbuildinfo (1 hunks)
  • server/src/db/v1/models/StatusPage.js (1 hunks)
  • server/src/db/v1/modules/statusPageModule.js (3 hunks)
  • server/src/validation/joi.js (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-07-24T17:52:55.506Z
Learnt from: Jesulayomy
PR: bluewave-labs/Checkmate#2664
File: client/src/Pages/Uptime/Create/index.jsx:92-96
Timestamp: 2025-07-24T17:52:55.506Z
Learning: In the Uptime monitor components, the `formatAndSet` function was deprecated due to rendering issues caused by state mutations. The current approach stores intervals internally in milliseconds (API format) but converts for display using `const displayInterval = monitor?.interval / MS_PER_MINUTE || 1;` and converts user input back to milliseconds using `value = value * MS_PER_MINUTE` in the onChange handler.

Applied to files:

  • client/src/Pages/v1/StatusPage/Status/Components/MonitorsList/index.jsx
🧬 Code graph analysis (3)
client/src/Utils/NetworkService.js (1)
client/src/Pages/v1/StatusPage/Create/index.jsx (1)
  • form (39-52)
client/src/Pages/v1/StatusPage/Create/Components/Tabs/Content.jsx (2)
client/src/Components/v1/Inputs/Checkbox/index.jsx (1)
  • Checkbox (46-104)
client/src/Pages/v1/StatusPage/Create/index.jsx (2)
  • form (39-52)
  • handleFormChange (74-99)
client/src/Pages/v1/StatusPage/Status/Components/MonitorsList/index.jsx (2)
client/src/Hooks/v1/monitorHooks.js (2)
  • monitorStats (278-278)
  • useFetchUptimeMonitorById (274-300)
client/src/Components/v1/Charts/ResponseTimeChart/ResponseTimeChart.jsx (1)
  • ResponseTimeChart (7-23)
🪛 Biome (2.1.2)
client/src/Pages/v1/StatusPage/Status/Components/MonitorsList/index.jsx

[error] 34-34: This hook is being called from a nested function, but all hooks must be called unconditionally from the top-level component.

For React to preserve state between calls, hooks needs to be called unconditionally and always in the same order.
See https://reactjs.org/docs/hooks-rules.html#only-call-hooks-at-the-top-level

(lint/correctness/useHookAtTopLevel)

🔇 Additional comments (17)
client/tsconfig.tsbuildinfo (1)

1-1: Add .tsbuildinfo to .gitignore to prevent committing generated TypeScript build artifacts.

The client/tsconfig.tsbuildinfo file is an auto-generated TypeScript compiler cache that should not be tracked in version control. While the file is currently committed, this is an anti-pattern that can lead to merge conflicts and unnecessary noise in diffs. The modification in this PR (adding paths for new components) occurs automatically during the build process and does not represent meaningful changes to review.

Add the following to .gitignore:

*.tsbuildinfo

Consider also running git rm --cached client/tsconfig.tsbuildinfo to remove it from tracking without deleting the local file, so it will no longer appear in future commits.

client/src/locales/fi.json (1)

286-286: LGTM! Finnish translation provided.

The Finnish translation "Näytä vasteaikakaavio" is appropriately provided and follows the same pattern as the adjacent showCharts translation.

server/src/validation/joi.js (1)

481-481: LGTM! Validation correctly added.

The showResponseTimeChart field is appropriately validated as an optional boolean, consistent with the pattern used for similar feature flags like showCharts and showUptimePercentage.

client/src/locales/de.json (1)

290-290: LGTM! German translation provided.

The German translation "Reaktionszeitdiagramm anzeigen" is appropriately provided and follows the same pattern as the adjacent showCharts translation.

client/src/locales/en.json (1)

290-290: LGTM! English translation properly defined.

The English translation "Show Response Time Chart" is clear and follows the same pattern as adjacent feature flag labels like showCharts and showUptimePercentage.

client/src/Pages/v1/Uptime/Details/index.jsx (1)

6-6: LGTM: Import path updated to reflect component relocation.

The import path adjustment aligns with the ResponseTimeChart component reorganization.

client/src/Pages/v1/StatusPage/Create/Components/Tabs/Content.jsx (1)

93-99: LGTM: Checkbox for showResponseTimeChart follows established patterns.

The new checkbox is properly wired to form.showResponseTimeChart and uses the translation key. Implementation matches the existing feature checkboxes (showCharts, showUptimePercentage, showAdminLoginLink).

server/src/db/v1/models/StatusPage.js (1)

73-76: LGTM: Schema field added correctly.

The showResponseTimeChart field is properly defined as a Boolean with a sensible default value of true, consistent with similar feature flags in the schema.

client/src/Validation/validation.js (1)

306-306: LGTM: Validation rule added correctly.

The showResponseTimeChart validation as joi.boolean() is appropriate and consistent with the other feature flag validations in the schema.

client/src/Utils/NetworkService.js (1)

932-934: LGTM: FormData handling follows established pattern.

The handling of showResponseTimeChart mirrors the existing pattern for showCharts and showUptimePercentage, with proper undefined checks and string conversion for FormData.

client/src/Pages/v1/StatusPage/Create/index.jsx (3)

24-30: LGTM: ERROR_TAB_MAPPING correctly updated.

The showResponseTimeChart field is properly included in the second tab's error mapping array, ensuring validation errors navigate users to the correct tab.


50-50: LGTM: Sensible default value.

Setting showResponseTimeChart: true by default provides a good user experience, enabling the feature out-of-the-box similar to other chart features.


220-220: LGTM: Backward-compatible data loading.

The fallback to true when loading existing status pages handles cases where the field doesn't exist in older data, ensuring backward compatibility.

client/src/locales/th.json (1)

290-290: LGTM: Translation key added correctly.

The showResponseTimeChart translation key is properly positioned with other feature flags and aligns with the new UI checkbox label.

client/src/Components/v1/Charts/ResponseTimeChart/ResponseTimeChart.jsx (1)

7-7: LGTM: Component name typo corrected.

The component name has been corrected from ResponseTImeChart to ResponseTimeChart, fixing the typo. All related references (PropTypes assignment and default export) have been updated consistently.

Also applies to: 25-25, 31-31

server/src/db/v1/modules/statusPageModule.js (2)

100-113: LGTM: Propagates showResponseTimeChart in empty‑monitors path.

Correctly includes showResponseTimeChart in the early return payload; backward compatibility maintained since UI checks !== false.

Also applies to: 124-124


231-231: LGTM: Field added to aggregation projection.

showResponseTimeChart now flows through the aggregated path as well.

Copy link

@llamapreview llamapreview bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI Code Review by LlamaPReview

🎯 TL;DR & Recommendation

Recommendation: Request Changes
This PR introduces a valuable response time chart feature but has critical performance and architectural issues that could degrade user experience and system stability.

📄 Documentation Diagram

This diagram documents the new response time chart configuration and display workflow on status pages.

sequenceDiagram
    participant User as User
    participant Config as Status Page Config
    participant Backend as Backend
    participant Frontend as Frontend Display
    User->>Config: Toggle "Show Response Time Chart"
    Config->>Backend: Save setting (showResponseTimeChart)
    Backend-->>Config: Confirm save
    User->>Frontend: View Status Page
    Frontend->>Backend: Fetch status page data
    Backend-->>Frontend: Return data incl. showResponseTimeChart
    note over Frontend: PR #35;3026 added chart rendering logic
    Frontend->>Backend: Fetch monitor response times (if enabled)
    Backend-->>Frontend: Return response time data
    Frontend-->>User: Display response time chart
Loading

🌟 Strengths

  • Solid backend integration with proper schema and validation updates.
  • Comprehensive localization support across multiple languages.
Priority File Category Impact Summary Anchors
P1 Pages/v1/StatusPage/.../MonitorsList/index.jsx Performance Severe perf degradation from N API calls useFetchUptimeMonitorById
P1 Pages/v1/StatusPage/.../MonitorsList/index.jsx Architecture Data sync issue and hook violation local_only
P2 Pages/v1/StatusPage/.../MonitorsList/index.jsx Bug Incorrect loading state for charts ResponseTimeChart
P2 Pages/v1/Uptime/Details/index.jsx Architecture Fragile import paths local_only
P2 server/src/db/v1/models/StatusPage.js Maintainability Backward compat default value statusPageModule.js

🔍 Notable Themes

  • Performance and architecture flaws in the MonitorsList component risk system scalability.
  • Import path consistency and loading state management need attention across components.

📈 Risk Diagram

This diagram illustrates the performance risk from multiple API calls in the monitor list loop.

sequenceDiagram
    participant MonitorsList as MonitorsList Component
    participant Hook as useFetchUptimeMonitorById
    participant API as Backend API
    MonitorsList->>MonitorsList: Render monitors.map
    loop For each monitor
        MonitorsList->>Hook: Call useFetchUptimeMonitorById
        note over Hook: R1(P1): Severe performance degradation from multiple API calls
        Hook->>API: Fetch monitor data
        API-->>Hook: Return data
    end
    MonitorsList-->>User: Render charts
Loading
⚠️ **Unanchored Suggestions (Manual Review Recommended)**

The following suggestions could not be precisely anchored to a specific line in the diff. This can happen if the code is outside the changed lines, has been significantly refactored, or if the suggestion is a general observation. Please review them carefully in the context of the full file.


📁 File: client/src/Pages/v1/StatusPage/Status/Components/MonitorsList/index.jsx

The implementation calls useFetchUptimeMonitorById inside a .map() loop, creating N API calls for N monitors on every render. This will cause severe performance degradation on status pages with multiple monitors. The hook appears to be designed for single monitor details pages, not bulk operations. Each monitor triggers a separate network request, potentially overwhelming both client and server resources.

Suggestion:

// Fetch all monitor data in bulk at the component level
const { monitorData } = useFetchBulkMonitorData({
    monitorIds: monitors.map(m => m._id),
    dateRange
});

// Then in map:
{monitors?.map((monitor) => {
    const monitorDataForThis = monitorData[monitor._id];
    // ... rest of component

Related Code:

{monitors?.map((monitor) => {
    const status = determineState(monitor);
    const [monitorData, monitorStats, monitorIsLoading, monitorNetworkError] =
        useFetchUptimeMonitorById({
            monitorId: monitor._id,
            dateRange,
            trigger: false,
        });
    return (

📁 File: client/src/Pages/v1/StatusPage/Status/Components/MonitorsList/index.jsx

The dateRange state is defined at the component level but individual chart fetches don't react to its changes. The trigger: false parameter suggests the hook won't refetch when dateRange updates. This creates a data synchronization issue where changing the date range won't update the response time charts. The architecture violates React hooks rules by calling hooks inside loops.

Suggestion:

// Move dateRange state management to a context or prop
// Ensure hook dependencies properly track dateRange changes
useEffect(() => {
    if (trigger) {
        refetch(); // Assuming the hook supports refetch
    }
}, [dateRange, trigger, refetch]);

Related Code:

const [dateRange, setDateRange] = useState("recent");

// Inside map:
useFetchUptimeMonitorById({
    monitorId: monitor._id,
    dateRange,
    trigger: false,
});


💡 Have feedback? We'd love to hear it in our GitHub Discussions.
✨ This review was generated by LlamaPReview Advanced, which is free for all open-source projects. Learn more.

import MonitorTimeFrameHeader from "@/Components/v1/MonitorTimeFrameHeader/index.jsx";
import ChartBoxes from "./Components/ChartBoxes/index.jsx";
import ResponseTimeChart from "./Components/Charts/ResponseTimeChart.jsx";
import ResponseTimeChart from "../../../../Components/v1/Charts/ResponseTimeChart/ResponseTimeChart.jsx";
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 | Confidence: High

The component sharing between status page and uptime details is architecturally sound. However, the import path uses deep relative imports (../../../../) which are fragile and hard to maintain. Consider using the established @/ alias pattern for better maintainability.

Suggested change
import ResponseTimeChart from "../../../../Components/v1/Charts/ResponseTimeChart/ResponseTimeChart.jsx";
import ResponseTimeChart from "@/Components/v1/Charts/ResponseTimeChart/ResponseTimeChart.jsx";

Comment on lines +73 to +76
showResponseTimeChart: {
type: Boolean,
default: true,
},
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 | Confidence: High

The backend changes properly maintain data consistency by adding the field to both the Mongoose schema and the aggregation projections in statusPageModule.js. The default value of true ensures backward compatibility, but consider documenting this default behavior since existing status pages will automatically show response time charts after deployment.

Comment on lines 91 to 95
<ResponseTimeChart
isLoading={monitorIsLoading}
groupedChecks={monitorData?.groupedChecks}
dateRange={dateRange}
/>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 | Confidence: Medium

The isLoading prop is incorrectly passed from the parent MonitorsList's loading state instead of the individual monitor's loading state (monitorIsLoading). This causes all charts to show loading skeletons even when only one monitor is loading, creating a poor user experience.

Suggested change
<ResponseTimeChart
isLoading={monitorIsLoading}
groupedChecks={monitorData?.groupedChecks}
dateRange={dateRange}
/>
<ResponseTimeChart
isLoading={monitorIsLoading}
groupedChecks={monitorData?.groupedChecks}
dateRange={dateRange}
/>

Evidence: symbol:ResponseTimeChart, path:client/src/Components/v1/Charts/ResponseTimeChart/ResponseTimeChart.jsx

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (3)
client/src/Pages/v1/StatusPage/Status/Components/MonitorsList/index.jsx (3)

25-25: Remove unused setDateRange setter.

The dateRange state is initialized but setDateRange is never used. If this is a placeholder for future functionality (e.g., allowing users to change the date range), consider adding a TODO comment. Otherwise, remove the setter or use a constant instead of state.

Apply this diff if no future updates are planned:

-	const [dateRange, setDateRange] = useState("recent");
+	const dateRange = "recent";

48-48: Remove unused monitorStats variable.

The monitorStats variable is destructured from the hook but never used in the component. Consider removing it to reduce noise.

Apply this diff:

-	const [monitorData, monitorStats, monitorIsLoading] = useFetchUptimeMonitorById({
+	const [monitorData, , monitorIsLoading] = useFetchUptimeMonitorById({

44-100: Add PropTypes to MonitorListItem for consistency.

The MonitorListItem component should define PropTypes for its props to maintain consistency with the parent MonitorsList component and improve type safety.

Add PropTypes after the component definition:

MonitorListItem.propTypes = {
	monitor: PropTypes.shape({
		_id: PropTypes.string.isRequired,
		url: PropTypes.string,
		name: PropTypes.string,
		percentageColor: PropTypes.string,
		percentage: PropTypes.number,
		checks: PropTypes.array,
	}).isRequired,
	statusPage: PropTypes.object,
	showURL: PropTypes.bool,
	dateRange: PropTypes.string.isRequired,
};
📜 Review details

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 729be8b and 309964a.

📒 Files selected for processing (1)
  • client/src/Pages/v1/StatusPage/Status/Components/MonitorsList/index.jsx (2 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-07-24T17:52:55.506Z
Learnt from: Jesulayomy
PR: bluewave-labs/Checkmate#2664
File: client/src/Pages/Uptime/Create/index.jsx:92-96
Timestamp: 2025-07-24T17:52:55.506Z
Learning: In the Uptime monitor components, the `formatAndSet` function was deprecated due to rendering issues caused by state mutations. The current approach stores intervals internally in milliseconds (API format) but converts for display using `const displayInterval = monitor?.interval / MS_PER_MINUTE || 1;` and converts user input back to milliseconds using `value = value * MS_PER_MINUTE` in the onChange handler.

Applied to files:

  • client/src/Pages/v1/StatusPage/Status/Components/MonitorsList/index.jsx
🧬 Code graph analysis (1)
client/src/Pages/v1/StatusPage/Status/Components/MonitorsList/index.jsx (3)
client/src/Hooks/v1/useMonitorUtils.js (1)
  • determineState (33-38)
client/src/Hooks/v1/monitorHooks.js (2)
  • monitorStats (278-278)
  • useFetchUptimeMonitorById (274-300)
client/src/Components/v1/Charts/ResponseTimeChart/ResponseTimeChart.jsx (1)
  • ResponseTimeChart (7-23)
🔇 Additional comments (2)
client/src/Pages/v1/StatusPage/Status/Components/MonitorsList/index.jsx (2)

31-39: Excellent fix for the Rules of Hooks violation.

The extraction of MonitorListItem resolves the critical issue from the previous review. The hook is now called at the component's top level, maintaining proper React hooks ordering.


48-52: Correctly using per-monitor loading state.

The hook is properly called at the component's top level, and monitorIsLoading is correctly used instead of the parent isLoading (line 92), resolving the major issue from the previous review.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (3)
client/src/Pages/v1/Uptime/Details/index.jsx (1)

6-6: LGTM! Import path and prop usage are correct.

The import now uses the @ alias pattern (addressing the previous review comment), and the prop correctly uses monitorIsLoading to match the updated ResponseTimeChart API.

Also applies to: 171-175

client/src/Pages/v1/StatusPage/Status/Components/MonitorsList/index.jsx (2)

44-52: LGTM! Hook usage now complies with Rules of Hooks.

The extraction of MonitorListItem ensures useFetchUptimeMonitorById is called at the top level, fixing the previous critical issue. The per-monitor data fetching is now architecturally sound.


84-97: LGTM! ResponseTimeChart correctly uses per-monitor loading state.

The chart now receives monitorIsLoading instead of the parent's isLoading, ensuring accurate loading indicators for each monitor. The conditional rendering based on statusPage.showResponseTimeChart correctly implements the feature flag.

🧹 Nitpick comments (1)
client/src/Pages/v1/StatusPage/Status/Components/MonitorsList/index.jsx (1)

25-25: Consider making dateRange configurable in the future.

The hardcoded "recent" value is appropriate for the current status page requirements. However, if future enhancements require different time ranges per status page, this could be refactored to accept dateRange as a prop or configuration.

📜 Review details

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 309964a and d233d02.

📒 Files selected for processing (3)
  • client/src/Components/v1/Charts/ResponseTimeChart/ResponseTimeChart.jsx (2 hunks)
  • client/src/Pages/v1/StatusPage/Status/Components/MonitorsList/index.jsx (2 hunks)
  • client/src/Pages/v1/Uptime/Details/index.jsx (2 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-07-24T17:52:55.506Z
Learnt from: Jesulayomy
PR: bluewave-labs/Checkmate#2664
File: client/src/Pages/Uptime/Create/index.jsx:92-96
Timestamp: 2025-07-24T17:52:55.506Z
Learning: In the Uptime monitor components, the `formatAndSet` function was deprecated due to rendering issues caused by state mutations. The current approach stores intervals internally in milliseconds (API format) but converts for display using `const displayInterval = monitor?.interval / MS_PER_MINUTE || 1;` and converts user input back to milliseconds using `value = value * MS_PER_MINUTE` in the onChange handler.

Applied to files:

  • client/src/Pages/v1/StatusPage/Status/Components/MonitorsList/index.jsx
🧬 Code graph analysis (1)
client/src/Pages/v1/StatusPage/Status/Components/MonitorsList/index.jsx (3)
client/src/Hooks/v1/useMonitorUtils.js (1)
  • determineState (33-38)
client/src/Hooks/v1/monitorHooks.js (1)
  • useFetchUptimeMonitorById (274-300)
client/src/Components/v1/Charts/ResponseTimeChart/ResponseTimeChart.jsx (1)
  • ResponseTimeChart (7-27)
🔇 Additional comments (1)
client/src/Components/v1/Charts/ResponseTimeChart/ResponseTimeChart.jsx (1)

7-14: LGTM! Component rename and prop update are correct.

The typo fix (ResponseTImeChart → ResponseTimeChart) and prop rename (isLoading → monitorIsLoading) improve clarity and align with the per-monitor loading semantics.

Comment on lines 29 to 33
ResponseTimeChart.propTypes = {
isLoading: PropTypes.bool,
groupedChecks: PropTypes.array,
dateRange: PropTypes.string,
};
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Fix PropTypes: update isLoading to monitorIsLoading.

The PropTypes definition still references isLoading, but the component now uses monitorIsLoading. This mismatch will cause PropTypes validation warnings and confusion.

Apply this diff to fix the PropTypes definition:

 ResponseTimeChart.propTypes = {
-	isLoading: PropTypes.bool,
+	monitorIsLoading: PropTypes.bool,
 	groupedChecks: PropTypes.array,
 	dateRange: PropTypes.string,
 };
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
ResponseTimeChart.propTypes = {
isLoading: PropTypes.bool,
groupedChecks: PropTypes.array,
dateRange: PropTypes.string,
};
ResponseTimeChart.propTypes = {
monitorIsLoading: PropTypes.bool,
groupedChecks: PropTypes.array,
dateRange: PropTypes.string,
};
🤖 Prompt for AI Agents
In client/src/Components/v1/Charts/ResponseTimeChart/ResponseTimeChart.jsx
around lines 29 to 33, the PropTypes object still defines isLoading but the
component uses monitorIsLoading; update the PropTypes key to monitorIsLoading:
PropTypes.bool (replacing isLoading) so the prop name matches the component and
avoids validation warnings.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
client/src/Pages/v1/StatusPage/Status/Components/MonitorsList/index.jsx (2)

14-14: Clean up unused imports and props.

Line 14 imports useState but it's never used (dateRange is a constant, not state). Lines 18-19 declare isLoading and shouldRender props that are never referenced in the component body. These appear to be leftover artifacts from the refactoring that extracted MonitorListItem.

Apply this diff to remove unused code:

-import { useState } from "react";
+// import { useState } from "react"; // Remove if truly unused

 const MonitorsList = ({
-	isLoading = false,
-	shouldRender = true,
 	monitors = [],
 	statusPage = {},
 }) => {

Additionally, consider whether dateRange = "recent" at line 25 should remain hardcoded or be made configurable via props for future flexibility.

Also applies to: 18-19, 25-25


102-114: Optional: Enhance PropTypes specificity.

The PropTypes provide basic validation but could be more precise. For instance, monitor.checks is typed as a generic array, and statusPage as a generic object.

Consider adding more specific shapes if stricter validation would help catch bugs:

 MonitorListItem.propTypes = {
 	monitor: PropTypes.shape({
 		_id: PropTypes.string.isRequired,
 		url: PropTypes.string,
 		name: PropTypes.string,
 		percentageColor: PropTypes.string,
 		percentage: PropTypes.number,
-		checks: PropTypes.array,
+		checks: PropTypes.arrayOf(PropTypes.object),
 	}).isRequired,
-	statusPage: PropTypes.object,
+	statusPage: PropTypes.shape({
+		showCharts: PropTypes.bool,
+		showResponseTimeChart: PropTypes.bool,
+	}),
 	showURL: PropTypes.bool,
 	dateRange: PropTypes.string.isRequired,
 };
📜 Review details

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 309964a and a7500d2.

📒 Files selected for processing (3)
  • client/src/Components/v1/Charts/ResponseTimeChart/ResponseTimeChart.jsx (2 hunks)
  • client/src/Pages/v1/StatusPage/Status/Components/MonitorsList/index.jsx (2 hunks)
  • client/src/Pages/v1/Uptime/Details/index.jsx (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • client/src/Pages/v1/Uptime/Details/index.jsx
  • client/src/Components/v1/Charts/ResponseTimeChart/ResponseTimeChart.jsx
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-07-24T17:52:55.506Z
Learnt from: Jesulayomy
PR: bluewave-labs/Checkmate#2664
File: client/src/Pages/Uptime/Create/index.jsx:92-96
Timestamp: 2025-07-24T17:52:55.506Z
Learning: In the Uptime monitor components, the `formatAndSet` function was deprecated due to rendering issues caused by state mutations. The current approach stores intervals internally in milliseconds (API format) but converts for display using `const displayInterval = monitor?.interval / MS_PER_MINUTE || 1;` and converts user input back to milliseconds using `value = value * MS_PER_MINUTE` in the onChange handler.

Applied to files:

  • client/src/Pages/v1/StatusPage/Status/Components/MonitorsList/index.jsx
🧬 Code graph analysis (1)
client/src/Pages/v1/StatusPage/Status/Components/MonitorsList/index.jsx (3)
client/src/Hooks/v1/useMonitorUtils.js (1)
  • determineState (33-38)
client/src/Hooks/v1/monitorHooks.js (1)
  • useFetchUptimeMonitorById (274-300)
client/src/Components/v1/Charts/ResponseTimeChart/ResponseTimeChart.jsx (1)
  • ResponseTimeChart (7-27)
🔇 Additional comments (2)
client/src/Pages/v1/StatusPage/Status/Components/MonitorsList/index.jsx (2)

48-52: Consider handling networkError from the fetch hook.

The destructuring skips networkError (the 4th return value from useFetchUptimeMonitorById). If a monitor fetch fails, users won't see any error indication—the chart may just remain in a loading state or show stale/empty data.

Verify whether silent failure is acceptable, or add error handling:

const [monitorData, , monitorIsLoading, networkError] = useFetchUptimeMonitorById({
	monitorId: monitor._id,
	dateRange,
	trigger: false,
});

if (networkError) {
	return <Box>Error loading monitor data</Box>; // or appropriate error UI
}

84-97: LGTM! ResponseTimeChart integration looks good.

The conditional rendering correctly checks statusPage.showResponseTimeChart !== false, and the component now receives the per-monitor loading state (monitorIsLoading) instead of the parent's loading state, addressing previous review feedback.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (4)
client/src/Pages/v1/StatusPage/Status/Components/MonitorsList/index.jsx (4)

13-15: Remove unused import.

useState is imported but not used. Drop it to avoid dead code.

Apply this diff:

-import { useState } from "react";

43-52: Avoid per‑monitor fetch when charts are disabled.

useFetchUptimeMonitorById runs for every monitor even when statusPage.showResponseTimeChart === false, causing unnecessary network calls. Gate the hook by splitting into a base item (no fetch) and a “with chart” item (does fetch), and render conditionally.

Apply these diffs to rename the current component and prep for split:

- function MonitorListItem({ monitor, statusPage, showURL, dateRange }) {
+ function MonitorListItemWithChart({ monitor, statusPage, showURL, dateRange }) {
-MonitorListItem.propTypes = {
+MonitorListItemWithChart.propTypes = {
   monitor: PropTypes.shape({
     _id: PropTypes.string.isRequired,
     url: PropTypes.string,
     name: PropTypes.string,
     percentageColor: PropTypes.string,
     percentage: PropTypes.number,
     checks: PropTypes.array,
   }).isRequired,
   statusPage: PropTypes.object,
   showURL: PropTypes.bool,
   dateRange: PropTypes.string.isRequired,
 };

Then add this base component (no fetch, no chart):

function MonitorListItem({ monitor, statusPage, showURL }) {
  const theme = useTheme();
  const { determineState } = useMonitorUtils();
  const status = determineState(monitor);

  return (
    <Stack width="100%" gap={theme.spacing(2)}>
      <Host
        url={monitor.url}
        title={monitor.name}
        percentageColor={monitor.percentageColor}
        percentage={monitor.percentage}
        showURL={showURL}
      />
      <Stack direction="row" alignItems="center" gap={theme.spacing(20)}>
        {statusPage.showCharts !== false && (
          <Box flex={9}>
            <StatusPageBarChart checks={monitor?.checks?.slice().reverse()} />
          </Box>
        )}
        <Box flex={statusPage.showCharts !== false ? 1 : 10}>
          <StatusLabel status={status} text={status} customStyles={{ textTransform: "capitalize" }} />
        </Box>
      </Stack>
    </Stack>
  );
}

MonitorListItem.propTypes = {
  monitor: PropTypes.shape({
    _id: PropTypes.string.isRequired,
    url: PropTypes.string,
    name: PropTypes.string,
    percentageColor: PropTypes.string,
    percentage: PropTypes.number,
    checks: PropTypes.array,
  }).isRequired,
  statusPage: PropTypes.object,
  showURL: PropTypes.bool,
};

Finally, render the appropriate component in the map:

{monitors?.map((monitor) =>
  statusPage.showResponseTimeChart !== false ? (
    <MonitorListItemWithChart
      key={monitor._id}
      monitor={monitor}
      statusPage={statusPage}
      showURL={showURL}
      dateRange="recent"
    />
  ) : (
    <MonitorListItem
      key={monitor._id}
      monitor={monitor}
      statusPage={statusPage}
      showURL={showURL}
    />
  )
)}

Also applies to: 53-99


101-113: Tighten PropTypes for dateRange (optional).

If values are constrained (e.g., "recent", "24h", "7d"), prefer oneOf([...]) to catch typos early.

Example:

- dateRange: PropTypes.string.isRequired,
+ dateRange: PropTypes.oneOf(["recent", "24h", "7d", "30d"]).isRequired,

18-22: Align props with PropTypes (or remove unused props).

MonitorsList receives isLoading and shouldRender but doesn’t use them, and they’re absent from PropTypes. Either remove them from the signature or add to PropTypes. Prefer removal to reduce API surface.

Apply this diff to remove unused props:

-const MonitorsList = ({
-  isLoading = false,
-  shouldRender = true,
-  monitors = [],
-  statusPage = {},
-}) => {
+const MonitorsList = ({ monitors = [], statusPage = {} }) => {

Also applies to: 115-118

📜 Review details

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a7500d2 and 93b38ba.

📒 Files selected for processing (1)
  • client/src/Pages/v1/StatusPage/Status/Components/MonitorsList/index.jsx (2 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-07-24T17:52:55.506Z
Learnt from: Jesulayomy
PR: bluewave-labs/Checkmate#2664
File: client/src/Pages/Uptime/Create/index.jsx:92-96
Timestamp: 2025-07-24T17:52:55.506Z
Learning: In the Uptime monitor components, the `formatAndSet` function was deprecated due to rendering issues caused by state mutations. The current approach stores intervals internally in milliseconds (API format) but converts for display using `const displayInterval = monitor?.interval / MS_PER_MINUTE || 1;` and converts user input back to milliseconds using `value = value * MS_PER_MINUTE` in the onChange handler.

Applied to files:

  • client/src/Pages/v1/StatusPage/Status/Components/MonitorsList/index.jsx
🧬 Code graph analysis (1)
client/src/Pages/v1/StatusPage/Status/Components/MonitorsList/index.jsx (3)
client/src/Hooks/v1/useMonitorUtils.js (1)
  • determineState (33-38)
client/src/Hooks/v1/monitorHooks.js (1)
  • useFetchUptimeMonitorById (274-300)
client/src/Components/v1/Charts/ResponseTimeChart/ResponseTimeChart.jsx (1)
  • ResponseTimeChart (7-27)
🔇 Additional comments (2)
client/src/Pages/v1/StatusPage/Status/Components/MonitorsList/index.jsx (2)

30-38: Hooks fix via child component looks good.

Mapping to a child component resolves Rules-of-Hooks and keeps per‑monitor scoping tidy. Key usage is correct.


90-94: Correct prop name for loading state.

Passing monitorIsLoading to ResponseTimeChart matches the component’s API and fixes earlier flashing.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
client/src/Pages/v1/StatusPage/Status/Components/MonitorsList/index.jsx (2)

16-21: Remove unused props or document why they're preserved.

The isLoading and shouldRender props are declared in the MonitorsList signature but never used in the component body. This appears to be leftover from the refactoring.

If these props are no longer needed, apply this diff:

 const MonitorsList = ({
-	isLoading = false,
-	shouldRender = true,
 	monitors = [],
 	statusPage = {},
 }) => {

If they're preserved for future use, add a comment explaining why.


109-109: Consider refining the PropType for statusPage.

The statusPage PropType uses a generic PropTypes.object. For better type safety and documentation, specify the shape to include the fields used in this component: showCharts and showResponseTimeChart.

Apply this diff:

-	statusPage: PropTypes.object,
+	statusPage: PropTypes.shape({
+		showCharts: PropTypes.bool,
+		showResponseTimeChart: PropTypes.bool,
+	}),
📜 Review details

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 93b38ba and 9c21de7.

📒 Files selected for processing (1)
  • client/src/Pages/v1/StatusPage/Status/Components/MonitorsList/index.jsx (2 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-07-24T17:52:55.506Z
Learnt from: Jesulayomy
PR: bluewave-labs/Checkmate#2664
File: client/src/Pages/Uptime/Create/index.jsx:92-96
Timestamp: 2025-07-24T17:52:55.506Z
Learning: In the Uptime monitor components, the `formatAndSet` function was deprecated due to rendering issues caused by state mutations. The current approach stores intervals internally in milliseconds (API format) but converts for display using `const displayInterval = monitor?.interval / MS_PER_MINUTE || 1;` and converts user input back to milliseconds using `value = value * MS_PER_MINUTE` in the onChange handler.

Applied to files:

  • client/src/Pages/v1/StatusPage/Status/Components/MonitorsList/index.jsx
🧬 Code graph analysis (1)
client/src/Pages/v1/StatusPage/Status/Components/MonitorsList/index.jsx (3)
client/src/Hooks/v1/useMonitorUtils.js (1)
  • determineState (33-38)
client/src/Hooks/v1/monitorHooks.js (1)
  • useFetchUptimeMonitorById (274-300)
client/src/Components/v1/Charts/ResponseTimeChart/ResponseTimeChart.jsx (1)
  • ResponseTimeChart (7-27)
🔇 Additional comments (3)
client/src/Pages/v1/StatusPage/Status/Components/MonitorsList/index.jsx (3)

13-14: LGTM!

The imports are correctly added to support the new response time chart feature and per-monitor data fetching.


42-98: LGTM! Past review concerns addressed.

The MonitorListItem component correctly:

  • Calls the hook at the top level (fixes Rules of Hooks violation from past review)
  • Passes monitorIsLoading to ResponseTimeChart instead of the parent's isLoading (fixes incorrect loading state from past review)
  • Implements the conditional rendering for showResponseTimeChart with the correct !== false check to support the default-true behavior

Based on past review comments and relevant code snippets.


29-37: The hardcoded dateRange="recent" is intentional and correctly designed.

The parent Status component has no dateRange state or prop, and MonitorsList was deliberately designed without a dateRange prop parameter. The hardcoded value is consistent with the current architecture—there's no evidence the parent should control the date range at this level. The code is functioning as intended.

Likely an incorrect or invalid review comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow response time chart to be displayed on status page

1 participant