Skip to content

FE: Lint cleanups part II#43491

Merged
RachelElysia merged 3 commits intomainfrom
lint-cleanup-2
Apr 14, 2026
Merged

FE: Lint cleanups part II#43491
RachelElysia merged 3 commits intomainfrom
lint-cleanup-2

Conversation

@RachelElysia
Copy link
Copy Markdown
Member

@RachelElysia RachelElysia commented Apr 13, 2026

Issue

Description

Testing

  • QA'd all new/changed functionality manually

Summary by CodeRabbit

  • Bug Fixes

    • OS preview now reliably shows a default image when platform is unmatched.
  • Refactor

    • Improved type safety and tightened component props to reduce runtime surprises.
    • Removed unused code and state for a leaner UI.
    • Optimized React hook dependencies to reduce unnecessary re-renders.

@RachelElysia RachelElysia marked this pull request as ready for review April 13, 2026 19:14
@RachelElysia RachelElysia requested a review from a team as a code owner April 13, 2026 19:14
Copilot AI review requested due to automatic review settings April 13, 2026 19:14
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 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
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 13, 2026

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: 37d96030-a3e3-4ae1-a4c8-c79f5d55e952

📥 Commits

Reviewing files that changed from the base of the PR and between 736421f and 11ca9eb.

📒 Files selected for processing (1)
  • frontend/pages/hosts/ManageHostsPage/components/HostsFilterBlock/HostsFilterBlock.tsx
✅ Files skipped from review due to trivial changes (1)
  • frontend/pages/hosts/ManageHostsPage/components/HostsFilterBlock/HostsFilterBlock.tsx

Walkthrough

This PR makes targeted frontend cleanup and type-safety changes: removes unused imports, state, props, and test helpers; tightens TypeScript typings (replacing any with specific types and narrowing/Removing interface properties); adjusts React hook memoization and effect dependency arrays; fixes a switch default return to always provide an image; and updates a few component prop typings and call sites (notably dropdown indicator props, table cell props, and software-related modal props). A small number of exported interface properties were removed or narrowed.

Possibly related PRs

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The PR description is incomplete; it references a related PR but lacks detail on changes, test status, and omits required sections like security validation and testing confirmation. Add more detail on the specific lint/type improvements included, confirm manual QA completion, and complete the checklist items marked as incomplete.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'FE: Lint cleanups part II' accurately describes the main focus of the changeset—multiple lint-related cleanups and type improvements across frontend files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 lint-cleanup-2

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
Copy Markdown
Contributor

@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.

🧹 Nitpick comments (1)
frontend/pages/hosts/ManageHostsPage/components/HostsFilterBlock/HostsFilterBlock.tsx (1)

66-68: Normalize upstream query params before passing to HostsFilterBlock.

Line 66 and Line 68 now require number / MacSettingsStatusQueryParam, but policyId and macSettingsStatus are extracted directly from queryParams without parsing or validation (ManageHostsPage.tsx lines 257 and 259–260). URL query parameters are strings by nature and can be invalid; they should be parsed/validated before passing to this component to enforce type safety at runtime.

