Skip to content

[Host details > Reports] Frontend changes#42017

Merged
nulmete merged 11 commits intomainfrom
nulmete/host-reports-tab
Mar 24, 2026
Merged

[Host details > Reports] Frontend changes#42017
nulmete merged 11 commits intomainfrom
nulmete/host-reports-tab

Conversation

@nulmete
Copy link
Copy Markdown
Member

@nulmete nulmete commented Mar 18, 2026

Related issue: Resolves #41533

Checklist for submitter

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

Testing

  • Added/updated automated tests

  • QA'd all new/changed functionality manually

Screen.Recording.2026-03-20.at.9.49.58.AM.mov

Below I show the Report clipped and the X additional results not shown states. For that, I manually inserted records in my DB:

-- make "clipped"
  INSERT INTO query_results (query_id, host_id, last_fetched, data)
  SELECT 1, t.n + 1000, NOW(), '{"fake_key": "fake_value"}'
  FROM (
      SELECT a.N + b.N * 10 + c.N * 100 AS n
      FROM (SELECT 0 AS N UNION SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4 UNION SELECT 5 UNION SELECT 6 UNION SELECT 7 UNION SELECT 8 UNION
  SELECT 9) a,
           (SELECT 0 AS N UNION SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4 UNION SELECT 5 UNION SELECT 6 UNION SELECT 7 UNION SELECT 8 UNION
  SELECT 9) b,
           (SELECT 0 AS N UNION SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4 UNION SELECT 5 UNION SELECT 6 UNION SELECT 7 UNION SELECT 8 UNION
  SELECT 9) c
  ) t
  WHERE t.n BETWEEN 1 AND 999;

-- populate extra query results
INSERT INTO query_results (query_id, host_id, last_fetched, data)
  VALUES
    (1, 2, NOW(), '{"pid": "9999", "version": "5.21.0"}'),
    (1, 2, NOW(), '{"pid": "8888", "version": "5.20.0"}');
Screen.Recording.2026-03-20.at.9.51.29.AM.mov

Pagination (manually changed to 3 items per page for testing purposes)

Screen.Recording.2026-03-20.at.9.56.27.AM.mov

@nulmete nulmete changed the title add initial changes for Host details > Report tab [Host details > Reports] Frontend changes Mar 18, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 18, 2026

Codecov Report

❌ Patch coverage is 15.60694% with 146 lines in your changes missing coverage. Please review.
✅ Project coverage is 66.50%. Comparing base (1d5dfa0) to head (8e9c70f).
⚠️ Report is 21 commits behind head on main.

Files with missing lines Patch % Lines
...es/hosts/details/HostReportsTab/HostReportsTab.tsx 8.00% 69 Missing ⚠️
...es/hosts/details/HostReportsTab/HostReportCard.tsx 11.76% 45 Missing ⚠️
frontend/services/entities/host_reports.ts 0.00% 14 Missing ⚠️
.../hosts/details/HostDetailsPage/HostDetailsPage.tsx 9.09% 10 Missing ⚠️
...ages/hosts/details/HostReportsTab/EmptyReports.tsx 33.33% 4 Missing ⚠️
server/service/hosts.go 62.50% 3 Missing ⚠️
frontend/utilities/endpoints.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #42017      +/-   ##
==========================================
- Coverage   66.53%   66.50%   -0.03%     
==========================================
  Files        2521     2526       +5     
  Lines      202206   202467     +261     
  Branches     8969     9017      +48     
==========================================
+ Hits       134530   134654     +124     
- Misses      55534    55663     +129     
- Partials    12142    12150       +8     
Flag Coverage Δ
backend 68.31% <66.66%> (+0.01%) ⬆️
frontend 54.39% <12.80%> (-0.23%) ⬇️

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

☔ View full report in Codecov by Sentry.
📢 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.

Comment on lines +9 to +11
children?: React.ReactNode;
/** @deprecated Use children instead */
text?: string;
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

added children for more composability (that way we can still pass a string but also a component)

@nulmete nulmete marked this pull request as ready for review March 20, 2026 13:06
@nulmete nulmete requested a review from a team as a code owner March 20, 2026 13:06
Copilot AI review requested due to automatic review settings March 20, 2026 13:06
Copy link
Copy Markdown

@claude claude Bot left a comment

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.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new Reports tab to the Host details page, including a new frontend API client and UI components to list reports and preview the first result for each report.

Changes:

  • Added a Host details Reports tab + routing and wiring in HostDetailsPage.
  • Implemented host_reports entity service + new endpoint for listing host reports with pagination/sort/search params.
  • Introduced new UI components/styles for the Reports tab (cards, empty state), and updated PillBadge to support richer badge content.

