Files
PaperClipAI/docs/pr-screenshots
de042e79ef fix(ui): keep code-block pastes in the nested editor (#15773)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work
> - People write a routine description in a rich markdown editor
> - That editor contains a nested code block for literal text
> - A paste that starts with a markdown mark, such as a dash, goes to
the outer editor
> - The text does not appear in the code block
> - This pull request sends that paste to the nested editor as literal
text
> - This pull request also adds a copy control next to the Overview
heading
> - The benefit is that a person can keep a routine description in a
code block and copy it to another Paperclip instance

## Linked Issues or Issue Description

**What happened?**

A paste into a code block in a routine description does not appear when
the pasted text starts with a markdown mark, such as a dash. A plain
single line still appears.

**Expected behavior**

The nested code editor receives the paste as literal text. The text
stays in the code block.

**Steps to reproduce**

1. Open a routine and edit the description.
2. Add a text code block.
3. Click inside that code block.
4. Paste a line that starts with a dash.
5. The line does not appear in the code block.

**Paperclip version or commit**

`master` at `3389bea`.

**Deployment mode**

Local dev (pnpm dev)

## What Changed

- The markdown editor does not take a paste that starts inside a nested
code block.
- The same editor is used for descriptions in the routine page and in
the rest of the app.
- The Overview heading has a copy button.
- The button copies the draft description while you edit.
- The button copies the saved description when you do not edit.
- Unit tests cover the paste path and the copy button.
- Screenshots show the heading while you view a description and while
you edit it.

## Screenshots

The copy icon sits next to the Overview title. The heading component is
the production component. The page frame around it is a preview.

![Overview heading while you view a description, light
theme](https://raw.githubusercontent.com/paperclipai/paperclip/PAP-103-pasting-into-text-area/docs/pr-screenshots/pr-15773/overview-view-light.png)

![Overview heading while you edit a description, light
theme](https://raw.githubusercontent.com/paperclipai/paperclip/PAP-103-pasting-into-text-area/docs/pr-screenshots/pr-15773/overview-edit-light.png)

![Overview heading while you view a description, dark
theme](https://raw.githubusercontent.com/paperclipai/paperclip/PAP-103-pasting-into-text-area/docs/pr-screenshots/pr-15773/overview-view-dark.png)

![Overview heading while you edit a description, dark
theme](https://raw.githubusercontent.com/paperclipai/paperclip/PAP-103-pasting-into-text-area/docs/pr-screenshots/pr-15773/overview-edit-dark.png)

## Verification

- Run `corepack pnpm exec vitest run --config ui/vitest.config.ts
ui/src/components/MarkdownEditor.test.tsx
ui/src/components/RoutineSectionHeading.test.tsx
ui/src/lib/routine-description-copy.test.ts` from the repository root.
57 tests passed on the code commit.
- Open a routine description. Paste a line that starts with a dash into
a text code block. Confirm that the line stays in the code block.
- Click the copy button next to Overview. Paste the result into a new
routine. Confirm that the description matches the draft while you edit,
and the saved description when you do not edit.
- Open the screenshots above. Confirm the copy icon is next to Overview
in the view state and in the edit state, in light theme and in dark
theme.
- This workspace did not open a signed-in routine page. The screenshots
render the production heading with the app color tokens.

## Risks

Low risk. A paste inside a code block now stays in that block. A paste
in the rest of the editor still follows the previous markdown path. The
copy button only reads the description text.

## Model Used

xAI Grok 4.7 with tool use. The model wrote this change in a Paperclip
agent run. Context window is large. The model used tools to edit code,
run tests, and capture screenshots.

## Checklist

- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [x] I have searched GitHub for duplicate or related PRs and linked
them above
- [x] I have either (a) linked existing issues with `Fixes: #` / `Closes
#` / `Refs #` OR (b) described the issue in-PR following the relevant
issue template
- [x] I have not referenced internal/instance-local Paperclip issues or
links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip`
URLs)
- [ ] My branch name describes the change (e.g. `docs/...`, `fix/...`)
and contains no internal Paperclip ticket id or instance-derived details
- [x] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [x] I have updated relevant documentation to reflect my changes (no
user docs describe this paste path)
- [x] I have considered and documented any risks above
- [x] All Paperclip CI gates are green
- [x] Greptile is 5/5 with no open P2s, recommendations, or follow-ups
- [x] I will address all Greptile and reviewer comments before
requesting merge

---------

Co-authored-by: devinfoley <139239+devinfoley@users.noreply.github.com>
Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-10-10 00:42:10 -07:00
..