For example:

  • policyId should use parseInt() like softwareId, softwareVersionId, and softwareTitleId do.
  • macSettingsStatus should validate against "latest" | "pending" | "failing" like softwareStatus validates with isValidSoftwareAggregateStatus().
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@frontend/pages/hosts/ManageHostsPage/components/HostsFilterBlock/HostsFilterBlock.tsx`
around lines 66 - 68, The component expects policyId:number and
macSettingsStatus:MacSettingsStatusQueryParam but ManageHostsPage currently
passes raw string query params; update the extraction logic in ManageHostsPage
where policyId and macSettingsStatus are read (the same area that parses
softwareId/softwareVersionId/softwareTitleId) to normalize/validate them: use
parseInt() for policyId (falling back to undefined on NaN) and validate
macSettingsStatus against the allowed values ("latest"|"pending"|"failing")
similar to isValidSoftwareAggregateStatus(), converting to the
MacSettingsStatusQueryParam enum/type or setting undefined if invalid before
passing into HostsFilterBlock.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In
`@frontend/pages/hosts/ManageHostsPage/components/HostsFilterBlock/HostsFilterBlock.tsx`:
- Around line 66-68: The component expects policyId:number and
macSettingsStatus:MacSettingsStatusQueryParam but ManageHostsPage currently
passes raw string query params; update the extraction logic in ManageHostsPage
where policyId and macSettingsStatus are read (the same area that parses
softwareId/softwareVersionId/softwareTitleId) to normalize/validate them: use
parseInt() for policyId (falling back to undefined on NaN) and validate
macSettingsStatus against the allowed values ("latest"|"pending"|"failing")
similar to isValidSoftwareAggregateStatus(), converting to the
MacSettingsStatusQueryParam enum/type or setting undefined if invalid before
passing into HostsFilterBlock.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 7cf3c010-bae7-4280-9047-912728f344d1

📥 Commits

Reviewing files that changed from the base of the PR and between 4850918 and f7d8018.

📒 Files selected for processing (23)
  • frontend/components/TeamsDropdown/TeamsDropdown.tsx
  • frontend/pages/ManageControlsPage/OSUpdates/components/EndUserOSRequirementPreview/EndUserOSRequirementPreview.tsx
  • frontend/pages/ManageControlsPage/Scripts/ScriptBatchDetailsPage/components/ScriptBatchHostsTable/ScriptBatchHostsTableConfig.tsx
  • frontend/pages/ManageControlsPage/Secrets/Secrets.tests.tsx
  • frontend/pages/ManageControlsPage/SetupExperience/cards/BootstrapPackage/components/BootstrapPackageUploader/BootstrapPackageUploader.tsx
  • frontend/pages/SoftwarePage/SoftwarePage.tsx
  • frontend/pages/SoftwarePage/SoftwareTitleDetailsPage/EditIconModal/EditIconModal.tsx
  • frontend/pages/SoftwarePage/SoftwareTitleDetailsPage/EditSoftwareModal/EditSoftwareModal.tsx
  • frontend/pages/SoftwarePage/SoftwareTitleDetailsPage/SoftwareSummaryCard/SoftwareSummaryCard.tsx
  • frontend/pages/SoftwarePage/SoftwareTitles/SoftwareTitles.tsx
  • frontend/pages/hosts/ManageHostsPage/components/FilterPill/FilterPill.tsx
  • frontend/pages/hosts/ManageHostsPage/components/HostsFilterBlock/HostsFilterBlock.tsx
  • frontend/pages/hosts/details/cards/HostSoftwareLibrary/HostSoftwareLibrary.tsx
  • frontend/pages/hosts/details/cards/Queries/ReportUpdatedCell/ReportUpdatedCell.tests.tsx
  • frontend/pages/hosts/details/cards/Software/SelfService/components/UpdatesCard/UpdateSoftwareItem/UpdateSoftwareItem.tsx
  • frontend/pages/packs/ManagePacksPage/components/PacksTable/PacksTable.tsx
  • frontend/pages/policies/ManagePoliciesPage/components/PoliciesTable/PoliciesTable.tests.tsx
  • frontend/pages/policies/edit/components/PolicyResults/PolicyResults.tsx
  • frontend/pages/queries/ManageQueriesPage/components/QueriesTable/QueriesTable.tsx
  • frontend/pages/queries/details/QueryDetailsPage/QueryDetailsPage.tsx
  • frontend/services/entities/scripts.ts
  • frontend/services/entities/software.ts
  • frontend/services/entities/users.ts
💤 Files with no reviewable changes (9)
  • frontend/pages/ManageControlsPage/SetupExperience/cards/BootstrapPackage/components/BootstrapPackageUploader/BootstrapPackageUploader.tsx
  • frontend/pages/hosts/ManageHostsPage/components/FilterPill/FilterPill.tsx
  • frontend/pages/hosts/details/cards/HostSoftwareLibrary/HostSoftwareLibrary.tsx
  • frontend/pages/SoftwarePage/SoftwarePage.tsx
  • frontend/pages/policies/edit/components/PolicyResults/PolicyResults.tsx
  • frontend/pages/SoftwarePage/SoftwareTitles/SoftwareTitles.tsx
  • frontend/pages/SoftwarePage/SoftwareTitleDetailsPage/SoftwareSummaryCard/SoftwareSummaryCard.tsx
  • frontend/services/entities/software.ts
  • frontend/pages/SoftwarePage/SoftwareTitleDetailsPage/EditSoftwareModal/EditSoftwareModal.tsx

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.90%. Comparing base (3c1b8fc) to head (11ca9eb).
⚠️ Report is 17 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff            @@
##             main   #43491    +/-   ##
========================================
  Coverage   66.90%   66.90%            
========================================
  Files        2596     2596            
  Lines      208220   208220            
  Branches     9208     9321   +113     
========================================
  Hits       139313   139313            
  Misses      56237    56237            
  Partials    12670    12670            
Flag Coverage Δ
frontend 54.77% <100.00%> (ø)

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.

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

Part II of the frontend lint cleanup effort, primarily removing unused code, tightening types, and aligning React hook dependencies.

Changes:

  • Removed unused imports/props/state and cleaned up tests to eliminate unused variables.
  • Improved TypeScript typings in several service/entity and component interfaces (e.g., request payloads, table query data, react-table cell props).
  • Fixed/adjusted React hook dependency arrays and a missing return in an OS requirement image switch.

Reviewed changes

Copilot reviewed 23 out of 23 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
frontend/services/entities/users.ts Tightened typing for resetPassword and setup request payloads.
frontend/services/entities/software.ts Removed unused addedSoftwareToken from query-key interfaces.
frontend/services/entities/scripts.ts Removed unused mock imports; improved filter typing (status).
frontend/pages/queries/details/QueryDetailsPage/QueryDetailsPage.tsx Updated useEffect dependency array for team selection side effect.
frontend/pages/queries/ManageQueriesPage/components/QueriesTable/QueriesTable.tsx Corrected memo/callback dependencies for platform filter rendering.
frontend/pages/policies/edit/components/PolicyResults/PolicyResults.tsx Removed unused variable.
frontend/pages/policies/ManagePoliciesPage/components/PoliciesTable/PoliciesTable.tests.tsx Removed unused container from test render result.
frontend/pages/packs/ManagePacksPage/components/PacksTable/PacksTable.tsx Replaced any with ITableQueryData for onQueryChange.
frontend/pages/hosts/details/cards/Software/SelfService/components/UpdatesCard/UpdateSoftwareItem/UpdateSoftwareItem.tsx Removed unused destructured field.
frontend/pages/hosts/details/cards/Queries/ReportUpdatedCell/ReportUpdatedCell.tests.tsx Removed unused import from RTL.
frontend/pages/hosts/details/cards/HostSoftwareLibrary/HostSoftwareLibrary.tsx Removed unused import.
frontend/pages/hosts/ManageHostsPage/components/HostsFilterBlock/HostsFilterBlock.tsx Tightened param typing for policyId and macSettingsStatus.
frontend/pages/hosts/ManageHostsPage/components/FilterPill/FilterPill.tsx Removed unused lodash import.
frontend/pages/SoftwarePage/SoftwareTitles/SoftwareTitles.tsx Removed unused addedSoftwareToken prop plumbing from queries.
frontend/pages/SoftwarePage/SoftwareTitleDetailsPage/SoftwareSummaryCard/SoftwareSummaryCard.tsx Removed unused router prop passed to modal.
frontend/pages/SoftwarePage/SoftwareTitleDetailsPage/EditSoftwareModal/EditSoftwareModal.tsx Removed unused prop types/props and import cleanup.
frontend/pages/SoftwarePage/SoftwareTitleDetailsPage/EditIconModal/EditIconModal.tsx Memoized resetIconState, updated effect deps, removed unused items.
frontend/pages/SoftwarePage/SoftwarePage.tsx Removed unused addedSoftwareToken state and prop passing.
frontend/pages/ManageControlsPage/SetupExperience/cards/BootstrapPackage/components/BootstrapPackageUploader/BootstrapPackageUploader.tsx Removed unused import.
frontend/pages/ManageControlsPage/Secrets/Secrets.tests.tsx Removed unused test imports/variables.
frontend/pages/ManageControlsPage/Scripts/ScriptBatchDetailsPage/components/ScriptBatchHostsTable/ScriptBatchHostsTableConfig.tsx Replaced any cell props with CellProps<IScriptBatchHostResult>.
frontend/pages/ManageControlsPage/OSUpdates/components/EndUserOSRequirementPreview/EndUserOSRequirementPreview.tsx Fixed missing return in default image case.
frontend/components/TeamsDropdown/TeamsDropdown.tsx Strengthened react-select generic typing; removed unused lodash import.

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

…ck/HostsFilterBlock.tsx

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@RachelElysia RachelElysia merged commit a3b7e29 into main Apr 14, 2026
19 checks passed
@RachelElysia RachelElysia deleted the lint-cleanup-2 branch April 14, 2026 13:43
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.

4 participants