Reviewed changes

Copilot reviewed 13 out of 14 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
frontend/utilities/endpoints.ts Adds HOST_REPORTS API endpoint helper.
frontend/services/entities/host_reports.ts New API client + types for listing host reports.
frontend/router/index.tsx Adds /hosts/:host_id/reports route to Host details routing.
frontend/pages/hosts/details/cards/Labels/_styles.scss Updates labels card list layout to wrap with gaps.
frontend/pages/hosts/details/HostReportsTab/index.ts Barrel export for the new Reports tab.
frontend/pages/hosts/details/HostReportsTab/_styles.scss Styles for Reports tab layout, report cards, and empty state.
frontend/pages/hosts/details/HostReportsTab/HostReportsTab.tsx Main Reports tab: query, sort/search/toggle, pagination, rendering.
frontend/pages/hosts/details/HostReportsTab/HostReportCard.tsx Report preview card UI (first result grid, banners, actions).
frontend/pages/hosts/details/HostReportsTab/EmptyReports.tsx Empty/search-empty state for the tab.
frontend/pages/hosts/details/HostDetailsPage/_styles.scss Adds triple-height card modifier for layout adjustments.
frontend/pages/hosts/details/HostDetailsPage/HostDetailsPage.tsx Adds Reports tab to subnav + renders HostReportsTab; layout tweaks.
frontend/components/PillBadge/_styles.scss Renames internal element class to match updated PillBadge markup.
frontend/components/PillBadge/PillBadge.tsx Enhances PillBadge to support children content + optional className; deprecates text.
changes/42017-host-details-reports-tab Changelog entry for the new Reports tab.

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

Comment thread frontend/pages/hosts/details/HostReportsTab/HostReportsTab.tsx Outdated
Comment thread frontend/components/PillBadge/PillBadge.tsx Outdated

