feat(settings): replace highlightsFirstEnabled with highlightsPlacement#3867
Conversation
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.
|
🍹 The Update (preview) for dailydotdev/api/prod (at 7094b83) was successful. ✨ Neo ExplanationRoutine 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 Both DB and Clickhouse migration jobs are being cycled to the new commit hash ( 🔵 Info — The 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.
Summary
Some users wanted to disable the Happening Now card entirely, not just choose between random vs pinned placement. Replaces the
highlightsFirstEnabledboolean with a 3-statehighlightsPlacementenum:default— current behavior (random slot within the first half of page one)pinned— slot 0 (whathighlightsFirstEnabled: truedid)disabled— no highlight is injected at allHow disabling works end-to-end
FeedPreferencesConfigGenerator.generate()checks the user's storedhighlightsPlacementand:pinned→ setsconfig.highlights_first = true(daily-feed pins to slot 0)disabled→ setsconfig.highlights_limit = 0(daily-feed's existingHighlightsLimit > 0guard skips injection — no daily-feed change required)default/ unset → no overrideMigration
The
highlightsFirstEnabledboolean is removed cleanly. Anyone who toggled "pin" since the feature shipped resets to default and can pick the new placement.Supersedes
transformSettingFlags).Test plan
pnpm run lintclean__tests__/integrations/feed.ts— three new cases asserting pinned/disabled/default behavior end-to-end throughFeedPreferencesConfigGenerator__tests__/settings.ts— mutation round-trip + invalid-enum rejection__tests__/boot.ts— boot settings.flags assertion updated