Skip to content

fix(ui): close paste admission edge cases - #7156

Merged
waleedlatif1 merged 5 commits into
stagingfrom
codex/paste-release-review-fixes
Aug 27, 2026
Merged

fix(ui): close paste admission edge cases#7156
waleedlatif1 merged 5 commits into
stagingfrom
codex/paste-release-review-fixes

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • enforce exact projected-result limits for text files and rich Markdown pastes
  • scope structured clipboard exemptions to compatible inputs and preserve long prompt references
  • align text-file paste admission with the existing 50 MiB save boundary

Type of Change

  • Bug fix

Testing

  • 35 focused paste tests
  • full monorepo type-check, lint, registry validation, and audit suite

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)

@vercel

vercel Bot commented Aug 27, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Aug 27, 2026 5:15am

Request Review

@greptile-apps

greptile-apps Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR closes paste-admission edge cases by projecting exact text-editor and rich-Markdown results while preserving structured clipboard references.

  • Accounts for Monaco multi-cursor full and spread paste behavior at the 50 MiB file boundary.
  • Validates raw, rich HTML, and canonical Markdown results before accepting pastes.
  • Scopes selection-context and image exemptions to compatible editors.
  • Preserves prompt chip rendering for long prompts containing skill references.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
apps/sim/app/workspace/[workspaceId]/files/components/file-viewer/text-editor-paste.ts Projects retained and inserted UTF-8 bytes across Monaco selections, including full and distributed multi-cursor modes.
apps/sim/app/workspace/[workspaceId]/files/components/file-viewer/text-editor.tsx Integrates exact projected-result admission with Monaco’s current model selections and paste mode.
apps/sim/app/workspace/[workspaceId]/files/components/file-viewer/rich-markdown-editor/paste-admission.ts Adds early clipboard bounds and canonical Markdown transaction validation.
apps/sim/app/_shell/paste-admission-guard.tsx Scopes structured-reference and image exemptions while delegating exact text-result checks to specialized editors.
apps/sim/app/workspace/[workspaceId]/home/components/user-input/components/prompt-editor/prompt-editor.tsx Retains enhanced rendering for long prompts containing skill-chip triggers and opts into structured clipboard references.
packages/utils/src/paste.ts Aligns the text-editor paste ceiling with the existing 50 MiB workspace-file content boundary.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  P[Clipboard paste] --> G[Shell admission guard]
  G -->|Structured prompt reference| R[Prompt reference handler]
  G -->|Image file for opted-in editor| I[Image handler]
  G -->|Monaco text| M[Project multi-cursor result]
  G -->|Rich Markdown| H[Check text and HTML payloads]
  M --> B{Within 50 MiB result boundary?}
  H --> C[Canonical Markdown transaction]
  C --> D{Within rich-document boundary?}
  B -->|Yes| A[Accept paste]
  B -->|No| X[Reject and warn]
  D -->|Yes| A
  D -->|No| X
Loading

Reviews (5): Last reviewed commit: "fix(ui): defer exact Monaco paste admiss..." | Re-trigger Greptile

Comment thread apps/sim/app/workspace/[workspaceId]/files/components/file-viewer/text-editor.tsx Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

All reported issues were addressed across 13 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1
waleedlatif1 merged commit 286b30e into staging Aug 27, 2026
29 checks passed
@waleedlatif1
waleedlatif1 deleted the codex/paste-release-review-fixes branch August 27, 2026 05:23
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