feat(content-insights): add content type filter for Needs Update metric [INTEG-4147] - #11016
Merged
Harika Kondur (harikakondur) merged 9 commits intoJun 8, 2026
Conversation
Allows admins to configure which content types participate in the "Needs update" calculation, preventing reusable components (Links, CTAs, Navigation items) from inflating the metric count. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an installation-level content type filter for the “Needs update” metric so admins can exclude non-reviewable/reusable content types from the metric card and table, while preserving the existing “include all types” behavior when the selection is empty.
Changes:
- Adds
needsUpdateContentTypes?: string[]installation parameter and exposes it on the config screen via a newContentTypeMultiSelect. - Applies the content type filter to the “Needs update” metric card calculation (
MetricsCalculator) and the table data source (useNeedsUpdate). - Extends unit tests to cover the metric-card filtering behavior.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| apps/content-insights/src/locations/ConfigScreen.tsx | Adds a new multiselect configuration field and persists needsUpdateContentTypes. |
| apps/content-insights/src/components/Dashboard.tsx | Passes needsUpdateContentTypes into MetricsCalculator. |
| apps/content-insights/src/metrics/MetricsCalculator.ts | Filters “Needs update” metric counts by selected content types. |
| apps/content-insights/src/hooks/useNeedsUpdateContent.ts | Filters “Needs update” table entries by selected content types. |
| apps/content-insights/test/metrics/MetricsCalculator.spec.ts | Adds tests for metric-card content-type filtering semantics. |
| apps/content-insights/test/locations/ConfigScreen.spec.tsx | Updates config save expectations to include the new parameter. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Adds an inline ContentTypeMultiSelect inside the "Needs update" tab panel so users can filter the table by content type at runtime — mirroring the filter that was already available in the config screen. - useNeedsUpdateContent: accept optional overrideContentTypeIds param - NeedsUpdateTable: forward selectedContentTypeIds to the hook - ScheduledContentTabs: render ContentTypeMultiSelect above the table, pre-seeded with the needsUpdateContentTypes installation parameter Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… filter lookups - useNeedsUpdateContent: use stable EMPTY_CONTENT_TYPES constant to avoid new array creation on every render when no types are configured; precompute a Set for O(1) lookups; short-circuit content type check before date parse - MetricsCalculator: replace needsUpdateContentTypes array with a Set built in the constructor for O(1) has() lookups in calculateNeedsUpdate - Add hook-level tests for content type filtering (filter applied, empty list, installation param fallback) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… clearing tab filter shows all types Passing undefined fell back to installation.needsUpdateContentTypes instead of showing all entries. Now always passes the mapped array (empty = all types). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…reflect configured default fallback Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Mitch Goudy (mgoudy91)
approved these changes
Jun 8, 2026
Harika Kondur (harikakondur)
deleted the
feat/content-insights-needs-update-content-type-filter
branch
June 8, 2026 22:10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Context
The "Needs update" metric was reporting 54,000+ entries because it counted all content types, including reusable components (Links, CTAs, Nav items) that don't need periodic review.
Screenshots
Before
After
Screen.Recording.2026-06-08.at.3.23.33.PM.mov
Test plan
npx vitest --run)