Skip to content

feat(replay): pin a primary property from the session replay inspector#60812

Merged
pauldambra merged 9 commits into
masterfrom
posthog-code/replay-pin-primary-property
May 31, 2026
Merged

feat(replay): pin a primary property from the session replay inspector#60812
pauldambra merged 9 commits into
masterfrom
posthog-code/replay-pin-primary-property

Conversation

@pauldambra
Copy link
Copy Markdown
Member

@pauldambra pauldambra commented May 31, 2026

Problem

Power users repeatedly scan the same property to make sense of an event in the session replay inspector. Promoting that property to the event's primary property surfaces its value next to the event everywhere it matters (inspector rows, seekbar tooltips). Until now the only place to set it was the event-definition edit page — a surface very few people visit — so the payoff and the control lived far apart. This adds a way to promote a property from the exact place the payoff is felt.

Changes

  • Hover-revealed pin on each event-property row in the replay inspector's Properties tab. One click promotes the property to the event's primary property; clicking again unpins.
  • Respects taxonomy-locked events: the built-in primary property shows a disabled "Built-in — can't be changed" pin, and every other row shows no pin.
  • SimpleKeyValueList gained a generic rowActions(key, isRowHovered) slot — the row owns its own hover state and hands it to the action, so the reveal is a typed boolean rather than a shared CSS class.
  • primaryEventPropertiesModel is a kea loader: primaryProperties is the single source of truth, with a loadPrimaryProperties action (read) and an updatePrimaryProperty action (write — resolves the definition by name, PATCHes, and folds the value the API returns back into the map). A failed update returns the unchanged map, so there's nothing to reconcile. The pin shows the loader's loading state on click; lookup vs update failures keep distinct messages and are captured to error tracking.
  • Gated behind the existing promoted-event-properties-edit flag, and the pin carries a data-attr so pin/unpin adoption can be tracked.

No UI screenshots: I'm an agent and did not capture them — flagging for the reviewer.

How did you test this code?

I'm an agent; automated checks only, no manual UI testing:

  • Model tests for primaryEventPropertiesModel: load filtering, update-folds-API-response, unpin, update-failure-leaves-map-unchanged, lookup-failure-skips-update, failed-load-stays-retryable, and the loading lifecycle.
  • A parameterized component test for PinPrimaryPropertyButton (built-in disabled pin, null on non-primary taxonomy rows, hover/pinned reveal).
  • oxlint clean and repo-wide tsc shows no new errors in the changed files.

Automatic notifications

  • Publish to changelog?
  • Alert Sales and Marketing teams?

🤖 Agent context

Authored with PostHog Code (Claude). The user asked to roll the promoted-properties flag out to 100% (done separately via the feature-flag API) and to design a UX for prompting people to set a primary property. We rejected a behaviour-detection approach (too ambiguous about intent) in favour of a discoverable hover affordance where the payoff is felt.

The model went through one wrong turn worth noting for reviewers: an initial version used an optimistic overlay (separate loaded/optimistic reducers + a merge selector + a save-version race guard). That design generated its own reconciliation and race bugs, so on review it was reverted to a plain kea loader whose value is the single source of truth — simpler, and the bug class disappears. Other decisions: taxonomy-locked events disable/hide the pin rather than silently no-op; the hover-reveal coupling was replaced with a typed isRowHovered arg; failures are captured with a per-stage tag.


Created with PostHog Code

Adds a hover-revealed pin to the event-properties list in the replay
inspector so a property can be promoted to the event's primary property
in one click. The update is optimistic and reverts on failure, and it
respects taxonomy-locked events: built-in primary properties show a
disabled pin and other rows show none.

Generated-By: PostHog Code
Task-Id: 35d6c5ec-a607-44ce-806d-1a4055a59e7b
Copy link
Copy Markdown
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ffdb422c0b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread frontend/src/models/primaryEventPropertiesModel.ts Outdated
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 31, 2026

Size Change: +8.84 kB (+0.01%)

Total Size: 80.8 MB

