Skip to content

Conversation

@osterman
Copy link
Member

@osterman osterman commented Nov 18, 2025

what

  • Created CloudPosseSlackEmbed and CloudPosseOfficeHoursEmbed React components that dynamically adapt to Docusaurus theme (light/dark)
  • Replaced HubSpot form with CloudPosse embed iframe for Office Hours page
  • Added UTM tracking parameters to both embeds for analytics:
    • utm_source=atmos-docs
    • utm_medium=embed
    • utm_campaign=office-hours / slack-community
    • utm_content=community-page
  • Updated embed styling: 380px height, left-justified, max-width 80rem
  • Added allow-popups to sandbox attributes for proper link functionality
  • Added hide_title: true to Office Hours page to prevent duplicate headings

why

  • Theme awareness: Embeds now automatically switch between light/dark themes when users toggle Docusaurus theme, providing a consistent user experience
  • Better tracking: UTM parameters enable conversion rate and traffic analytics for both community engagement channels
  • Improved UX: Standardized sizing across both embeds, left-justified layout, proper link support
  • Cleaner interface: Office Hours embed heading eliminates duplicate page title
  • Modern approach: React components with MutationObserver pattern (following existing codebase patterns like Tooltip.tsx)

references

  • Updated website/docs/community/slack.mdx
  • Updated website/docs/community/office-hours.mdx
  • Created website/src/components/CloudPosseSlackEmbed/index.tsx
  • Created website/src/components/CloudPosseOfficeHoursEmbed/index.tsx

Summary by CodeRabbit

  • New Features

    • Added theme-aware embed components for Office Hours and Slack that automatically adapt to light and dark mode settings.
  • Documentation

    • Updated Office Hours and Slack documentation pages to use the new custom embed components with improved styling and functionality.

✏️ Tip: You can customize this high-level summary in your review settings.

@osterman osterman requested a review from a team as a code owner November 18, 2025 16:43
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 18, 2025

📝 Walkthrough

Walkthrough

Replaces hard-coded embed iframes in documentation pages with reusable React components. Two new components (CloudPosseOfficeHoursEmbed and CloudPosseSlackEmbed) encapsulate iframe rendering, theme detection via MutationObserver, and UTM parameter injection.

Changes

Cohort / File(s) Summary
Documentation Page Updates
website/docs/community/office-hours.mdx, website/docs/community/slack.mdx
Replaced embedded forms/iframes with new React component imports and renders. Added hide_title: true to office-hours frontmatter.
New Embed Components
website/src/components/CloudPosseOfficeHoursEmbed/index.tsx, website/src/components/CloudPosseSlackEmbed/index.tsx
New React components that manage theme state (light/dark) via MutationObserver, detect document data-theme changes on mount, construct iframe src with theme and UTM parameters, and render styled iframes with sandbox attributes.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested labels

minor

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately captures the main changes: adding two new theme-aware embed components for Slack and Office Hours with UTM tracking support.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch osterman/update-slack-embed

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@github-actions github-actions bot added the size/s Small size PR label Nov 18, 2025
@github-actions
Copy link

github-actions bot commented Nov 18, 2025

Dependency Review

✅ No vulnerabilities or license issues found.

Scanned Files

None

@codecov
Copy link

codecov bot commented Nov 18, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.57%. Comparing base (35b37e7) to head (e02eb42).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1802      +/-   ##
==========================================
- Coverage   73.58%   73.57%   -0.02%     
==========================================
  Files         634      634              
  Lines       59027    59027              
==========================================
- Hits        43434    43427       -7     
- Misses      12602    12612      +10     
+ Partials     2991     2988       -3     
Flag Coverage Δ
unittests 73.57% <ø> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

osterman and others added 2 commits December 26, 2025 08:02
Upgraded to the new Cloud Posse Slack embed URL with better responsive design, larger dimensions (700px height, full width with 3xl max constraint), and added security sandbox attributes.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
- Replace HubspotForm with iframe embed for Office Hours
- Update Slack embed with optimized height (380px) and left-justified layout
- Add allow-popups to sandbox attributes for proper link functionality
- Standardize iframe styling across both embeds using inline styles

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
The iframe embed already contains "Join Our Weekly Office Hours" heading,
so we hide the Docusaurus auto-rendered title to avoid duplication.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
- Add utm_source=atmos-docs to identify traffic source
- Add utm_medium=embed to identify the mechanism
- Add utm_campaign specific to each embed (office-hours, slack-community)
- Add utm_content=community-page to identify page location

This enables tracking of conversion rates and traffic analytics for both embeds.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
- Create CloudPosseSlackEmbed component with dynamic theme detection
- Create CloudPosseOfficeHoursEmbed component with dynamic theme detection
- Both components watch for Docusaurus theme changes via MutationObserver
- Automatically switch between light/dark theme when user toggles
- Update slack.mdx and office-hours.mdx to use new components

The embeds now respect the user's Docusaurus theme preference and
update dynamically when the theme is changed.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
@github-actions github-actions bot added size/m Medium size PR and removed size/s Small size PR labels Dec 27, 2025
@osterman osterman changed the title Update Slack embed with improved sizing and security Add theme-aware CloudPosse embeds for Slack and Office Hours with UTM tracking Dec 27, 2025
@osterman osterman added the no-release Do not create a new release (wait for additional code changes) label Dec 27, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (5)
website/src/components/CloudPosseSlackEmbed/index.tsx (2)

