Skip to content

feat(settings): replace highlightsFirstEnabled with highlightsPlacement#3867

Merged
pnvasanth merged 2 commits into
mainfrom
feat/highlights-placement-enum
May 11, 2026
Merged

feat(settings): replace highlightsFirstEnabled with highlightsPlacement#3867
pnvasanth merged 2 commits into
mainfrom
feat/highlights-placement-enum

Conversation

@pnvasanth
Copy link
Copy Markdown
Contributor

Summary

Some users wanted to disable the Happening Now card entirely, not just choose between random vs pinned placement. Replaces the highlightsFirstEnabled boolean with a 3-state highlightsPlacement enum:

  • default — current behavior (random slot within the first half of page one)
  • pinned — slot 0 (what highlightsFirstEnabled: true did)
  • disabled — no highlight is injected at all

How disabling works end-to-end

FeedPreferencesConfigGenerator.generate() checks the user's stored highlightsPlacement and:

  • pinned → sets config.highlights_first = true (daily-feed pins to slot 0)
  • disabled → sets config.highlights_limit = 0 (daily-feed's existing HighlightsLimit > 0 guard skips injection — no daily-feed change required)
  • default / unset → no override

Migration

The highlightsFirstEnabled boolean is removed cleanly. Anyone who toggled "pin" since the feature shipped resets to default and can pick the new placement.

Supersedes

Test plan

  • pnpm run lint clean
  • __tests__/integrations/feed.ts — three new cases asserting pinned/disabled/default behavior end-to-end through FeedPreferencesConfigGenerator
  • __tests__/settings.ts — mutation round-trip + invalid-enum rejection
  • __tests__/boot.ts — boot settings.flags assertion updated
  • Snapshot updated
  • CI runs full Jest suite

Replaces the single Pin Happening Now toggle with a 3-state placement
preference: default (random within the first half of page one), pinned
(slot 0), or disabled (no highlight injected). The disabled case is
enforced by zeroing out highlights_limit before the feed request, so
the daily-feed service's existing HighlightsLimit > 0 guard suppresses
the placeholder.

The boolean field is dropped cleanly; anyone who toggled "pin" since
the feature shipped will revert to default and can pick the new option.
@pulumi
Copy link
Copy Markdown

pulumi Bot commented May 11, 2026

🍹 The Update (preview) for dailydotdev/api/prod (at 7094b83) was successful.

✨ Neo Explanation

Routine deployment of the `highlightsPlacement` enum feature with accompanying DB and Clickhouse migrations; the main non-obvious risk is that existing users with `highlightsFirstEnabled: true` may lose that preference unless the migration explicitly backfills `highlightsPlacement: 'pinned'`. ✅ Low Risk (assuming migration handles backfill).

This deployment rolls out the highlightsPlacement feature — replacing the boolean highlightsFirstEnabled flag with a tri-state enum (default, pinned, disabled) that gives the feed service finer control over highlights positioning. The FeedPreferencesConfigGenerator now maps pinnedhighlights_first: true, disabledhighlights_limit: 0, and default → no change (pass-through).

Both DB and Clickhouse migration jobs are being cycled to the new commit hash (47b6fa8e), indicating schema or data migrations accompany this change — likely adding/renaming the highlightsPlacement column in SettingsFlags.

🔵 Info — The SettingsFlags schema change is backward-compatible at the application level: existing users with no highlightsPlacement set will fall through to the default case (pass-through behavior), which is equivalent to the old highlightsFirstEnabled: false default. However, any users who previously had highlightsFirstEnabled: true will not be automatically migrated to highlightsPlacement: 'pinned' — their highlights-first behavior will be lost unless the DB migration handles this backfill.

Resource Changes

    Name                                                       Type                           Operation
~   vpc-native-rotate-daily-quests-cron                        kubernetes:batch/v1:CronJob    update
~   vpc-native-worker-job-deployment                           kubernetes:apps/v1:Deployment  update
~   vpc-native-channel-highlights-cron                         kubernetes:batch/v1:CronJob    update
~   vpc-native-update-views-cron                               kubernetes:batch/v1:CronJob    update
+   vpc-native-api-db-migration-47b6fa8e                       kubernetes:batch/v1:Job        create
~   vpc-native-update-current-streak-cron                      kubernetes:batch/v1:CronJob    update
~   vpc-native-generate-search-invites-cron                    kubernetes:batch/v1:CronJob    update
-   vpc-native-api-clickhouse-migration-ab4ae3d7               kubernetes:batch/v1:Job        delete
~   vpc-native-sync-subscription-with-cio-cron                 kubernetes:batch/v1:CronJob    update
~   vpc-native-user-profile-analytics-clickhouse-cron          kubernetes:batch/v1:CronJob    update
~   vpc-native-personalized-digest-deployment                  kubernetes:apps/v1:Deployment  update
~   vpc-native-clean-channel-highlights-cron                   kubernetes:batch/v1:CronJob    update
~   vpc-native-post-analytics-clickhouse-cron                  kubernetes:batch/v1:CronJob    update
~   vpc-native-rotate-weekly-quests-cron                       kubernetes:batch/v1:CronJob    update
~   vpc-native-calculate-top-readers-cron                      kubernetes:batch/v1:CronJob    update
~   vpc-native-update-tag-materialized-views-cron              kubernetes:batch/v1:CronJob    update
~   vpc-native-clean-zombie-users-cron                         kubernetes:batch/v1:CronJob    update
~   vpc-native-squad-posts-analytics-refresh-cron              kubernetes:batch/v1:CronJob    update
~   vpc-native-check-analytics-report-cron                     kubernetes:batch/v1:CronJob    update
~   vpc-native-clean-stale-user-transactions-cron              kubernetes:batch/v1:CronJob    update
~   vpc-native-user-posts-analytics-refresh-cron               kubernetes:batch/v1:CronJob    update
~   vpc-native-private-deployment                              kubernetes:apps/v1:Deployment  update
~   vpc-native-clean-zombie-images-cron                        kubernetes:batch/v1:CronJob    update
~   vpc-native-deployment                                      kubernetes:apps/v1:Deployment  update
~   vpc-native-bg-deployment                                   kubernetes:apps/v1:Deployment  update
~   vpc-native-user-profile-analytics-history-clickhouse-cron  kubernetes:batch/v1:CronJob    update
~   vpc-native-clean-zombie-opportunities-cron                 kubernetes:batch/v1:CronJob    update
~   vpc-native-clean-gifted-plus-cron                          kubernetes:batch/v1:CronJob    update
~   vpc-native-update-source-public-threshold-cron             kubernetes:batch/v1:CronJob    update
~   vpc-native-post-analytics-history-day-clickhouse-cron      kubernetes:batch/v1:CronJob    update
~   vpc-native-update-trending-cron                            kubernetes:batch/v1:CronJob    update
~   vpc-native-update-highlighted-views-cron                   kubernetes:batch/v1:CronJob    update
~   vpc-native-materialize-yearly-best-post-archives-cron      kubernetes:batch/v1:CronJob    update
~   vpc-native-daily-digest-cron                               kubernetes:batch/v1:CronJob    update
~   vpc-native-temporal-deployment                             kubernetes:apps/v1:Deployment  update
~   vpc-native-clean-zombie-user-companies-cron                kubernetes:batch/v1:CronJob    update
~   vpc-native-user-profile-updated-sync-cron                  kubernetes:batch/v1:CronJob    update
~   vpc-native-hourly-notification-cron                        kubernetes:batch/v1:CronJob    update
~   vpc-native-expire-super-agent-trial-cron                   kubernetes:batch/v1:CronJob    update
-   vpc-native-api-db-migration-ab4ae3d7                       kubernetes:batch/v1:Job        delete
~   vpc-native-channel-digests-cron                            kubernetes:batch/v1:CronJob    update
... and 11 other changes

Mercurius returns UNEXPECTED for GraphQL enum coercion errors instead
of GRAPHQL_VALIDATION_FAILED, so the bogus-value test failed. Matching
the established shortcutsMode/shortcutsAppearance pattern: input is
String, the resolver's existing Object.values(...).includes check
throws ValidationError on invalid input. Output type stays HighlightsPlacement.
@pnvasanth pnvasanth merged commit 5469825 into main May 11, 2026
9 checks passed
@pnvasanth pnvasanth deleted the feat/highlights-placement-enum branch May 11, 2026 14:56
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.

1 participant