📦 View Changed
Filename Size Change
frontend/dist-report/exporter/_chunks/chunk 8.42 MB +2.55 kB (+0.03%)
frontend/dist-report/posthog-app/_chunks/chunk 8.62 MB +2.55 kB (+0.03%)
frontend/dist-report/render-query/src/render-query/render-query 27.4 MB +2.56 kB (+0.01%)
frontend/dist-report/toolbar/src/toolbar/toolbar 15.7 MB +1.19 kB (+0.01%)
ℹ️ View Unchanged
Filename Size
frontend/dist-report/decompression-worker/src/scenes/session-recordings/player/snapshot-processing/decompressionWorker 2.85 kB
frontend/dist-report/exporter/_parent/products/actions/frontend/pages/Action 25 kB
frontend/dist-report/exporter/_parent/products/actions/frontend/pages/Actions 1.33 kB
frontend/dist-report/exporter/_parent/products/ai_observability/frontend/AIObservabilityScene 118 kB
frontend/dist-report/exporter/_parent/products/ai_observability/frontend/AIObservabilitySessionScene 18.3 kB
frontend/dist-report/exporter/_parent/products/ai_observability/frontend/AIObservabilityTraceScene 130 kB
frontend/dist-report/exporter/_parent/products/ai_observability/frontend/AIObservabilityUsers 872 B
frontend/dist-report/exporter/_parent/products/ai_observability/frontend/clusters/AIObservabilityClusterScene 21.7 kB
frontend/dist-report/exporter/_parent/products/ai_observability/frontend/clusters/AIObservabilityClustersScene 55.1 kB
frontend/dist-report/exporter/_parent/products/ai_observability/frontend/datasets/AIObservabilityDatasetScene 21 kB
frontend/dist-report/exporter/_parent/products/ai_observability/frontend/datasets/AIObservabilityDatasetsScene 3.64 kB
frontend/dist-report/exporter/_parent/products/ai_observability/frontend/evaluations/AIObservabilityEvaluation 59.9 kB
frontend/dist-report/exporter/_parent/products/ai_observability/frontend/evaluations/AIObservabilityEvaluationsScene 28.2 kB
frontend/dist-report/exporter/_parent/products/ai_observability/frontend/evaluations/EvaluationTemplates 915 B
frontend/dist-report/exporter/_parent/products/ai_observability/frontend/LLMASessionFeedbackDisplay 5.19 kB
frontend/dist-report/exporter/_parent/products/ai_observability/frontend/playground/AIObservabilityPlaygroundScene 37.8 kB
frontend/dist-report/exporter/_parent/products/ai_observability/frontend/prompts/LLMPromptScene 29.2 kB
frontend/dist-report/exporter/_parent/products/ai_observability/frontend/prompts/LLMPromptsScene 4.83 kB
frontend/dist-report/exporter/_parent/products/ai_observability/frontend/skills/LLMSkillScene 929 B
frontend/dist-report/exporter/_parent/products/ai_observability/frontend/skills/LLMSkillsScene 946 B
frontend/dist-report/exporter/_parent/products/ai_observability/frontend/tags/AIObservabilityTag 27.4 kB
frontend/dist-report/exporter/_parent/products/ai_observability/frontend/tags/AIObservabilityTagsScene 7.31 kB
frontend/dist-report/exporter/_parent/products/business_knowledge/frontend/scenes/BusinessKnowledgeScene 19 kB
frontend/dist-report/exporter/_parent/products/conversations/frontend/components/Assignee/CyclotronJobInputAssignee 1.67 kB
frontend/dist-report/exporter/_parent/products/conversations/frontend/components/SlaBusinessHours/CyclotronJobInputBusinessHours 3.06 kB
frontend/dist-report/exporter/_parent/products/conversations/frontend/components/TicketTags/CyclotronJobInputTicketTags 1.06 kB
frontend/dist-report/exporter/_parent/products/conversations/frontend/scenes/settings/SupportSettingsScene 1.82 kB
frontend/dist-report/exporter/_parent/products/conversations/frontend/scenes/ticket/SupportTicketScene 33.9 kB
frontend/dist-report/exporter/_parent/products/conversations/frontend/scenes/tickets/SupportTicketsScene 1.07 kB
frontend/dist-report/exporter/_parent/products/customer_analytics/frontend/CustomerAnalyticsScene 53.1 kB
frontend/dist-report/exporter/_parent/products/customer_analytics/frontend/scenes/CustomerAnalyticsConfigurationScene/CustomerAnalyticsConfigurationScene 2.65 kB
frontend/dist-report/exporter/_parent/products/customer_analytics/frontend/scenes/CustomerJourneyBuilderScene/CustomerJourneyBuilderScene 2.18 kB
frontend/dist-report/exporter/_parent/products/customer_analytics/frontend/scenes/CustomerJourneyTemplatesScene/CustomerJourneyTemplatesScene 7.86 kB
frontend/dist-report/exporter/_parent/products/data_warehouse/DataWarehouseScene 46.8 kB
frontend/dist-report/exporter/_parent/products/data_warehouse/frontend/scenes/NewSourceScene/NewSourceScene 1.12 kB
frontend/dist-report/exporter/_parent/products/data_warehouse/frontend/scenes/SchemaScene/SchemaScene 24.4 kB
frontend/dist-report/exporter/_parent/products/data_warehouse/frontend/scenes/SourceScene/SourceScene 1.06 kB
frontend/dist-report/exporter/_parent/products/data_warehouse/frontend/scenes/SourcesScene/SourcesScene 6.31 kB
frontend/dist-report/exporter/_parent/products/deployments/frontend/Deployment 4.05 kB
frontend/dist-report/exporter/_parent/products/deployments/frontend/DeploymentProject 5.58 kB
frontend/dist-report/exporter/_parent/products/deployments/frontend/Deployments 9.31 kB
frontend/dist-report/exporter/_parent/products/early_access_features/frontend/EarlyAccessFeature 1.02 kB
frontend/dist-report/exporter/_parent/products/early_access_features/frontend/EarlyAccessFeatures 3.24 kB
frontend/dist-report/exporter/_parent/products/endpoints/frontend/EndpointScene 40.6 kB
frontend/dist-report/exporter/_parent/products/endpoints/frontend/EndpointsScene 24.5 kB
frontend/dist-report/exporter/_parent/products/error_tracking/frontend/scenes/ErrorTrackingFingerprintsScene/ErrorTrackingIssueFingerprintsScene 7.41 kB
frontend/dist-report/exporter/_parent/products/error_tracking/frontend/scenes/ErrorTrackingIssueScene/ErrorTrackingIssueScene 104 kB
frontend/dist-report/exporter/_parent/products/error_tracking/frontend/scenes/ErrorTrackingScene/ErrorTrackingScene 27.1 kB
frontend/dist-report/exporter/_parent/products/feature_flags/frontend/FeatureFlagTemplatesScene 7.38 kB
frontend/dist-report/exporter/_parent/products/games/368Hedgehogs/368Hedgehogs 5.61 kB
frontend/dist-report/exporter/_parent/products/games/FlappyHog/FlappyHog 6.12 kB
frontend/dist-report/exporter/_parent/products/legal_documents/frontend/scenes/LegalDocumentNewScene 59.7 kB
frontend/dist-report/exporter/_parent/products/legal_documents/frontend/scenes/LegalDocumentsScene 5.31 kB
frontend/dist-report/exporter/_parent/products/links/frontend/LinkScene 25.2 kB
frontend/dist-report/exporter/_parent/products/links/frontend/LinksScene 4.55 kB
frontend/dist-report/exporter/_parent/products/live_debugger/frontend/LiveDebugger 19.5 kB
frontend/dist-report/exporter/_parent/products/logs/frontend/LogsScene 17.9 kB
frontend/dist-report/exporter/_parent/products/logs/frontend/scenes/LogsAlertDetailScene/LogsAlertDetailScene 17.3 kB
frontend/dist-report/exporter/_parent/products/logs/frontend/scenes/LogsSamplingDetailScene/LogsSamplingDetailScene 5.3 kB
frontend/dist-report/exporter/_parent/products/logs/frontend/scenes/LogsSamplingNewScene/LogsSamplingNewScene 2.25 kB
frontend/dist-report/exporter/_parent/products/managed_migrations/frontend/ManagedMigration 14.9 kB
frontend/dist-report/exporter/_parent/products/mcp_analytics/frontend/MCPAnalyticsScene 40.5 kB
frontend/dist-report/exporter/_parent/products/mcp_analytics/frontend/MCPAnalyticsToolDetail 18.5 kB
frontend/dist-report/exporter/_parent/products/metrics/frontend/MetricsScene 16.2 kB
frontend/dist-report/exporter/_parent/products/product_analytics/frontend/insights/stickiness/StickinessBarChart/StickinessBarChart 3.31 kB
frontend/dist-report/exporter/_parent/products/product_analytics/frontend/insights/stickiness/StickinessLineChart/StickinessLineChart 3.14 kB
frontend/dist-report/exporter/_parent/products/product_analytics/frontend/insights/trends/TrendsBarChart/TrendsBarChart 7.36 kB
frontend/dist-report/exporter/_parent/products/product_analytics/frontend/insights/trends/TrendsLifecycleChart/TrendsLifecycleChart 4.25 kB
frontend/dist-report/exporter/_parent/products/product_analytics/frontend/insights/trends/TrendsLineChart/TrendsLineChart 4.6 kB
frontend/dist-report/exporter/_parent/products/product_analytics/frontend/insights/trends/TrendsPieChart/TrendsPieChart 4.35 kB
frontend/dist-report/exporter/_parent/products/replay_vision/frontend/observations/ReplayObservation 8.14 kB
frontend/dist-report/exporter/_parent/products/replay_vision/frontend/replay_scanners/ReplayScanner 34 kB
frontend/dist-report/exporter/_parent/products/replay_vision/frontend/replay_scanners/ReplayScannersScene 11.6 kB
frontend/dist-report/exporter/_parent/products/replay_vision/frontend/replay_scanners/ScannerTemplatesScene 4.59 kB
frontend/dist-report/exporter/_parent/products/revenue_analytics/frontend/RevenueAnalyticsScene 26.5 kB
frontend/dist-report/exporter/_parent/products/session_summaries/frontend/SessionGroupSummariesTable 5.05 kB
frontend/dist-report/exporter/_parent/products/session_summaries/frontend/SessionGroupSummaryScene 19.2 kB
frontend/dist-report/exporter/_parent/products/tasks/frontend/SlackTaskContextScene 8.88 kB
frontend/dist-report/exporter/_parent/products/tasks/frontend/TaskDetailScene 23.8 kB
frontend/dist-report/exporter/_parent/products/tasks/frontend/TaskTracker 14.6 kB
frontend/dist-report/exporter/_parent/products/tracing/frontend/TracingScene 54.4 kB
frontend/dist-report/exporter/_parent/products/user_interviews/frontend/UserInterview 9.32 kB
frontend/dist-report/exporter/_parent/products/user_interviews/frontend/UserInterviewResponse 7.79 kB
frontend/dist-report/exporter/_parent/products/user_interviews/frontend/UserInterviews 6.08 kB
frontend/dist-report/exporter/_parent/products/visual_review/frontend/scenes/VisualReviewIndexScene 2.56 kB
frontend/dist-report/exporter/_parent/products/visual_review/frontend/scenes/VisualReviewRunScene 44.7 kB
frontend/dist-report/exporter/_parent/products/visual_review/frontend/scenes/VisualReviewRunsScene 7.32 kB
frontend/dist-report/exporter/_parent/products/visual_review/frontend/scenes/VisualReviewSettingsScene 11.1 kB
frontend/dist-report/exporter/_parent/products/visual_review/frontend/scenes/VisualReviewSnapshotHistoryScene 13.9 kB
frontend/dist-report/exporter/_parent/products/visual_review/frontend/scenes/VisualReviewSnapshotOverviewScene 19.6 kB
frontend/dist-report/exporter/_parent/products/workflows/frontend/TemplateLibrary/MessageTemplate 16.6 kB
frontend/dist-report/exporter/_parent/products/workflows/frontend/Workflows/WorkflowScene 111 kB
frontend/dist-report/exporter/_parent/products/workflows/frontend/WorkflowsScene 60.2 kB
frontend/dist-report/exporter/src/exporter/exporter 19.7 kB
frontend/dist-report/exporter/src/exporter/scenes/ExporterDashboardScene 2.02 kB
frontend/dist-report/exporter/src/exporter/scenes/ExporterHeatmapScene 19.9 kB
frontend/dist-report/exporter/src/exporter/scenes/ExporterInsightScene 3.02 kB
frontend/dist-report/exporter/src/exporter/scenes/ExporterInterviewScene 310 kB
frontend/dist-report/exporter/src/exporter/scenes/ExporterNotebookScene 2.71 MB
frontend/dist-report/exporter/src/exporter/scenes/ExporterRecordingScene 1.13 kB
frontend/dist-report/exporter/src/exporterSharedChunkAnchors 1.19 kB
frontend/dist-report/exporter/src/lib/components/Cards/TextCard/TextCardMarkdownEditor 11.3 kB
frontend/dist-report/exporter/src/lib/components/MonacoDiffEditor 471 B
frontend/dist-report/exporter/src/lib/lemon-ui/LemonMarkdown/MermaidDiagram 2.25 kB
frontend/dist-report/exporter/src/lib/lemon-ui/LemonTextArea/LemonTextAreaMarkdown 842 B
frontend/dist-report/exporter/src/lib/lemon-ui/Link/Link 359 B
frontend/dist-report/exporter/src/lib/monaco/CodeEditorInline 832 B
frontend/dist-report/exporter/src/lib/monaco/vimMode 211 kB
frontend/dist-report/exporter/src/lib/ui/Button/ButtonPrimitives 422 B
frontend/dist-report/exporter/src/queries/nodes/WebVitals/WebVitals 7.52 kB
frontend/dist-report/exporter/src/queries/nodes/WebVitals/WebVitalsPathBreakdown 4.09 kB
frontend/dist-report/exporter/src/queries/schema 852 kB
frontend/dist-report/exporter/src/scenes/approvals/changeRequestsLogic 884 B
frontend/dist-report/exporter/src/scenes/authentication/passkeyLogic 824 B
frontend/dist-report/exporter/src/scenes/data-pipelines/event-filtering/EventFilterScene 22.2 kB
frontend/dist-report/exporter/src/scenes/data-pipelines/TransformationsScene 6.54 kB
frontend/dist-report/exporter/src/scenes/insights/views/BoxPlot/BoxPlot 5.39 kB
frontend/dist-report/exporter/src/scenes/insights/views/CalendarHeatMap/CalendarHeatMap 8.84 kB
frontend/dist-report/exporter/src/scenes/insights/views/RegionMap/RegionMap 29.8 kB
frontend/dist-report/exporter/src/scenes/insights/views/WorldMap/WorldMap 1.04 MB
frontend/dist-report/exporter/src/scenes/models/ModelsScene 19 kB
frontend/dist-report/exporter/src/scenes/models/NodeDetailScene 17 kB
frontend/dist-report/monaco-editor-worker/src/lib/monaco/workers/monacoEditorWorker 288 kB
frontend/dist-report/monaco-json-worker/src/lib/monaco/workers/monacoJsonWorker 419 kB
frontend/dist-report/monaco-typescript-worker/src/lib/monaco/workers/monacoTsWorker 7.02 MB
frontend/dist-report/posthog-app/_parent/products/actions/frontend/pages/Action 25.1 kB
frontend/dist-report/posthog-app/_parent/products/actions/frontend/pages/Actions 1.4 kB
frontend/dist-report/posthog-app/_parent/products/ai_observability/frontend/AIObservabilityScene 119 kB
frontend/dist-report/posthog-app/_parent/products/ai_observability/frontend/AIObservabilitySessionScene 18.4 kB
frontend/dist-report/posthog-app/_parent/products/ai_observability/frontend/AIObservabilityTraceScene 130 kB
frontend/dist-report/posthog-app/_parent/products/ai_observability/frontend/AIObservabilityUsers 906 B
frontend/dist-report/posthog-app/_parent/products/ai_observability/frontend/clusters/AIObservabilityClusterScene 21.7 kB
frontend/dist-report/posthog-app/_parent/products/ai_observability/frontend/clusters/AIObservabilityClustersScene 55.1 kB
frontend/dist-report/posthog-app/_parent/products/ai_observability/frontend/datasets/AIObservabilityDatasetScene 21 kB
frontend/dist-report/posthog-app/_parent/products/ai_observability/frontend/datasets/AIObservabilityDatasetsScene 3.67 kB
frontend/dist-report/posthog-app/_parent/products/ai_observability/frontend/evaluations/AIObservabilityEvaluation 59.9 kB
frontend/dist-report/posthog-app/_parent/products/ai_observability/frontend/evaluations/AIObservabilityEvaluationsScene 28.2 kB
frontend/dist-report/posthog-app/_parent/products/ai_observability/frontend/evaluations/EvaluationTemplates 949 B
frontend/dist-report/posthog-app/_parent/products/ai_observability/frontend/LLMASessionFeedbackDisplay 5.23 kB
frontend/dist-report/posthog-app/_parent/products/ai_observability/frontend/playground/AIObservabilityPlaygroundScene 37.8 kB
frontend/dist-report/posthog-app/_parent/products/ai_observability/frontend/prompts/LLMPromptScene 29.2 kB
frontend/dist-report/posthog-app/_parent/products/ai_observability/frontend/prompts/LLMPromptsScene 4.86 kB
frontend/dist-report/posthog-app/_parent/products/ai_observability/frontend/skills/LLMSkillScene 963 B
frontend/dist-report/posthog-app/_parent/products/ai_observability/frontend/skills/LLMSkillsScene 980 B
frontend/dist-report/posthog-app/_parent/products/ai_observability/frontend/tags/AIObservabilityTag 27.4 kB
frontend/dist-report/posthog-app/_parent/products/ai_observability/frontend/tags/AIObservabilityTagsScene 7.34 kB
frontend/dist-report/posthog-app/_parent/products/business_knowledge/frontend/scenes/BusinessKnowledgeScene 19 kB
frontend/dist-report/posthog-app/_parent/products/conversations/frontend/components/Assignee/CyclotronJobInputAssignee 1.71 kB
frontend/dist-report/posthog-app/_parent/products/conversations/frontend/components/SlaBusinessHours/CyclotronJobInputBusinessHours 3.09 kB
frontend/dist-report/posthog-app/_parent/products/conversations/frontend/components/TicketTags/CyclotronJobInputTicketTags 1.09 kB
frontend/dist-report/posthog-app/_parent/products/conversations/frontend/scenes/settings/SupportSettingsScene 1.85 kB
frontend/dist-report/posthog-app/_parent/products/conversations/frontend/scenes/ticket/SupportTicketScene 26.6 kB
frontend/dist-report/posthog-app/_parent/products/conversations/frontend/scenes/tickets/SupportTicketsScene 1.11 kB
frontend/dist-report/posthog-app/_parent/products/customer_analytics/frontend/CustomerAnalyticsScene 51.9 kB
frontend/dist-report/posthog-app/_parent/products/customer_analytics/frontend/scenes/CustomerAnalyticsConfigurationScene/CustomerAnalyticsConfigurationScene 2.68 kB
frontend/dist-report/posthog-app/_parent/products/customer_analytics/frontend/scenes/CustomerJourneyBuilderScene/CustomerJourneyBuilderScene 2.22 kB
frontend/dist-report/posthog-app/_parent/products/customer_analytics/frontend/scenes/CustomerJourneyTemplatesScene/CustomerJourneyTemplatesScene 7.9 kB
frontend/dist-report/posthog-app/_parent/products/data_warehouse/DataWarehouseScene 1.81 kB
frontend/dist-report/posthog-app/_parent/products/data_warehouse/frontend/scenes/NewSourceScene/NewSourceScene 1.18 kB
frontend/dist-report/posthog-app/_parent/products/data_warehouse/frontend/scenes/SchemaScene/SchemaScene 24.4 kB
frontend/dist-report/posthog-app/_parent/products/data_warehouse/frontend/scenes/SourceScene/SourceScene 1.1 kB
frontend/dist-report/posthog-app/_parent/products/data_warehouse/frontend/scenes/SourcesScene/SourcesScene 6.34 kB
frontend/dist-report/posthog-app/_parent/products/deployments/frontend/Deployment 4.08 kB
frontend/dist-report/posthog-app/_parent/products/deployments/frontend/DeploymentProject 5.61 kB
frontend/dist-report/posthog-app/_parent/products/deployments/frontend/Deployments 9.35 kB
frontend/dist-report/posthog-app/_parent/products/early_access_features/frontend/EarlyAccessFeature 1.2 kB
frontend/dist-report/posthog-app/_parent/products/early_access_features/frontend/EarlyAccessFeatures 3.28 kB
frontend/dist-report/posthog-app/_parent/products/endpoints/frontend/EndpointScene 40.7 kB
frontend/dist-report/posthog-app/_parent/products/endpoints/frontend/EndpointsScene 22.4 kB
frontend/dist-report/posthog-app/_parent/products/error_tracking/frontend/scenes/ErrorTrackingFingerprintsScene/ErrorTrackingIssueFingerprintsScene 7.48 kB
frontend/dist-report/posthog-app/_parent/products/error_tracking/frontend/scenes/ErrorTrackingIssueScene/ErrorTrackingIssueScene 103 kB
frontend/dist-report/posthog-app/_parent/products/error_tracking/frontend/scenes/ErrorTrackingScene/ErrorTrackingScene 27.2 kB
frontend/dist-report/posthog-app/_parent/products/feature_flags/frontend/FeatureFlagTemplatesScene 7.42 kB
frontend/dist-report/posthog-app/_parent/products/games/368Hedgehogs/368Hedgehogs 5.65 kB
frontend/dist-report/posthog-app/_parent/products/games/FlappyHog/FlappyHog 6.16 kB
frontend/dist-report/posthog-app/_parent/products/legal_documents/frontend/scenes/LegalDocumentNewScene 59.8 kB
frontend/dist-report/posthog-app/_parent/products/legal_documents/frontend/scenes/LegalDocumentsScene 5.35 kB
frontend/dist-report/posthog-app/_parent/products/links/frontend/LinkScene 25.2 kB
frontend/dist-report/posthog-app/_parent/products/links/frontend/LinksScene 4.58 kB
frontend/dist-report/posthog-app/_parent/products/live_debugger/frontend/LiveDebugger 19.5 kB
frontend/dist-report/posthog-app/_parent/products/logs/frontend/LogsScene 17.9 kB
frontend/dist-report/posthog-app/_parent/products/logs/frontend/scenes/LogsAlertDetailScene/LogsAlertDetailScene 17.4 kB
frontend/dist-report/posthog-app/_parent/products/logs/frontend/scenes/LogsSamplingDetailScene/LogsSamplingDetailScene 5.34 kB
frontend/dist-report/posthog-app/_parent/products/logs/frontend/scenes/LogsSamplingNewScene/LogsSamplingNewScene 2.29 kB
frontend/dist-report/posthog-app/_parent/products/managed_migrations/frontend/ManagedMigration 14.9 kB
frontend/dist-report/posthog-app/_parent/products/mcp_analytics/frontend/MCPAnalyticsScene 40.6 kB
frontend/dist-report/posthog-app/_parent/products/mcp_analytics/frontend/MCPAnalyticsToolDetail 18.6 kB
frontend/dist-report/posthog-app/_parent/products/metrics/frontend/MetricsScene 16.2 kB
frontend/dist-report/posthog-app/_parent/products/product_analytics/frontend/insights/stickiness/StickinessBarChart/StickinessBarChart 3.34 kB
frontend/dist-report/posthog-app/_parent/products/product_analytics/frontend/insights/stickiness/StickinessLineChart/StickinessLineChart 3.18 kB
frontend/dist-report/posthog-app/_parent/products/product_analytics/frontend/insights/trends/TrendsBarChart/TrendsBarChart 7.4 kB
frontend/dist-report/posthog-app/_parent/products/product_analytics/frontend/insights/trends/TrendsLifecycleChart/TrendsLifecycleChart 4.28 kB
frontend/dist-report/posthog-app/_parent/products/product_analytics/frontend/insights/trends/TrendsLineChart/TrendsLineChart 4.64 kB
frontend/dist-report/posthog-app/_parent/products/product_analytics/frontend/insights/trends/TrendsPieChart/TrendsPieChart 4.38 kB
frontend/dist-report/posthog-app/_parent/products/replay_vision/frontend/observations/ReplayObservation 8.18 kB
frontend/dist-report/posthog-app/_parent/products/replay_vision/frontend/replay_scanners/ReplayScanner 34 kB
frontend/dist-report/posthog-app/_parent/products/replay_vision/frontend/replay_scanners/ReplayScannersScene 11.6 kB
frontend/dist-report/posthog-app/_parent/products/replay_vision/frontend/replay_scanners/ScannerTemplatesScene 4.63 kB
frontend/dist-report/posthog-app/_parent/products/revenue_analytics/frontend/RevenueAnalyticsScene 26.6 kB
frontend/dist-report/posthog-app/_parent/products/session_summaries/frontend/SessionGroupSummariesTable 5.09 kB
frontend/dist-report/posthog-app/_parent/products/session_summaries/frontend/SessionGroupSummaryScene 19.3 kB
frontend/dist-report/posthog-app/_parent/products/tasks/frontend/SlackTaskContextScene 8.91 kB
frontend/dist-report/posthog-app/_parent/products/tasks/frontend/TaskDetailScene 23.9 kB
frontend/dist-report/posthog-app/_parent/products/tasks/frontend/TaskTracker 14.7 kB
frontend/dist-report/posthog-app/_parent/products/tracing/frontend/TracingScene 54.5 kB
frontend/dist-report/posthog-app/_parent/products/user_interviews/frontend/UserInterview 9.35 kB
frontend/dist-report/posthog-app/_parent/products/user_interviews/frontend/UserInterviewResponse 7.83 kB
frontend/dist-report/posthog-app/_parent/products/user_interviews/frontend/UserInterviews 6.12 kB
frontend/dist-report/posthog-app/_parent/products/visual_review/frontend/scenes/VisualReviewIndexScene 2.59 kB
frontend/dist-report/posthog-app/_parent/products/visual_review/frontend/scenes/VisualReviewRunScene 44.7 kB
frontend/dist-report/posthog-app/_parent/products/visual_review/frontend/scenes/VisualReviewRunsScene 7.36 kB
frontend/dist-report/posthog-app/_parent/products/visual_review/frontend/scenes/VisualReviewSettingsScene 11.1 kB
frontend/dist-report/posthog-app/_parent/products/visual_review/frontend/scenes/VisualReviewSnapshotHistoryScene 13.9 kB
frontend/dist-report/posthog-app/_parent/products/visual_review/frontend/scenes/VisualReviewSnapshotOverviewScene 19.6 kB
frontend/dist-report/posthog-app/_parent/products/workflows/frontend/TemplateLibrary/MessageTemplate 16.7 kB
frontend/dist-report/posthog-app/_parent/products/workflows/frontend/Workflows/WorkflowScene 104 kB
frontend/dist-report/posthog-app/_parent/products/workflows/frontend/WorkflowsScene 60.3 kB
frontend/dist-report/posthog-app/src/index 61.1 kB
frontend/dist-report/posthog-app/src/layout/panel-layout/ai-first/tabs/NavTabChat 7.19 kB
frontend/dist-report/posthog-app/src/lib/components/Cards/TextCard/TextCardMarkdownEditor 11.3 kB
frontend/dist-report/posthog-app/src/lib/components/MonacoDiffEditor 471 B
frontend/dist-report/posthog-app/src/lib/lemon-ui/LemonMarkdown/MermaidDiagram 2.29 kB
frontend/dist-report/posthog-app/src/lib/lemon-ui/LemonTextArea/LemonTextAreaMarkdown 876 B
frontend/dist-report/posthog-app/src/lib/lemon-ui/Link/Link 359 B
frontend/dist-report/posthog-app/src/lib/monaco/CodeEditorInline 866 B
frontend/dist-report/posthog-app/src/lib/monaco/vimMode 211 kB
frontend/dist-report/posthog-app/src/lib/ui/Button/ButtonPrimitives 426 B
frontend/dist-report/posthog-app/src/queries/nodes/WebVitals/WebVitals 7.55 kB
frontend/dist-report/posthog-app/src/queries/nodes/WebVitals/WebVitalsPathBreakdown 4.12 kB
frontend/dist-report/posthog-app/src/queries/schema 852 kB
frontend/dist-report/posthog-app/src/scenes/activity/explore/EventsScene 3.32 kB
frontend/dist-report/posthog-app/src/scenes/activity/explore/SessionsScene 4.72 kB
frontend/dist-report/posthog-app/src/scenes/activity/live/LiveEventsTable 5.62 kB
frontend/dist-report/posthog-app/src/scenes/agentic/AgenticAuthorize 5.87 kB
frontend/dist-report/posthog-app/src/scenes/approvals/ApprovalDetail 16.6 kB
frontend/dist-report/posthog-app/src/scenes/approvals/changeRequestsLogic 918 B
frontend/dist-report/posthog-app/src/scenes/audit-logs/AdvancedActivityLogsScene 42.1 kB
frontend/dist-report/posthog-app/src/scenes/AuthenticatedShell 165 kB
frontend/dist-report/posthog-app/src/scenes/authentication/AccountConnected 3.36 kB
frontend/dist-report/posthog-app/src/scenes/authentication/AgenticAccountMismatch 2.77 kB
frontend/dist-report/posthog-app/src/scenes/authentication/CLIAuthorize 11.8 kB
frontend/dist-report/posthog-app/src/scenes/authentication/CLILive 4.4 kB
frontend/dist-report/posthog-app/src/scenes/authentication/credential-review/CredentialReview 3.98 kB
frontend/dist-report/posthog-app/src/scenes/authentication/EmailMFAVerify 3.4 kB
frontend/dist-report/posthog-app/src/scenes/authentication/InviteSignup 15.4 kB
frontend/dist-report/posthog-app/src/scenes/authentication/Login 10.2 kB
frontend/dist-report/posthog-app/src/scenes/authentication/Login2FA 5.11 kB
frontend/dist-report/posthog-app/src/scenes/authentication/passkeyLogic 858 B
frontend/dist-report/posthog-app/src/scenes/authentication/PasswordReset 4.74 kB
frontend/dist-report/posthog-app/src/scenes/authentication/PasswordResetComplete 3.38 kB
frontend/dist-report/posthog-app/src/scenes/authentication/signup/SignupContainer 28.6 kB
frontend/dist-report/posthog-app/src/scenes/authentication/signup/verify-email/VerifyEmail 5.16 kB
frontend/dist-report/posthog-app/src/scenes/authentication/TwoFactorReset 4.41 kB
frontend/dist-report/posthog-app/src/scenes/authentication/VercelConnect 5.37 kB
frontend/dist-report/posthog-app/src/scenes/authentication/VercelLinkError 2.64 kB
frontend/dist-report/posthog-app/src/scenes/billing/AuthorizationStatus 1.1 kB
frontend/dist-report/posthog-app/src/scenes/billing/Billing 867 B
frontend/dist-report/posthog-app/src/scenes/billing/BillingSection 21.2 kB
frontend/dist-report/posthog-app/src/scenes/cohorts/Cohort 28.4 kB
frontend/dist-report/posthog-app/src/scenes/cohorts/CohortCalculationHistory 6.61 kB
frontend/dist-report/posthog-app/src/scenes/cohorts/Cohorts 9.81 kB
frontend/dist-report/posthog-app/src/scenes/coupons/Coupons 1.1 kB
frontend/dist-report/posthog-app/src/scenes/dashboard/Dashboard 1.68 kB
frontend/dist-report/posthog-app/src/scenes/dashboard/dashboards/Dashboards 19.9 kB
frontend/dist-report/posthog-app/src/scenes/dashboard/dashboards/templates/DashboardTemplateCopyScene 6.09 kB
frontend/dist-report/posthog-app/src/scenes/data-management/DataManagementScene 1.02 kB
frontend/dist-report/posthog-app/src/scenes/data-management/definition/DefinitionEdit 17.2 kB
frontend/dist-report/posthog-app/src/scenes/data-management/definition/DefinitionView 24.4 kB
frontend/dist-report/posthog-app/src/scenes/data-management/MaterializedColumns/MaterializedColumns 12 kB
frontend/dist-report/posthog-app/src/scenes/data-management/variables/SqlVariableEditScene 7.63 kB
frontend/dist-report/posthog-app/src/scenes/data-pipelines/batch-exports/BatchExportScene 61 kB
frontend/dist-report/posthog-app/src/scenes/data-pipelines/DataPipelinesNewScene 2.69 kB
frontend/dist-report/posthog-app/src/scenes/data-pipelines/DestinationsScene 3.06 kB
frontend/dist-report/posthog-app/src/scenes/data-pipelines/event-filtering/EventFilterScene 22.3 kB
frontend/dist-report/posthog-app/src/scenes/data-pipelines/legacy-plugins/LegacyPluginScene 21 kB
frontend/dist-report/posthog-app/src/scenes/data-pipelines/TransformationsScene 2.3 kB
frontend/dist-report/posthog-app/src/scenes/data-pipelines/WebScriptsScene 2.92 kB
frontend/dist-report/posthog-app/src/scenes/data-warehouse/DataWarehouseScene 1.75 kB
frontend/dist-report/posthog-app/src/scenes/data-warehouse/editor/EditorScene 1.52 kB
frontend/dist-report/posthog-app/src/scenes/debug/DebugScene 20.3 kB
frontend/dist-report/posthog-app/src/scenes/debug/hog/HogRepl 7.75 kB
frontend/dist-report/posthog-app/src/scenes/experiments/Experiment 207 kB
frontend/dist-report/posthog-app/src/scenes/experiments/Experiments 20.9 kB
frontend/dist-report/posthog-app/src/scenes/experiments/SharedMetrics/SharedMetric 6.45 kB
frontend/dist-report/posthog-app/src/scenes/experiments/SharedMetrics/SharedMetrics 923 B
frontend/dist-report/posthog-app/src/scenes/exports/ExportsScene 4.36 kB
frontend/dist-report/posthog-app/src/scenes/feature-flags/FeatureFlag 144 kB
frontend/dist-report/posthog-app/src/scenes/feature-flags/FeatureFlags 1.12 kB
frontend/dist-report/posthog-app/src/scenes/groups/Group 15.6 kB
frontend/dist-report/posthog-app/src/scenes/groups/Groups 4.29 kB
frontend/dist-report/posthog-app/src/scenes/groups/GroupsNew 7.73 kB
frontend/dist-report/posthog-app/src/scenes/health-alerts/HealthAlertsScene 4.17 kB
frontend/dist-report/posthog-app/src/scenes/health/categoryDetail/HealthCategoryDetailScene 7.64 kB
frontend/dist-report/posthog-app/src/scenes/health/HealthScene 12.8 kB
frontend/dist-report/posthog-app/src/scenes/health/pipelineStatus/PipelineStatusScene 11.5 kB
frontend/dist-report/posthog-app/src/scenes/heatmaps/scenes/heatmap/HeatmapNewScene 5.41 kB
frontend/dist-report/posthog-app/src/scenes/heatmaps/scenes/heatmap/HeatmapRecordingScene 4.31 kB
frontend/dist-report/posthog-app/src/scenes/heatmaps/scenes/heatmap/HeatmapScene 6.94 kB
frontend/dist-report/posthog-app/src/scenes/heatmaps/scenes/heatmaps/HeatmapsScene 4.27 kB
frontend/dist-report/posthog-app/src/scenes/hog-functions/HogFunctionScene 59.6 kB
frontend/dist-report/posthog-app/src/scenes/inbox/InboxScene 63.3 kB
frontend/dist-report/posthog-app/src/scenes/insights/InsightQuickStart/InsightQuickStart 5.81 kB
frontend/dist-report/posthog-app/src/scenes/insights/InsightScene 34.8 kB
frontend/dist-report/posthog-app/src/scenes/insights/views/BoxPlot/BoxPlot 5.43 kB
frontend/dist-report/posthog-app/src/scenes/insights/views/CalendarHeatMap/CalendarHeatMap 4.87 kB
frontend/dist-report/posthog-app/src/scenes/insights/views/RegionMap/RegionMap 29.8 kB
frontend/dist-report/posthog-app/src/scenes/insights/views/WorldMap/WorldMap 5.16 kB
frontend/dist-report/posthog-app/src/scenes/instance/AsyncMigrations/AsyncMigrations 13.5 kB
frontend/dist-report/posthog-app/src/scenes/instance/DeadLetterQueue/DeadLetterQueue 5.77 kB
frontend/dist-report/posthog-app/src/scenes/instance/QueryPerformance/QueryPerformance 9 kB
frontend/dist-report/posthog-app/src/scenes/instance/SystemStatus/SystemStatus 17.4 kB
frontend/dist-report/posthog-app/src/scenes/IntegrationsRedirect/IntegrationsRedirect 1.11 kB
frontend/dist-report/posthog-app/src/scenes/marketing-analytics/MarketingAnalyticsScene 42.1 kB
frontend/dist-report/posthog-app/src/scenes/max/Max 1.06 kB
frontend/dist-report/posthog-app/src/scenes/models/ModelsScene 19.1 kB
frontend/dist-report/posthog-app/src/scenes/models/NodeDetailScene 17.1 kB
frontend/dist-report/posthog-app/src/scenes/moveToPostHogCloud/MoveToPostHogCloud 4.84 kB
frontend/dist-report/posthog-app/src/scenes/new-tab/NewTabScene 1.85 kB
frontend/dist-report/posthog-app/src/scenes/notebooks/NotebookCanvasScene 3.92 kB
frontend/dist-report/posthog-app/src/scenes/notebooks/NotebookPanel/NotebookPanel 5.98 kB
frontend/dist-report/posthog-app/src/scenes/notebooks/NotebookScene 9.29 kB
frontend/dist-report/posthog-app/src/scenes/notebooks/NotebooksScene 7.98 kB
frontend/dist-report/posthog-app/src/scenes/oauth/OAuthAuthorize 1.01 kB
frontend/dist-report/posthog-app/src/scenes/onboarding/coupon/OnboardingCouponRedemption 1.58 kB
frontend/dist-report/posthog-app/src/scenes/onboarding/Onboarding 792 kB
frontend/dist-report/posthog-app/src/scenes/onboarding/sdks/SdkDoctorScene 10.2 kB
frontend/dist-report/posthog-app/src/scenes/organization/ConfirmOrganization/ConfirmOrganization 4.91 kB
frontend/dist-report/posthog-app/src/scenes/organization/Create/Create 1.03 kB
frontend/dist-report/posthog-app/src/scenes/organization/Deactivated 1.51 kB
frontend/dist-report/posthog-app/src/scenes/organization/PendingDeletion 2.48 kB
frontend/dist-report/posthog-app/src/scenes/persons/PersonScene 20.1 kB
frontend/dist-report/posthog-app/src/scenes/persons/PersonsScene 6.12 kB
frontend/dist-report/posthog-app/src/scenes/PreflightCheck/PreflightCheck 5.95 kB
frontend/dist-report/posthog-app/src/scenes/product-tours/ProductTour 275 kB
frontend/dist-report/posthog-app/src/scenes/product-tours/ProductTours 5.06 kB
frontend/dist-report/posthog-app/src/scenes/project-homepage/ProjectHomepage 19.1 kB
frontend/dist-report/posthog-app/src/scenes/project/Create/Create 1.21 kB
frontend/dist-report/posthog-app/src/scenes/resource-transfer/ResourceTransfer 9.56 kB
frontend/dist-report/posthog-app/src/scenes/saved-insights/SavedInsights 1.04 kB
frontend/dist-report/posthog-app/src/scenes/session-recordings/detail/SessionRecordingDetail 2.14 kB
frontend/dist-report/posthog-app/src/scenes/session-recordings/file-playback/SessionRecordingFilePlaybackScene 4.85 kB
frontend/dist-report/posthog-app/src/scenes/session-recordings/kiosk/SessionRecordingsKiosk 10.3 kB
frontend/dist-report/posthog-app/src/scenes/session-recordings/player/snapshot-processing/DecompressionWorkerManager 329 B
frontend/dist-report/posthog-app/src/scenes/session-recordings/playlist/SessionRecordingsPlaylistScene 5.49 kB
frontend/dist-report/posthog-app/src/scenes/session-recordings/SessionRecordings 1.15 kB
frontend/dist-report/posthog-app/src/scenes/session-recordings/settings/SessionRecordingsSettingsScene 2.35 kB
frontend/dist-report/posthog-app/src/scenes/sessions/SessionProfileScene 15.6 kB
frontend/dist-report/posthog-app/src/scenes/settings/SettingsScene 3.94 kB
frontend/dist-report/posthog-app/src/scenes/sites/Site 1.57 kB
frontend/dist-report/posthog-app/src/scenes/startups/StartupProgram 21.6 kB
frontend/dist-report/posthog-app/src/scenes/StripeConfirmInstall/StripeConfirmInstall 3.92 kB
frontend/dist-report/posthog-app/src/scenes/subscriptions/SubscriptionScene 14.4 kB
frontend/dist-report/posthog-app/src/scenes/subscriptions/SubscriptionsScene 5.23 kB
frontend/dist-report/posthog-app/src/scenes/surveys/forms/SurveyFormBuilder 1.93 kB
frontend/dist-report/posthog-app/src/scenes/surveys/Survey 1.39 kB
frontend/dist-report/posthog-app/src/scenes/surveys/Surveys 26.8 kB
frontend/dist-report/posthog-app/src/scenes/surveys/wizard/SurveyWizard 72.8 kB
frontend/dist-report/posthog-app/src/scenes/themes/CustomCssScene 3.94 kB
frontend/dist-report/posthog-app/src/scenes/toolbar-launch/ToolbarLaunch 2.85 kB
frontend/dist-report/posthog-app/src/scenes/Unsubscribe/Unsubscribe 2.04 kB
frontend/dist-report/posthog-app/src/scenes/web-analytics/SessionAttributionExplorer/SessionAttributionExplorerScene 7.01 kB
frontend/dist-report/posthog-app/src/scenes/web-analytics/WebAnalyticsScene 13.3 kB
frontend/dist-report/posthog-app/src/scenes/wizard/Wizard 4.83 kB
frontend/dist-report/posthog-app/src/sharedChunkAnchors 1.19 kB

