[Host details > Reports] Frontend changes#42017
Conversation
Codecov Report❌ Patch coverage is 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| children?: React.ReactNode; | ||
| /** @deprecated Use children instead */ | ||
| text?: string; |
There was a problem hiding this comment.
added children for more composability (that way we can still pass a string but also a component)
There was a problem hiding this comment.
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_reportsentity 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
PillBadgeto 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.
|
|
||
| export interface IHostReport { | ||
| query_id: number; | ||
| report_id: number; |
There was a problem hiding this comment.
This doesn't seem to be used
There was a problem hiding this comment.
it's used in both HostReportCard and HostReportsTab
juan-fdz-hawa
left a comment
There was a problem hiding this comment.
Looking good! Left a couple of comments to tackle.
…en, constantize sort options
<!-- 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
<!-- 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"; |
There was a problem hiding this comment.
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
<!-- 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" />


Related issue: Resolves #41533
Checklist for submitter
changes/,orbit/changes/oree/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 clippedand theX additional results not shownstates. For that, I manually inserted records in my DB: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