export interface IHostReport {
query_id: number;
report_id: number;
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.

This doesn't seem to be used

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

it's used in both HostReportCard and HostReportsTab

Comment thread frontend/services/entities/host_reports.ts Outdated
Comment thread frontend/pages/hosts/details/HostDetailsPage/HostDetailsPage.tsx
Comment thread frontend/pages/hosts/details/HostDetailsPage/HostDetailsPage.tsx
Comment thread frontend/components/PillBadge/PillBadge.tsx Outdated
Comment thread frontend/pages/hosts/details/HostReportsTab/EmptyReports.tsx Outdated
Comment thread frontend/pages/hosts/details/HostReportsTab/HostReportCard.tsx Outdated
Comment thread frontend/pages/hosts/details/HostReportsTab/HostReportCard.tsx Outdated
Comment thread frontend/pages/hosts/details/HostReportsTab/HostReportsTab.tsx Outdated
Copy link
Copy Markdown
Contributor

@juan-fdz-hawa juan-fdz-hawa left a comment

Choose a reason for hiding this comment

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

Looking good! Left a couple of comments to tackle.

@nulmete nulmete requested a review from a team as a code owner March 23, 2026 18:03
@nulmete nulmete merged commit a265768 into main Mar 24, 2026
53 checks passed
@nulmete nulmete deleted the nulmete/host-reports-tab branch March 24, 2026 13:45
dnplkndll pushed a commit to ledoent/fleet that referenced this pull request Mar 25, 2026
<!-- Add the related story/sub-task/bug number, like Resolves fleetdm#123, or
remove if NA -->
**Related issue:** Resolves fleetdm#41533

# Checklist for submitter

- [x] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/guides/committing-changes.md#changes-files)
for more information.

## Testing

- [ ] Added/updated automated tests

- [x] QA'd all new/changed functionality manually



https://github.com/user-attachments/assets/64a5f726-1e9f-4508-8726-6227813dcc77

Below I show the `Report clipped` and the `X additional results not
shown` states. For that, I manually inserted records in my DB:

```sql
-- make "clipped"
  INSERT INTO query_results (query_id, host_id, last_fetched, data)
  SELECT 1, t.n + 1000, NOW(), '{"fake_key": "fake_value"}'
  FROM (
      SELECT a.N + b.N * 10 + c.N * 100 AS n
      FROM (SELECT 0 AS N UNION SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4 UNION SELECT 5 UNION SELECT 6 UNION SELECT 7 UNION SELECT 8 UNION
  SELECT 9) a,
           (SELECT 0 AS N UNION SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4 UNION SELECT 5 UNION SELECT 6 UNION SELECT 7 UNION SELECT 8 UNION
  SELECT 9) b,
           (SELECT 0 AS N UNION SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4 UNION SELECT 5 UNION SELECT 6 UNION SELECT 7 UNION SELECT 8 UNION
  SELECT 9) c
  ) t
  WHERE t.n BETWEEN 1 AND 999;

-- populate extra query results
INSERT INTO query_results (query_id, host_id, last_fetched, data)
  VALUES
    (1, 2, NOW(), '{"pid": "9999", "version": "5.21.0"}'),
    (1, 2, NOW(), '{"pid": "8888", "version": "5.20.0"}');
```


https://github.com/user-attachments/assets/8056ea4c-b042-47cf-a05f-ee9d8621252a

Pagination (manually changed to 3 items per page for testing purposes)



https://github.com/user-attachments/assets/87a97259-0821-4659-a612-c952e98a158c
dnplkndll pushed a commit to ledoent/fleet that referenced this pull request Mar 25, 2026
<!-- Add the related story/sub-task/bug number, like Resolves fleetdm#123, or
remove if NA -->
**Related issue:** Resolves fleetdm#41533

# Checklist for submitter

- [x] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/guides/committing-changes.md#changes-files)
for more information.

## Testing

- [ ] Added/updated automated tests

- [x] QA'd all new/changed functionality manually



https://github.com/user-attachments/assets/64a5f726-1e9f-4508-8726-6227813dcc77

Below I show the `Report clipped` and the `X additional results not
shown` states. For that, I manually inserted records in my DB:

```sql
-- make "clipped"
  INSERT INTO query_results (query_id, host_id, last_fetched, data)
  SELECT 1, t.n + 1000, NOW(), '{"fake_key": "fake_value"}'
  FROM (
      SELECT a.N + b.N * 10 + c.N * 100 AS n
      FROM (SELECT 0 AS N UNION SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4 UNION SELECT 5 UNION SELECT 6 UNION SELECT 7 UNION SELECT 8 UNION
  SELECT 9) a,
           (SELECT 0 AS N UNION SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4 UNION SELECT 5 UNION SELECT 6 UNION SELECT 7 UNION SELECT 8 UNION
  SELECT 9) b,
           (SELECT 0 AS N UNION SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4 UNION SELECT 5 UNION SELECT 6 UNION SELECT 7 UNION SELECT 8 UNION
  SELECT 9) c
  ) t
  WHERE t.n BETWEEN 1 AND 999;

-- populate extra query results
INSERT INTO query_results (query_id, host_id, last_fetched, data)
  VALUES
    (1, 2, NOW(), '{"pid": "9999", "version": "5.21.0"}'),
    (1, 2, NOW(), '{"pid": "8888", "version": "5.20.0"}');
```


https://github.com/user-attachments/assets/8056ea4c-b042-47cf-a05f-ee9d8621252a

Pagination (manually changed to 3 items per page for testing purposes)



https://github.com/user-attachments/assets/87a97259-0821-4659-a612-c952e98a158c
import Icon from "components/Icon";
import { IconNames } from "components/icons";
import InfoBanner from "components/InfoBanner";
import ActionsDropdown from "components/ActionsDropdown";
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Heyo @nulmete just seeing this got merged! Got some QA feedback for ya <3

Can you switch this to use DropdownWrapper not ActionsDropdown for example QueriesTable.tsx uses

   <DropdownWrapper
        name="platform-dropdown"
        value={curTargetedPlatformFilter}
        className={`${baseClass}__platform-dropdown`}
        options={PLATFORM_FILTER_OPTIONS}
        onChange={handlePlatformFilterDropdownChange}
        variant="table-filter"
      />

It'll style things correctly

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

For clarity since it wasn't communicated well which dropdown I was referring to being incorrectly styled:

Image Image

nulmete added a commit that referenced this pull request Mar 31, 2026
<!-- Add the related story/sub-task/bug number, like Resolves #123, or
remove if NA -->
**Related issue:** Resolves #41533 

Follow-up of this [PR](#42017)
after this comment:
#42017 (comment)

# Checklist for submitter

Changes file already included in previous PR.

## Testing

- [x] QA'd all new/changed functionality manually

### Before

<img width="2553" height="992" alt="Screenshot 2026-03-30 at 11 07
54 AM"
src="https://github.com/user-attachments/assets/87153f0d-0b0c-41c4-90d7-9513148fbeec"
/>


### After

<img width="1517" height="990" alt="Screenshot 2026-03-30 at 11 35
49 AM"
src="https://github.com/user-attachments/assets/fde61505-1ba7-4010-a461-30632b7ff3f8"
/>

<img width="800" height="847" alt="Screenshot 2026-03-30 at 11 35 41 AM"
src="https://github.com/user-attachments/assets/6af400e6-42c1-46d4-8160-339cea323b8a"
/>
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.

[Host details > Reports] Frontend changes

4 participants