compressed-size-action

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 31, 2026

Prompt To Fix All With AI
Fix the following 2 code review issues. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 2
frontend/src/models/primaryEventPropertiesModel.ts:45-53
**Stale optimistic state permanently shadows server refreshes**

`optimisticPrimaryProperties` entries are never removed — they accumulate for the lifetime of the model (a global singleton). The `primaryProperties` selector always lets `optimisticPrimaryProperties` override `loadedPrimaryProperties`, so once a user pins or unpins a property, any subsequent server refresh via `refreshLoadedPrimaryProperties` will be silently overridden by that stale local value.

Concrete breakage: User A unpins `prop_a` (optimistic entry becomes `{ my_event: null }`). User B pins `prop_b`. User A's model refreshes, loading `{ my_event: 'prop_b' }` into `loadedPrimaryProperties`. The selector still deletes `my_event` because `optimisticPrimaryProperties[my_event]` is `null`, so User A's UI shows no primary property even though the server has one.

The same happens after a revert on failure: `applyOptimisticPrimaryProperty(eventName, previous)` writes the old loaded value into optimistic state, meaning any future server update to that event's definition will be shadowed until a full page reload. A `clearOptimisticPrimaryProperty` action dispatched from the `finishSavingPrimaryProperty` success path would fix this.

