Skip to content

feat(content-insights): add content type filter for Needs Update metric [INTEG-4147] - #11016

Merged
Harika Kondur (harikakondur) merged 9 commits into
masterfrom
feat/content-insights-needs-update-content-type-filter
Jun 8, 2026
Merged

feat(content-insights): add content type filter for Needs Update metric [INTEG-4147]#11016
Harika Kondur (harikakondur) merged 9 commits into
masterfrom
feat/content-insights-needs-update-content-type-filter

Conversation

@harikakondur

@harikakondur Harika Kondur (harikakondur) commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • New Content types included in "Needs update" multiselect in the config screen sets a persistent default
  • Inline Filter by content type in the "Needs update" tab lets users adjust the view at runtime
  • Empty selection includes all content types (preserves existing behavior)
  • Table page size increased from 5 → 10 rows across all tabs

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

Before

After

After config After tab
Screen.Recording.2026-06-08.at.3.23.33.PM.mov

Test plan

  • All tests pass (npx vitest --run)
  • Config screen filter persists and scopes the metric card and table
  • Inline tab filter updates the table in real time
  • Empty selection shows all content types
  • All tabs show 10 rows per page

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>
@harikakondur
Harika Kondur (harikakondur) requested a review from a team as a code owner June 8, 2026 15:58
Copilot AI review requested due to automatic review settings June 8, 2026 15:58

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.

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 new ContentTypeMultiSelect.
  • 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.

Comment thread apps/content-insights/src/hooks/useNeedsUpdateContent.ts
Comment thread apps/content-insights/src/hooks/useNeedsUpdateContent.ts Outdated
Comment thread apps/content-insights/src/metrics/MetricsCalculator.ts
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>
@harikakondur Harika Kondur (harikakondur) changed the title feat(content-insights): add content type filter for Needs Update metric feat(content-insights): add content type filter for Needs Update metric [INTEG-4147] Jun 8, 2026
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>

@mgoudy91 Mitch Goudy (mgoudy91) 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.

LGTM

Comment thread apps/content-insights/src/components/ScheduledContentTabs.tsx
… 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>
@harikakondur
Harika Kondur (harikakondur) merged commit 8c7d9c4 into master Jun 8, 2026
14 checks passed
@harikakondur
Harika Kondur (harikakondur) deleted the feat/content-insights-needs-update-content-type-filter branch June 8, 2026 22:10
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.

3 participants