Skip to content

Include mobile hosts by default in "Hosts online" chart#48769

Draft
spalmesano0 wants to merge 1 commit into
mainfrom
dashboard-online-mobile
Draft

Include mobile hosts by default in "Hosts online" chart#48769
spalmesano0 wants to merge 1 commit into
mainfrom
dashboard-online-mobile

Conversation

@spalmesano0

@spalmesano0 spalmesano0 commented Jul 6, 2026

Copy link
Copy Markdown
Member

Related issue: Resolves #47661

Checklist for submitter

  • Changes file added for user-visible changes in changes/, orbit/changes/ or ee/fleetd-chrome/changes.

Testing

  • Added/updated automated tests
  • QA'd all new/changed functionality manually

Summary by CodeRabbit

  • New Features

    • The “Hosts online” chart now includes mobile platforms by default, alongside desktop platforms.
    • Updated chart messaging to better reflect how locked iOS/iPadOS devices are counted when powered and connected.
  • Bug Fixes

    • Removed the default “Filtered” state for the chart so the initial view matches the full platform set.
  • Tests

    • Adjusted chart coverage to reflect the new default platform behavior and request parameters.

@codecov

codecov Bot commented Jul 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.01%. Comparing base (6e5eb27) to head (33f2b82).
⚠️ Report is 8 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #48769      +/-   ##
==========================================
- Coverage   68.02%   68.01%   -0.02%     
==========================================
  Files        3680     3681       +1     
  Lines      233960   233961       +1     
  Branches    12419    12270     -149     
==========================================
- Hits       159146   159121      -25     
- Misses      60496    60523      +27     
+ Partials    14318    14317       -1     
Flag Coverage Δ
frontend 58.88% <ø> (-0.08%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Warning

  • Copilot's review of this pull request may be incomplete because some of the changed files are excluded by your Copilot content exclusion settings. See Excluding content from Copilot for details.

Pull request overview

This PR updates the Dashboard “Hosts online” chart to include mobile platforms (iOS/iPadOS/Android) by default on page load, matching the intended post-4.89 behavior described in #47661.

Changes:

  • Removes the chart’s default platform filter so the initial request includes all platforms (mobile + non-mobile).
  • Updates the chart tooltip/copy to remove the “mobile excluded by default” messaging.
  • Updates the ChartCard test to reflect the new default behavior (no “Filtered” badge, no platforms query param).

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.

File Description
frontend/pages/DashboardPage/cards/ChartCard/ChartFilterModal/ChartFilterModal.tsx Simplifies comment above PLATFORM_OPTIONS now that ChartCard no longer hard-codes default platform exclusions.
frontend/pages/DashboardPage/cards/ChartCard/ChartCard.tsx Removes the seeded default platforms filter; updates tooltip text accordingly.
frontend/pages/DashboardPage/cards/ChartCard/ChartCard.tests.tsx Updates default-platform test expectations; currently needs a small adjustment to ensure the request handler is actually hit.
changes/47661-hosts-online-chart-include-mobile-by-default User-visible change note (content excluded from this review by policy).
Files excluded by content exclusion policy (1)
  • changes/47661-hosts-online-chart-include-mobile-by-default
Comments suppressed due to low confidence (1)

frontend/pages/DashboardPage/cards/ChartCard/ChartCard.tests.tsx:207

  • This test can pass even if the chart request never fires because requestedPlatforms starts as null (the same value you'd get when the query param is absent). If the handler isn't hit (e.g., due to React Query cache), the assertion toBeNull() still passes. Initialize to undefined and assert it becomes null after rendering; also prefer querying rect elements from the rendered container rather than document for isolation.
  it("includes mobile platforms by default and does not show the Filtered badge", async () => {
    let requestedPlatforms: string | null = null;
    mockServer.use(
      http.get(baseUrl("/charts/:metric"), ({ params, request }) => {
        requestedPlatforms = new URL(request.url).searchParams.get("platforms");

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@spalmesano0 spalmesano0 marked this pull request as ready for review July 6, 2026 15:25
@spalmesano0 spalmesano0 requested a review from a team as a code owner July 6, 2026 15:25

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.

Tip: disable this comment in your organization's Code Review settings.

@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: cc90439a-65c9-4bdf-96c7-d1fa153f1598

📥 Commits

Reviewing files that changed from the base of the PR and between bb7f8cb and 33f2b82.

📒 Files selected for processing (4)
  • changes/47661-hosts-online-chart-include-mobile-by-default
  • frontend/pages/DashboardPage/cards/ChartCard/ChartCard.tests.tsx
  • frontend/pages/DashboardPage/cards/ChartCard/ChartCard.tsx
  • frontend/pages/DashboardPage/cards/ChartCard/ChartFilterModal/ChartFilterModal.tsx

Walkthrough

The default platform filter on the "hosts online" chart is removed so mobile platforms (iOS, iPadOS, Android) are included by default alongside desktop platforms. DEFAULT_CHART_FILTERS.platforms is changed to an empty array, dataset description text is updated to describe locked iOS/iPadOS host behavior, a related comment in ChartFilterModal is trimmed, a changelog entry is added, and tests are updated to confirm no platform query parameter is sent by default and the "Filtered" badge no longer appears.

Changes

File Summary
changes/47661-hosts-online-chart-include-mobile-by-default New changelog entry describing removal of default platform filter
frontend/pages/DashboardPage/cards/ChartCard/ChartCard.tsx DEFAULT_CHART_FILTERS.platforms set to empty array; updated dataset description text
frontend/pages/DashboardPage/cards/ChartCard/ChartFilterModal/ChartFilterModal.tsx Trimmed inline comment about mobile platform selectability
frontend/pages/DashboardPage/cards/ChartCard/ChartCard.tests.tsx Updated test expectations for default mobile inclusion and absent "Filtered" badge

Related issues

Possibly related PRs

  • fleetdm/fleet#47222: Modifies the same ChartCard.tsx/tests default platform-filtering logic, previously introducing the mobile exclusion this PR reverses.
  • fleetdm/fleet#47674: Overhauls ChartCard/ChartFilterModal filter state and query construction logic touched by this PR.

Suggested labels: :release, frontend

Suggested reviewers: noahtalerman

🐰 A chart once hid its mobile friends away,
Now iOS and Android join the fray,
No filter badge, no hidden lines,
Every host now brightly shines,
On the dashboard, all devices play!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: mobile hosts are now included by default in the Hosts online chart.
Description check ✅ Passed The description includes the related issue and the relevant checklist/testing items for this small UI behavior change.
Linked Issues check ✅ Passed The changes remove the default platform filter and update tests, matching issue #47661's goal to show mobile hosts by default.
Out of Scope Changes check ✅ Passed The modified files are all directly related to the chart default filter behavior and its tests, with no unrelated scope added.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dashboard-online-mobile

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.

@spalmesano0 spalmesano0 marked this pull request as draft July 6, 2026 20:28
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.

"Hosts online" chart: Remove default platform filters

2 participants