Skip to content

feat(app): collapse large pasted input blocks#15411

Open
chindris-mihai-alexandru wants to merge 9 commits intoanomalyco:devfrom
chindris-mihai-alexandru:feat/desktop-paste-summary
Open

feat(app): collapse large pasted input blocks#15411
chindris-mihai-alexandru wants to merge 9 commits intoanomalyco:devfrom
chindris-mihai-alexandru:feat/desktop-paste-summary

Conversation

@chindris-mihai-alexandru
Copy link

@chindris-mihai-alexandru chindris-mihai-alexandru commented Feb 27, 2026

Issue for this PR

Closes #15405

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

This adds support for collapsed large paste blocks in the prompt input so users can keep the composer readable when pasting large chunks.

Implementation details:

  • adds a paste prompt part that keeps full pasted content plus a display summary (for example [Pasted ~N lines])
  • updates paste handling to insert a paste part for large pastes (same large-paste threshold logic already used in prompt attachments)
  • renders paste parts as non-editable inline pills in the input while preserving the full underlying content for submission
  • updates prompt parsing/history equality so pasted summary blocks round-trip correctly in editor state and history
  • hardens e2e seed helpers for slower CI workers by increasing seed timeout and retries (packages/app/e2e/actions.ts), addressing the observed Timed out seeding question request failures

Why this works:

  • submission still uses part content, so the model receives full pasted text
  • visual rendering uses summary, so users can avoid large in-editor text noise
  • serialization/deserialization stores both values on DOM nodes (data-content and data-summary) so cursor behavior and state sync remain stable
  • e2e seed polling now has more headroom on Windows CI where backend/tool-call setup can be slower

Related context:

How did you verify your code works?

I validated logic changes locally by inspecting prompt state flow and parse/render behavior across the updated prompt input pipeline:

  • packages/app/src/components/prompt-input/attachments.ts
  • packages/app/src/components/prompt-input.tsx
  • packages/app/src/context/prompt.tsx
  • packages/app/src/components/prompt-input/history.ts
  • packages/app/e2e/actions.ts

I also attempted local commands in this fork:

  • npm run -w @opencode-ai/app typecheck

That command currently fails in this environment due pre-existing workspace/module-resolution issues unrelated to this PR (missing modules and existing repo-wide TS issues), so I could not get a clean full typecheck signal here.

Manual QA checklist used for behavior validation:

  • short paste remains inline as normal text
  • large paste renders as [Pasted ~N lines]
  • submit still sends full pasted content
  • input editing/cursor movement remains functional with paste pills present

Screenshots / recordings

UI recording can be added after maintainers confirm preferred UX direction (collapsed default vs expanded default).

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions github-actions bot added the needs:compliance This means the issue will auto-close after 2 hours. label Feb 27, 2026
@chindris-mihai-alexandru chindris-mihai-alexandru changed the title feat(desktop): collapse large pasted input blocks feat(app): collapse large pasted input blocks Feb 27, 2026
@github-actions github-actions bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Feb 27, 2026
@github-actions
Copy link
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

@chindris-mihai-alexandru
Copy link
Author

Follow-up update pushed in this PR: paste-summary trigger threshold is now tuned for normal desktop workflows (>=5 lines or >=200 chars), so users don’t need extremely large pastes to get collapsed [Pasted ~N lines] blocks.

@chindris-mihai-alexandru
Copy link
Author

Update: threshold tuning was reverted to upstream defaults to keep behavior aligned with existing OpenCode thresholds (>=120 lines or >=8000 chars). The collapsed-paste implementation remains intact.

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.

[FEATURE]: Desktop prompt option to collapse/obfuscate large pasted text as [Pasted ~N lines]

1 participant