Skip to content

v3.21.5 — UI: inline short pastes (≥5 line threshold)

Latest

Choose a tag to compare

@1bcMax 1bcMax released this 19 May 05:35

External contributor @KillerQueen-Z shipped PR #60 fixing a real bracketed-paste UX bug.

The bug

Every paste — even a single-sentence prompt — was being replaced in the input box with a `[Pasted ~N lines]` placeholder, so the user couldn't see what they pasted. Root cause: `findPasteBlocks(...) > 0` triggered the collapse unconditionally with no line-count threshold.

The fix

New `PASTE_COLLAPSE_LINE_THRESHOLD = 5` constant. Pastes shorter than 5 lines render inline as plain text; longer pastes still collapse to a placeholder. Decode at submit time is unchanged — both branches expand any preserved placeholder back to the original content before the model sees it.

Paste Before After
1-line, 230-char prompt `[Pasted ~1 line]` inline
4-line stack trace `[Pasted ~4 lines]` inline
5-line code block `[Pasted ~5 lines]` `[Pasted ~5 lines]`
50-line log dump `[Pasted ~50 lines]` `[Pasted ~50 lines]`

Single-file change to `src/ui/app.tsx`. 405/405 tests pass.

```
npm i -g @blockrun/franklin@3.21.5
```