4-4: Consider reading initial theme on server-side or during SSR.

Hardcoding the initial state to 'dark' may cause a brief flash when the actual theme is light. The useEffect runs after render, so users might see the iframe load with the wrong theme momentarily.

If Docusaurus supports reading theme during SSR or you can use useState with a lazy initializer that reads from document, you'd eliminate the flash:

-  const [theme, setTheme] = useState<'light' | 'dark'>('dark');
+  const [theme, setTheme] = useState<'light' | 'dark'>(() => {
+    if (typeof window !== 'undefined') {
+      const currentTheme = document.documentElement.getAttribute('data-theme');
+      return currentTheme === 'dark' ? 'dark' : 'light';
+    }
+    return 'dark';
+  });

27-38: Consider adding lazy loading for performance.

Adding loading="lazy" would defer loading the iframe until it's near the viewport, improving initial page load performance.

Optional enhancement
     <iframe
       src={src}
+      loading="lazy"
       style={{
website/src/components/CloudPosseOfficeHoursEmbed/index.tsx (3)

3-40: Functionality looks good, but consider extracting shared logic.

This component is nearly identical to CloudPosseSlackEmbed (only the URL, campaign param, and title differ). Extracting the shared logic would reduce duplication and make future updates easier.

Recommended refactor: shared embed component

You could create a base component that accepts props:

// BaseCloudPosseEmbed.tsx
interface CloudPosseEmbedProps {
  embedType: 'slack' | 'office-hours';
  title: string;
  utmCampaign: string;
}

export default function BaseCloudPosseEmbed({ embedType, title, utmCampaign }: CloudPosseEmbedProps): JSX.Element {
  const [theme, setTheme] = useState<'light' | 'dark'>('dark');

  useEffect(() => {
    // ... same observer logic
  }, []);

  const src = `https://cloudposse.com/embed/${embedType}?theme=${theme}&bg=transparent&utm_source=atmos-docs&utm_medium=embed&utm_campaign=${utmCampaign}&utm_content=community-page`;

  return <iframe src={src} title={title} /* ... same styling */ />;
}

Then each specific component becomes a thin wrapper:

export default function CloudPosseOfficeHoursEmbed() {
  return <BaseCloudPosseEmbed embedType="office-hours" title="Office Hours Registration" utmCampaign="office-hours" />;
}

4-4: Same theme initialization concern as SlackEmbed.

The initial 'dark' state may cause a flash on light theme. See the suggestion in CloudPosseSlackEmbed/index.tsx for a lazy initializer approach.


27-38: Consider lazy loading here too.

Same as the Slack embed—loading="lazy" would improve initial page load performance.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 35b37e7 and e02eb42.

📒 Files selected for processing (4)
  • website/docs/community/office-hours.mdx
  • website/docs/community/slack.mdx
  • website/src/components/CloudPosseOfficeHoursEmbed/index.tsx
  • website/src/components/CloudPosseSlackEmbed/index.tsx
🧰 Additional context used
📓 Path-based instructions (1)
website/**

📄 CodeRabbit inference engine (.cursor/rules/atmos-rules.mdc)

website/**: Update website documentation in the website/ directory when adding new features, ensure consistency between CLI help text and website documentation, and follow the website's documentation structure and style
Keep website code in the website/ directory, follow the existing website architecture and style, and test website changes locally before committing
Keep CLI documentation and website documentation in sync and document new features on the website with examples and use cases

Files:

  • website/src/components/CloudPosseOfficeHoursEmbed/index.tsx
  • website/docs/community/slack.mdx
  • website/docs/community/office-hours.mdx
  • website/src/components/CloudPosseSlackEmbed/index.tsx
🧠 Learnings (1)
📓 Common learnings
Learnt from: Listener430
Repo: cloudposse/atmos PR: 934
File: tests/fixtures/scenarios/docs-generate/README.md.gotmpl:99-118
Timestamp: 2025-01-25T03:51:57.689Z
Learning: For the cloudposse/atmos repository, changes to template contents should be handled in dedicated PRs and are typically considered out of scope for PRs focused on other objectives.
⏰ Context from checks skipped due to timeout of 900000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Acceptance Tests (windows)
  • GitHub Check: Acceptance Tests (linux)
  • GitHub Check: Summary
🔇 Additional comments (3)
website/src/components/CloudPosseSlackEmbed/index.tsx (1)

3-22: Nice implementation of theme-aware embed.

The MutationObserver pattern correctly tracks Docusaurus theme changes, and the cleanup on unmount prevents memory leaks. The logic is solid.

website/docs/community/slack.mdx (1)

8-14: Clean integration of the embed component.

The import and usage are correct. Replacing the hard-coded iframe with a reusable component improves maintainability.

website/docs/community/office-hours.mdx (1)

3-11: Good call on hide_title: true.

Preventing duplicate page headings improves the UX. The component integration is clean and correct.

@aknysh aknysh merged commit 705f536 into main Dec 27, 2025
57 checks passed
@aknysh aknysh deleted the osterman/update-slack-embed branch December 27, 2025 06:05
@github-actions
Copy link

These changes were released in v1.203.0-rc.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-release Do not create a new release (wait for additional code changes) size/m Medium size PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants