Skip to content

fix: dark mode components + PostHog tracking#133

Merged
rogeriochaves merged 14 commits intomainfrom
feat/dark-mode-posthog-fixes
Mar 20, 2026
Merged

fix: dark mode components + PostHog tracking#133
rogeriochaves merged 14 commits intomainfrom
feat/dark-mode-posthog-fixes

Conversation

@rogeriochaves
Copy link
Contributor

Summary

  • Dark mode fix: Components no longer flash white on hover. Only borders and text lighten — background stays dark.
  • "Copy Full Prompt": Changed button text from "Copy Prompt" to "Copy Full Prompt" so users understand they're copying the entire prompt, not just the visible title.
  • PostHog tracking: All copy actions now fire PostHog events (docs_copy_prompt, docs_copy_line, docs_copy_skill_install) via window.posthog.capture(). Uses same PostHog project as app.langwatch.ai for full user journey tracking.
  • PostHog integration: Added analytics.posthog to docs.json with production key.
  • Scenario config fix: Updated prompts-data.jsx with correct @langwatch/scenario/integrations/vitest/config import path.

Test plan

  • Verify dark mode: borders should be subtle gray, hover lightens borders + text only
  • Verify "Copy Full Prompt" button text
  • Verify PostHog events fire in browser devtools (Network tab → posthog requests)

- Remove white background hover — only borders and text lighten on hover
- Use Mintlify theme vars (--tw-prose-hr, --tw-prose-td-borders, --tw-prose-headings)
- Change "Copy Prompt" → "Copy Full Prompt" to clarify it copies the full prompt
- Add posthog.capture() tracking for copy events (docs_copy_prompt, docs_copy_line, docs_copy_skill_install)
Same project key as app.langwatch.ai for full user journey tracking.
@langwatch/scenario/config → @langwatch/scenario/integrations/vitest/config
@rogeriochaves rogeriochaves force-pushed the feat/dark-mode-posthog-fixes branch from e038013 to a554ecb Compare March 20, 2026 08:41
CSS vars like --tw-prose-hr resolve to light-mode values in dark context.
Switch to hardcoded Tailwind gray scale:
- Default border: #374151 (gray-700) — subtle in dark mode
- Hover border: #6b7280 (gray-500) — visible but not white
- Hover text: #f9fafb (gray-50) — bright without being harsh
- No background change on hover
….txt

docs.json still referenced features/triggers and api-reference/triggers
even though files were renamed to automations. Fixes nav and llms.txt.
Use MutationObserver on document.documentElement to detect Mintlify's
dark class. Light mode keeps original styling (#e5e7eb borders, #f9fafb
hover bg). Dark mode uses #374151 borders, #6b7280 hover, no bg change.
Mintlify's JSX runtime doesn't support useEffect. Use a plain function
that reads document.documentElement.classList at render time instead.
Also fix stale api-reference/traces nav entries in docs.json.
Mintlify uses RSC so useEffect/document access is unavailable.
Move all theme-aware styling to style.css using .dark class selector.
Components use className refs, CSS handles light/dark via .dark parent.

Light mode: #e5e7eb borders, #f9fafb hover bg (same as original)
Dark mode: #374151 borders, #6b7280 hover, no bg change, #f9fafb text
- Move copy button inline next to `npx skills add` command
- Remove background box from "Then use /command" line
- Add second copy button next to the slash command
- Fix all slash commands: /langwatch-tracing → /tracing (no prefix)
@rogeriochaves rogeriochaves merged commit 17124cb into main Mar 20, 2026
2 checks passed
@rogeriochaves rogeriochaves deleted the feat/dark-mode-posthog-fixes branch March 20, 2026 10:17
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