### Issue 2 of 2
frontend/src/models/primaryEventPropertiesModel.test.ts:46-79
**Success and failure paths are candidates for parameterised tests**

The `'optimistically applies the pin'` and `'reverts the pin'` cases share the same trigger (`setPrimaryProperty('my_event', 'chosen_prop')`), the same initial dispatch (`applyOptimisticPrimaryProperty('my_event', 'chosen_prop')`), and diverge only in the mock response code, the revert dispatch, and the expected final state. Per the codebase preference for parameterised tests, combining them via `it.each` would remove the duplication and make the behavioural contract easier to extend.

Reviews (1): Last reviewed commit: "feat(replay): pin a primary property fro..." | Re-trigger Greptile

Comment thread frontend/src/models/primaryEventPropertiesModel.ts Outdated
Comment thread frontend/src/models/primaryEventPropertiesModel.test.ts Outdated
Copy link
Copy Markdown
Member Author

@pauldambra pauldambra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QA Swarm review complete. See inline comments and the summary comment below.

Comment thread frontend/src/models/primaryEventPropertiesModel.ts Outdated
Comment thread frontend/src/models/primaryEventPropertiesModel.ts Outdated
Comment thread frontend/src/models/primaryEventPropertiesModel.ts Outdated
Comment thread frontend/src/lib/components/SimpleKeyValueList.tsx Outdated
Comment thread frontend/src/lib/components/SimpleKeyValueList.tsx Outdated
@pauldambra
Copy link
Copy Markdown
Member Author

Note

🤖 Automated comment by QA Swarm — not written by a human

Multi-perspective review: qa-team (specialists + generalists), paul-reviewer, xp-reviewer, security-audit

Verdict: ⚠️ REQUEST CHANGES

One convergent correctness issue worth fixing before merge (optimistic state is never reconciled with the server on success). Everything else is LOW/NIT. security-audit found nothing exploitable.

Key findings

  • 🟠 HIGH (convergent: qa-team + xp)primaryEventPropertiesModel: on a successful save the optimistic entry is never cleared and loadedPrimaryProperties is never reloaded, so the primaryProperties selector permanently shadows server truth after a refresh or a concurrent change. The optimistic map is also append-only. Fix: clear/fold the confirmed value on success.
  • 🟡 MEDIUM (convergent: paul + xp + qa-team) — the per-click byNameupdate round trip 404s for events whose definitions lag ingestion, and the generic "please try again" toast misleads on 404/403. Consider a by-name upsert and a clearer message.
  • 🟡 MEDIUM (xp)PinPrimaryPropertyButton has the most branching in the PR and no test; a parameterized (hasTaxonomy, isPrimary, isPinned) component test would lock it in.
  • 🟢 LOW — add a data-attr to the pin for an adoption funnel (paul); memoize primaryPropertyActions (qa-team); document the group/kv-row reveal coupling on rowActions (paul).
  • NITkey in item.data.properties guard deserves a comment (it hides the pin for the synthetic $timestamp); built-in pin lacks active styling; raw eventName in tooltips; long-key truncation check.

Convergence

  • Optimistic state never reconciled on success — independently flagged HIGH by qa-team/data-integrity and xp. Highest confidence.
  • byName round trip / 404 / generic error — flagged by paul, xp, and qa-team/frontend.

Reviewer summaries

Reviewer Assessment
🔍 qa-team Well-scoped, flag-gated, well-tested; one HIGH data-integrity issue (no success reconciliation), rest LOW/NIT.
👤 paul Clean optimistic flow; wants a clearer 404 message and a data-attr for adoption; rowActions/group coupling is a minor fragility.
📐 xp Good separation of concerns; reconcile optimistic state on success, add a test for the branchy button, drop/comment the redundant guard.
🛡 security-audit No exploitable findings — backend endpoints are team-scoped, no XSS sink, no mass assignment, no IDOR.

Automated by QA Swarm — not a human review

The primary-property model kept its optimistic override forever: on a
successful save the optimistic entry was never cleared and the loaded
map was never updated, so the primaryProperties selector shadowed any
later server refresh (e.g. from the edit page or another tab) with the
stale optimistic value, and the optimistic map only ever grew.

Make the loaded map a plain reducer so a successful save folds the
confirmed value straight into it (no extra round trip), and clear the
optimistic entry in a finally block on both the success and failure
paths. Optimistic state now only holds in-flight writes; loaded is the
single source of truth once a save settles.

