Skip to content

fix(analytics): prevent posthog capture of certain elements#2191

Merged
dev-rb merged 8 commits intomainfrom
rahul/fix-disable-posthog-capture-of-some-elements
Mar 25, 2026
Merged

fix(analytics): prevent posthog capture of certain elements#2191
dev-rb merged 8 commits intomainfrom
rahul/fix-disable-posthog-capture-of-some-elements

Conversation

@dev-rb
Copy link
Copy Markdown
Contributor

@dev-rb dev-rb commented Mar 25, 2026

This PR adds the Posthog ph-no-capture class to many elements that display sensitive information that we don't want to be captured.

This is just a first pass and there are definitely other places to cover. But for now, this handles a good chunk including channels (new & old), email, documents, soup, and settings

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 25, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 72f8be91-35a1-46d6-91f7-a31fdbc7e2cc

📥 Commits

Reviewing files that changed from the base of the PR and between a7e7864 and 0c293d5.

📒 Files selected for processing (32)
  • js/app/packages/app/component/settings/Account.tsx
  • js/app/packages/app/component/split-layout/components/SplitLabel.tsx
  • js/app/packages/block-channel/component/AttachMenu.tsx
  • js/app/packages/block-channel/component/BaseInput.tsx
  • js/app/packages/block-channel/component/Compose.tsx
  • js/app/packages/block-channel/component/Message/MessageAttachments.tsx
  • js/app/packages/block-channel/component/TaskPreviewRow.tsx
  • js/app/packages/block-channel/component/Top.tsx
  • js/app/packages/block-email/component/AttachmentPill.tsx
  • js/app/packages/block-email/component/BaseInput.tsx
  • js/app/packages/block-email/component/Compose.tsx
  • js/app/packages/block-email/component/Email.tsx
  • js/app/packages/block-email/component/EmailMessageBody.tsx
  • js/app/packages/block-email/component/EmailMessageTopBar.tsx
  • js/app/packages/block-email/component/TopBar.tsx
  • js/app/packages/block-md/component/MarkdownEditor.tsx
  • js/app/packages/block-md/component/TitleEditor.tsx
  • js/app/packages/channel/Channel/Channel.tsx
  • js/app/packages/channel/Input/Attachments.tsx
  • js/app/packages/channel/Input/Editor.tsx
  • js/app/packages/channel/Message/ChannelMessage.tsx
  • js/app/packages/channel/Thread/ChannelThread.tsx
  • js/app/packages/core/component/LexicalMarkdown/component/menu/MentionsMenu/MentionsMenu.tsx
  • js/app/packages/core/component/LexicalMarkdown/component/menu/MentionsMenu/components/MentionsMenuItem.tsx
  • js/app/packages/core/component/Message.tsx
  • js/app/packages/core/component/Properties/component/panel/PropertyRow.tsx
  • js/app/packages/core/component/RecipientSelector.tsx
  • js/app/packages/core/component/TabContent.tsx
  • js/app/packages/entity/src/composed/ListEntity.tsx
  • js/app/packages/entity/src/extractors-notification/notification-stacks.tsx
  • js/app/packages/entity/src/extractors-search/search-content-hit-row.tsx
  • js/app/packages/entity/src/extractors-search/search-location.tsx

📝 Walkthrough

Summary by CodeRabbit

  • Style

    • Updated styling across multiple UI components by adding CSS class attributes to various elements throughout the application to enhance component control and behavior.
  • Refactor

    • Extended component prop signatures to support optional class customization, allowing for greater styling flexibility.

Walkthrough

Systematically adds the ph-no-capture CSS class across 32+ UI component files to exclude sensitive UI elements from session recording/analytics capture. StaticSplitLabel and TabContentRow are enhanced with optional class props to support custom styling composition.

Changes

Cohort / File(s) Summary
Account Settings
js/app/packages/app/component/settings/Account.tsx
Added ph-no-capture class to EditableField components for first/last name and TabContentRow for email.
Layout Components
js/app/packages/app/component/split-layout/components/SplitLabel.tsx
StaticSplitLabel now accepts optional class prop for custom styling; BlockItemSplitLabel adds ph-no-capture class.
Block Channel UI
js/app/packages/block-channel/component/AttachMenu.tsx, BaseInput.tsx, Compose.tsx, Message/MessageAttachments.tsx, TaskPreviewRow.tsx, Top.tsx
Added ph-no-capture class to overlay, container, and text elements; StaticSplitLabel now accepts class prop in Compose.
Block Email UI
js/app/packages/block-email/component/AttachmentPill.tsx, BaseInput.tsx, Compose.tsx, Email.tsx, EmailMessageBody.tsx, EmailMessageTopBar.tsx, TopBar.tsx
Added ph-no-capture class to attachment, editor, header, and label elements across email compose and display components.
Markdown Editors
js/app/packages/block-md/component/MarkdownEditor.tsx, TitleEditor.tsx
Added ph-no-capture class to contentEditable div elements in markdown and title editors.
Channel Core
js/app/packages/channel/Channel/Channel.tsx, Input/Attachments.tsx, Input/Editor.tsx, Message/ChannelMessage.tsx, Thread/ChannelThread.tsx
Added ph-no-capture class to message list, attachment wrappers, editor root, message slots, and reply input container; Editor now includes class in class computation.
Core Shared UI
js/app/packages/core/component/LexicalMarkdown/.../MentionsMenu.tsx, MentionsMenuItem.tsx, Message.tsx, Properties/component/panel/PropertyRow.tsx, RecipientSelector.tsx, TabContent.tsx
Added ph-no-capture class to mention items, message containers, and property values; TabContentRow now accepts optional class prop for class merging.
Entity Components
js/app/packages/entity/src/composed/ListEntity.tsx, extractors-notification/notification-stacks.tsx, extractors-search/search-content-hit-row.tsx, extractors-search/search-location.tsx
Added ph-no-capture class to sender names, message snippets, notification content, search results, and location text elements.

Possibly related PRs


Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown

@dev-rb dev-rb marked this pull request as ready for review March 25, 2026 21:25
@dev-rb dev-rb requested a review from a team as a code owner March 25, 2026 21:25
@dev-rb dev-rb merged commit 72df476 into main Mar 25, 2026
40 of 41 checks passed
@dev-rb dev-rb deleted the rahul/fix-disable-posthog-capture-of-some-elements branch March 25, 2026 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant