GeezerVison is showing github.com — fix(ui): posthog guard, dynamic import loading, compact variant, rebase cleanup by waleedlatif1 · Pull Request #4196 · simstudioai/sim
Conversation
Summary
- Add missing
typeof guard on posthog.sessionRecordingStarted to match startSessionRecording guard
- Add
loading: () => null to all dynamically imported modals (AuthModal, DemoRequestModal)
- Replace
!important CSS overrides on UserMessageContent with proper compact prop
- Replace
useEffect ResizeObserver with callback ref pattern in QueuedMessages
- Memoize
computeMentionRanges in UserMessageContent
- Remove duplicate
handleStopGeneration / handleCopilotStopGeneration rebase artifacts
Type of Change
- Bug fix
- Code quality improvement
Testing
Tested manually
Checklist
- Code follows project style guidelines
- Self-reviewed my changes
- Tests added/updated and passing
- No new warnings introduced
- I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
greptile-apps[bot] reacted with thumbs up emoji
* feat(posthog): Add tracking on mothership abort (#4023)
Co-authored-by: Theodore Li <[email protected]>
* fix(login): fix captcha headers for manual login (#4025)
* fix(signup): fix turnstile key loading
* fix(login): fix captcha header passing
* Catch user already exists, remove login form captcha
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
| Project |
Deployment |
Actions |
Updated (UTC) |
| docs |
Skipped |
|
Apr 16, 2026 6:30am |

|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
cursor
Bot
commented
Apr 16, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
PR Summary
Low Risk
Changes are confined to UI rendering and analytics guards; main risk is minor behavior differences in modal loading and queued message layout/resize handling.
Overview
Improves landing-page modal loading by adding explicit loading: () => null fallbacks to dynamically imported AuthModal/DemoRequestModal components, reducing transient loading UI.
Hardens analytics initialization by guarding posthog.sessionRecordingStarted before calling it, preventing runtime errors in environments where the API is missing.
Refines workspace message UI: QueuedMessages now uses a callback-ref ResizeObserver pattern, and UserMessageContent adds a compact variant (used by queued messages) while memoizing mention-range computation to avoid repeated parsing during renders.
Reviewed by Cursor Bugbot for commit 904ab7d. Configure here.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Greptile Summary
This PR bundles five focused fixes: a missing typeof guard on posthog.sessionRecordingStarted, loading: () => null added to all unguarded dynamic modal imports on landing pages, a callback-ref replacement for the useEffect-based ResizeObserver in QueuedMessages, a compact prop that replaces !important overrides in UserMessageContent (with computeMentionRanges memoised), and removal of duplicate stop-generation handlers left over from a rebase.
Confidence Score: 5/5
Safe to merge — all changes are targeted bug fixes and code quality improvements with no new regressions introduced.
All five fix areas are well-scoped: the PostHog typeof guard is correct, loading: () => null follows the established pattern, the callback-ref ResizeObserver pattern is a valid improvement with proper cleanup, the compact prop correctly replaces !important overrides, and the duplicate handler removal is a clean rebase fix. No P0/P1 issues found.
No files require special attention.
Important Files Changed
| Filename |
Overview |
| apps/sim/app/_shell/providers/session-provider.tsx |
Adds the missing typeof posthog.sessionRecordingStarted === 'function' guard before calling sessionRecordingStarted(), matching the existing guard on startSessionRecording. Correct fix. |
| apps/sim/app/workspace/[workspaceId]/home/components/queued-messages/queued-messages.tsx |
Replaces useEffect + ResizeObserver with a callback-ref pattern; correctly disconnects the observer on element removal/unmount by checking roRef.current, and creates a new observer on element mount. |
| apps/sim/app/workspace/[workspaceId]/home/components/user-message-content/user-message-content.tsx |
Adds a compact prop with COMPACT_CLASSES (truncate-based single-line layout) replacing prior !important CSS overrides, and wraps computeMentionRanges in useMemo. Both changes are correct; plainMentions and compact are used together at the call site. |
| apps/sim/app/(landing)/components/navbar/navbar.tsx |
Adds loading: () => null to the AuthModal dynamic import, consistent with hero.tsx and other landing pages. |
| apps/sim/app/workspace/[workspaceId]/home/home.tsx |
Removes duplicate handleStopGeneration rebase artifact; single clean definition remains at line 204. |
| apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/panel.tsx |
Removes duplicate handleCopilotStopGeneration rebase artifact; single clean definition remains at line 395. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[SessionProvider mounts] --> B[loadSession]
B --> C{isPending false?}
C --> D[import posthog-js]
D --> E{posthog.identify is function?}
E -- no --> Z[return early]
E -- yes --> F{data.user exists?}
F -- no --> G[posthog.reset]
F -- yes --> H[posthog.identify]
H --> I{startSessionRecording AND sessionRecordingStarted are functions?}
I -- no --> Z
I -- yes --> J{sessionRecordingStarted returns false?}
J -- already started --> Z
J -- not started --> K[startSessionRecording]
Loading
Reviews (1): Last reviewed commit: "fix(ui): posthog guard, dynamic import l..." | Re-trigger Greptile
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This branch was previously deployed
1 inactive
deployment
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|