Generated-By: PostHog Code
Task-Id: 35d6c5ec-a607-44ce-806d-1a4055a59e7b
@pauldambra pauldambra added the stamphog Request AI review from stamphog label May 31, 2026
Copy link
Copy Markdown

@stamphog stamphog Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review agent failed after 3 attempts — needs human review.

@stamphog stamphog Bot removed the stamphog Request AI review from stamphog label May 31, 2026
Comment thread frontend/src/models/primaryEventPropertiesModel.ts Outdated
loadedEventNames was updated when loadPrimaryProperties was dispatched,
so a failed primary-properties fetch marked those events as loaded and
ensureLoadedForEvents skipped them forever (until a page reload). Key
the reducer off the primaryPropertiesLoaded success action instead, and
swallow a failed best-effort fetch so the events stay retryable.

Generated-By: PostHog Code
Task-Id: 35d6c5ec-a607-44ce-806d-1a4055a59e7b
@pauldambra pauldambra added the stamphog Request AI review from stamphog label May 31, 2026
github-actions[bot]
github-actions Bot previously approved these changes May 31, 2026
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feature is gated behind a flag, all critical data-integrity issues (stale optimistic state, unreconciled writes) were fixed in subsequent commits and marked resolved, and the backend by_name endpoint already exists. Remaining unresolved comments are low/medium UX nits the author is aware of — none are showstoppers.

Comment thread frontend/src/models/primaryEventPropertiesModel.ts Outdated
Copy link
Copy Markdown
Member Author

@pauldambra pauldambra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QA Swarm second pass — both prior fixes confirmed correct. Two new findings inline; verdict improved to APPROVE WITH NITS.

Comment thread frontend/src/models/primaryEventPropertiesModel.ts Outdated
Comment thread frontend/src/models/primaryEventPropertiesModel.ts Outdated
@pauldambra
Copy link
Copy Markdown
Member Author

Note

🤖 Automated comment by QA Swarm — not written by a human

Multi-perspective review (second pass): qa-team, paul-reviewer, xp-reviewer, security-audit

Verdict: 💬 APPROVE WITH NITS

Both fixes from the first pass are confirmed correct by all reviewers — optimistic state now reconciles on save and failed loads stay retryable. security-audit clean again. Two new findings, both MEDIUM and both narrow.

New findings

  • 🟡 MEDIUM (convergent: qa-team + xp) — save-vs-background-refresh interleaving race: a refresh that started before a save but resolves after it can overwrite the just-saved value once optimistic is cleared, reverting the pin until the next refresh. Guard primaryPropertiesLoaded against events in savingPrimaryPropertyForEvents, plus an interleaved test.
  • 🟡 MEDIUM (convergent: paul + qa-team) — the background load catch {} (and the save catch) swallow errors with no observability; add captureException so a failing endpoint is visible.

Still open from pass 1 (deferred)

PinPrimaryPropertyButton component test (xp, both passes), byName round-trip/404 message, data-attr for adoption, memoize primaryPropertyActions, rowActions/group-hover coupling doc, and a couple of cosmetic nits.

Reviewer summaries

Reviewer Assessment
🔍 qa-team Both fixes verified correct + well-tested; one new interleaving race (MEDIUM), rest LOW/NIT.
👤 paul Reconciliation reads clean; wants captureException in the two catches before wide rollout.
📐 xp Fixes are the simple-correct shape; five actions well-factored; interleaved-race test + button test still wanted.
🛡 security-audit No exploitable findings — server re-scopes the PATCH by project; no XSS/secret exposure.

Automated by QA Swarm — not a human review

A primary-properties refresh that started before a pin save but resolves
after it would overwrite the freshly saved value with stale server data,
reverting the pin until the next refresh. Track a per-event save version
and skip applying any load whose event was saved while the load was in
flight. Also capture load and save failures (posthog.captureException)
instead of swallowing them silently.

Generated-By: PostHog Code
Task-Id: 35d6c5ec-a607-44ce-806d-1a4055a59e7b
… group

The pin reveal previously depended on consumers knowing the magic
group/kv-row class to pair with SimpleKeyValueList's row. Render each row
through a SimpleKeyValueRow that owns its hover state and hand
isRowHovered to the rowActions render prop, so the reveal contract is a
typed boolean and no consumer reaches for a class name.

Generated-By: PostHog Code
Task-Id: 35d6c5ec-a607-44ce-806d-1a4055a59e7b
@github-actions github-actions Bot dismissed their stale review May 31, 2026 13:45

New commits pushed (delta classified non_trivial_delta) — stamphog approval dismissed; re-review running automatically.

@pauldambra pauldambra added stamphog Request AI review from stamphog and removed stamphog Request AI review from stamphog labels May 31, 2026
github-actions[bot]
github-actions Bot previously approved these changes May 31, 2026
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All critical issues (stale optimistic state, save/refresh race, silent error swallowing) were fixed in follow-up commits and verified with targeted tests. The feature is gated behind a flag, the backend endpoint already exists, and the remaining unresolved comments are low-priority UX nits with no data-integrity impact.

github-actions[bot]
github-actions Bot previously approved these changes May 31, 2026
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feature is flag-gated, all critical data-integrity issues (stale optimistic state, save/refresh race, silent error swallowing) were fixed and verified with targeted tests, and the current-head bot review approved. Remaining unresolved comments are UX nits with no production risk.

… failures

setPrimaryProperty resolved the event definition by name and then updated
it inside one try block, so a failed name lookup showed "Could not update
the pinned property" even though no update was attempted. Split the two
calls: a lookup failure now reports that the definition could not be
found and skips the update entirely, while update failures keep their own
message. Each failure is captured with its stage for observability.

Generated-By: PostHog Code
Task-Id: 35d6c5ec-a607-44ce-806d-1a4055a59e7b
@pauldambra pauldambra removed the stamphog Request AI review from stamphog label May 31, 2026
@github-actions github-actions Bot dismissed stale reviews from themself May 31, 2026 13:54

New commits pushed (delta classified non_trivial_delta) — stamphog approval dismissed; re-review running automatically.

@pauldambra pauldambra added the stamphog Request AI review from stamphog label May 31, 2026
github-actions[bot]
github-actions Bot previously approved these changes May 31, 2026
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a well-structured, feature-flag-gated frontend addition. All critical issues raised in reviews (stale optimistic state, save/refresh race condition, silent error swallowing, misleading 404 error message) were addressed in subsequent commits and are visible in the current diff. The model correctly handles optimistic updates with version-tracking to guard against in-flight refresh races, clears optimistic state in finally blocks on both success and failure, and the tests cover the key scenarios. Remaining unresolved comments are low-severity nits (memoization, data-attr tracking, component test for PinPrimaryPropertyButton) with no production risk.

Comment thread frontend/src/models/primaryEventPropertiesModel.ts Outdated
github-actions[bot]
github-actions Bot previously approved these changes May 31, 2026
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well-reviewed, feature-flag-gated frontend addition. All critical issues raised across multiple review rounds (stale optimistic state, save/refresh race condition, silent error swallowing, misleading 404 message) were addressed in subsequent commits and covered by targeted tests. Remaining unresolved comments are low-priority nits (missing data-attr, missing useCallback, PinPrimaryPropertyButton component tests) with no data-integrity or production risk.

…r branches

Add data-attrs to the pin (so pin/unpin adoption can be tracked) and give
the built-in (taxonomy) pin the same active styling as a team-pinned one
so the two "pinned" states look alike. Add a parameterized component test
over the render branches: built-in disabled pin, hidden non-primary rows
of a taxonomy event, and the hover/pinned reveal logic.

Generated-By: PostHog Code
Task-Id: 35d6c5ec-a607-44ce-806d-1a4055a59e7b
@github-actions github-actions Bot dismissed stale reviews from themself May 31, 2026 14:24

New commits pushed (delta classified non_trivial_delta) — stamphog approval dismissed; re-review running automatically.

@pauldambra pauldambra added stamphog Request AI review from stamphog and removed stamphog Request AI review from stamphog labels May 31, 2026
Copy link
Copy Markdown

@stamphog stamphog Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR exceeded the automated size ceiling (548 lines), which requires a human reviewer to sign off. The code itself is well-reviewed — all critical issues (stale optimistic state, save/refresh race, silent error swallowing, misleading 404 message) were addressed in follow-up commits with tests. One minor unresolved inline comment remains about a rapid double-pin race, but it's low-likelihood for a user-initiated action behind a feature flag.

@stamphog stamphog Bot removed the stamphog Request AI review from stamphog label May 31, 2026
Copy link
Copy Markdown

@stamphog stamphog Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR exceeded the automated size ceiling (548 lines), which requires a human reviewer to sign off. The code is well-reviewed with all critical issues addressed, but this gate requires human approval.

…imistic overlay

The model had grown a loaded/optimistic reducer split, a merge selector, a
per-event save-version guard and a saving-set reducer — all of it scaffolding
to support an optimistic overlay. Replace it with a kea loader whose
primaryProperties value is the single source of truth and a second
updatePrimaryProperty loader action that PATCHes and folds the value the API
returns back into the map. A failed update leaves the map untouched, so there
is nothing to reconcile and the stale-shadow / interleaving races disappear.
The pin button shows the loader's loading state on click instead of tracking
per-event saving itself, and lookup vs update failures keep distinct messages.

Generated-By: PostHog Code
Task-Id: 35d6c5ec-a607-44ce-806d-1a4055a59e7b
Copy link
Copy Markdown
Member Author

@pauldambra pauldambra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QA Swarm third pass — review of the loader re-architecture. All reviewers approve; findings are LOW/NIT.

Comment thread frontend/src/models/primaryEventPropertiesModel.ts
Comment thread frontend/src/models/primaryEventPropertiesModel.ts
Comment thread frontend/src/lib/components/SimpleKeyValueList.tsx
@pauldambra
Copy link
Copy Markdown
Member Author

Note

🤖 Automated comment by QA Swarm — not written by a human

Multi-perspective review (third pass) of the loader re-architecture: qa-team, paul-reviewer, xp-reviewer, security-audit

Verdict: 💬 APPROVE WITH NITS

The revert from the optimistic overlay to a plain kea loader is a genuine simplification, not a reshuffle — the loaded/optimistic split, merge selector, save-version guard and saving-set reducer all collapse into one source of truth (the loader value). All four reviewers approve; no correctness, data-integrity, or security issues. Findings are LOW/NIT.

Key findings

  • 🟡 MEDIUM (convergent: xp + paul + qa-team) — the pin button binds the loader's global primaryPropertiesLoading, so all visible pins spin/disable during any load or update (including background loads), not just the clicked one. Deliberate simplicity choice — flagged so it's not mistaken for a bug; worth a live eyeball.
  • 🟢 LOW — a caught failure resolves as updatePrimaryPropertySuccess (loader returns the unchanged map); correct but a subtle invariant. Spinner is untested. byName 404 toast wording is a slight fib for never-created definitions (same area as the deferred two-call coupling).
  • NITvalue: any on the extracted SimpleKeyValueRow could be unknown; no cross-tab refresh after a write.

Convergence

  • Global loading flag on every pin — independently flagged by xp, paul, and qa-team.

Reviewer summaries

Reviewer Assessment
🔍 qa-team Clean single-source-of-truth loader; only LOW/NIT; the success-on-failure invariant is the one worth a note.
👤 paul "Much nicer than the optimistic overlay" — global spinner worth a live look, toast wording a slight fib, otherwise ship it.
📐 xp A real simplification (removes superfluous parts, expresses the idea once); the moved loadedEventNames is a genuine correctness fix; note/test the global spinner.
🛡 security-audit No findings — server re-scopes the write, no XSS sink, captureException logs only static metadata.

Automated by QA Swarm — not a human review

…pdate

Generated-By: PostHog Code
Task-Id: 35d6c5ec-a607-44ce-806d-1a4055a59e7b
@pauldambra pauldambra added the stamphog Request AI review from stamphog label May 31, 2026
Copy link
Copy Markdown

@stamphog stamphog Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No human reviewer has signed off on the current head of this T1d-complex PR. All prior inline concerns were addressed in follow-up commits and all 44 comments are resolved, but the PR introduces a team-wide write path (pinning event definition primary properties for all team members) and needs at least one human sign-off before auto-approval.

@stamphog stamphog Bot removed the stamphog Request AI review from stamphog label May 31, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🎭 Playwright report · View test results →

⚠️ 1 flaky test:

  • Redirect to appropriate place after login (chromium)

These issues are not necessarily caused by your changes.
Annoyed by this comment? Help fix flakies and failures and it'll disappear!

Copy link
Copy Markdown
Member Author

pauldambra commented May 31, 2026

Merge activity

  • May 31, 5:05 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • May 31, 5:06 PM UTC: @pauldambra merged this pull request with Graphite.

@pauldambra pauldambra merged commit 5db280e into master May 31, 2026
226 checks passed
@pauldambra pauldambra deleted the posthog-code/replay-pin-primary-property branch May 31, 2026 17:06
@deployment-status-posthog
Copy link
Copy Markdown

deployment-status-posthog Bot commented May 31, 2026

Deploy status

Environment Status Deployed At Workflow
dev ✅ Deployed 2026-05-31 17:28 UTC Run
prod-us ✅ Deployed 2026-05-31 17:41 UTC Run
prod-eu ✅ Deployed 2026-05-31 17:41 UTC Run

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.

2 participants