Skip to content

v0.6.46: mothership queueing, web vitals#4194

Merged
waleedlatif1 merged 3 commits intomainfrom
staging
Apr 16, 2026
Merged

v0.6.46: mothership queueing, web vitals#4194
waleedlatif1 merged 3 commits intomainfrom
staging

Conversation

@waleedlatif1
Copy link
Copy Markdown
Collaborator

@waleedlatif1 waleedlatif1 commented Apr 16, 2026

TheodoreSpeaks and others added 2 commits April 15, 2026 21:42
* fix(ui): fix attachment logic on queued mothership messages

* Add focus after hitting pencil button for queued message

* fix copilot layout
* improvement(landing): optimize core web vitals and accessibility

Code-split AuthModal and DemoRequestModal via next/dynamic across 7 landing
components to move auth-client bundle (~150-250KB) out of the initial JS payload.
Replace useSession import in navbar with direct SessionContext read to avoid
pulling the entire better-auth client into the landing page bundle. Add immutable
cache header for content-hashed _next/static assets. Defer PostHog session
recording until user identification to avoid loading the recorder (~80KB) on
anonymous visits. Fix accessibility issues flagged by Lighthouse: add missing
aria-label on preview submit button, add inert to aria-hidden ReactFlow wrapper,
set decorative alt on logos inside labeled links, disambiguate duplicate footer
API links.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(posthog): guard startSessionRecording against repeated calls on refetch

The effect fires on every session reload (e.g., subscription upgrade).
Calling startSessionRecording() while already recording fragments the
session in the analytics dashboard. Add sessionRecordingStarted() guard
so recording only starts once per page lifecycle.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(config): remove redundant _next/static cache header

Next.js already sets Cache-Control: public, max-age=31536000, immutable
on _next/static assets natively and this cannot be overridden. The custom
rule was redundant on Vercel and conflicted with the extension-based rule
on self-hosted deployments due to last-match-wins ordering.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 16, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Apr 16, 2026 6:53am

Request Review

@cursor
Copy link
Copy Markdown

cursor bot commented Apr 16, 2026

PR Summary

Medium Risk
Moderate risk due to changes in core chat input/queue editing flow (including file/context restoration) and altered PostHog session recording behavior, which could impact UX or privacy expectations if misconfigured.

Overview
Improves queued-message editing in the workspace chat by letting UserInput load a queued message (text, contexts, and file attachments) via an imperative handle, adding an ArrowUp shortcut to edit the most recent queued item, and enhancing the queued list to render mentions/truncation correctly and show attachment indicators.

Optimizes the landing experience for Core Web Vitals/accessibility by converting AuthModal/DemoRequestModal to dynamic imports across landing sections, tightening navbar session reads to use SessionContext, adding missing ARIA labels and inert usage, and updating a few footer/link alt/labels.

Updates analytics config to disable PostHog session recording by default and only start recording after a user session is identified.

Reviewed by Cursor Bugbot for commit 23ccd4a. Configure here.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Apr 16, 2026

Greptile Summary

This PR bundles two improvements: (1) a fix for the Mothership queued-message edit flow so that file attachments and context mentions are properly restored when a queued message is pulled back into the input, and (2) a set of landing-page Core Web Vitals / accessibility improvements (lazy-loading modals with next/dynamic, switching Navbar to consume SessionContext instead of calling useSession, disabling PostHog session recording by default with opt-in for authenticated users, and several a11y fixes).

The queued-message fix uses forwardRef + useImperativeHandle to expose a loadQueuedMessage imperative handle on UserInput, cleanly replacing the previous string-based editValue prop that discarded attachments and context.

Confidence Score: 5/5

Safe to merge — the queued-message attachment fix is well-architected and the landing optimisations are straightforward.

All findings are P2 (one missing typeof guard that is already inside a try/catch). No data loss, no broken paths, no security issues.

apps/sim/app/_shell/providers/session-provider.tsx — minor defensive guard missing around sessionRecordingStarted().

Important Files Changed

Filename Overview
apps/sim/app/workspace/[workspaceId]/home/components/user-input/user-input.tsx Refactored to forwardRef + useImperativeHandle; exposes loadQueuedMessage that restores text, file attachments, and contexts. Removes old string-prop editValue approach.
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/copilot/components/user-input/hooks/use-file-attachments.ts Adds restoreAttachedFiles callback that revokes previous preview URLs before replacing the file list — correct cleanup behaviour.
apps/sim/app/workspace/[workspaceId]/home/components/mothership-chat/mothership-chat.tsx Holds a ref to UserInput and uses the new loadQueuedMessage imperative handle; removes editValue/onEditValueConsumed props.
apps/sim/app/workspace/[workspaceId]/home/components/queued-messages/queued-messages.tsx Adds ResizeObserver for narrow-mode attachment display and renders file attachment badge (filename + overflow count) in each queued message row.
apps/sim/app/_shell/providers/session-provider.tsx Adds conditional startSessionRecording for authenticated users; sessionRecordingStarted() is called without a typeof guard (unlike startSessionRecording), but the entire block is in try/catch so it fails silently.
apps/sim/app/_shell/providers/posthog-provider.tsx Adds disable_session_recording: true to PostHog init config so recording is off by default and only starts for authenticated users.
apps/sim/app/workspace/[workspaceId]/home/home.tsx Removes editingInputValue state and wrapper handler; now passes editQueuedMessage directly to MothershipChat.
apps/sim/app/(landing)/components/navbar/navbar.tsx Switches from useSession() to SessionContext consumption to avoid an extra auth fetch; AuthModal lazy-loaded; logo alt set to empty (correct for decorative image in labelled link).

Sequence Diagram

sequenceDiagram
    participant User
    participant QueuedMessages
    participant MothershipChat
    participant Store as home.tsx / panel.tsx store
    participant UserInput

    User->>QueuedMessages: click ✏️ edit
    QueuedMessages->>MothershipChat: onEdit(id)
    MothershipChat->>Store: onEditQueuedMessage(id)
    Note over Store: removes message from queue,<br/>returns QueuedMessage
    Store-->>MothershipChat: QueuedMessage { content, fileAttachments, contexts }
    MothershipChat->>UserInput: userInputRef.loadQueuedMessage(msg)
    UserInput->>UserInput: setValue(msg.content)
    UserInput->>useFileAttachments: restoreAttachedFiles(msg.fileAttachments)
    UserInput->>useContextManagement: setSelectedContexts(msg.contexts)
    UserInput->>textarea: focus() + setSelectionRange(end, end)

    Note over UserInput: ArrowUp (empty input) also<br/>triggers edit of tail message
Loading

Reviews (1): Last reviewed commit: "improvement(landing): optimize core web ..." | Re-trigger Greptile

Comment thread apps/sim/app/_shell/providers/session-provider.tsx
…se cleanup (#4196)

* v0.6.29: login improvements, posthog telemetry (#4026)

* feat(posthog): Add tracking on mothership abort (#4023)

Co-authored-by: Theodore Li <theo@sim.ai>

* 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

* fix(ui): posthog guard, dynamic import loading, compact variant, rebase cleanup

---------

Co-authored-by: Theodore Li <theodoreqili@gmail.com>
@waleedlatif1 waleedlatif1 merged commit 387cc97 into main Apr 16, 2026
30 checks passed
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.

3 participants