mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-11-08 01:57:31 +01:00
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work. > - People edit task documents and comments in the Markdown editor. > - Its link validator accepts safe text that is not a URL. > - Lexical uses that validator to turn pasted text into a link around the selection. > - Pasting JSON or prose can keep the old text and put the new text in its link destination. > - This pull request handles plain selected-text replacement in the existing paste plugin. > - The benefit is standard text replacement with existing manual link controls intact. ## Linked Issues or Issue Description Fixes #2930. Related: #8506 by `joegalbert-ai` identifies the same validator cause. Thanks for that analysis. This change adds current Lexical command coverage and preserves the separate manual and decorator link paths. The contributor PR remains unchanged. Reproduce by selecting an existing paragraph and pasting `{"status":"ready"}`. The old code keeps the previous paragraph as a link label and uses the JSON as its destination. The expected result is the pasted JSON as text. ## What Changed - Replace a selected text range, including soft line breaks, when the clipboard text is not an unambiguous link target. - Keep selected-label link wrapping for valid scheme, network, web and email targets, including international addresses. Treat ambiguous relative paths and fragments as ordinary pasted text. - Leave the manual link validator unchanged. Keep manual relative, internal, fragment, email and decorator links, with existing executable-scheme guards. - Use the same native Lexical rich-paste insertion API for selected HTML payloads. Preserve HTML formatting and the paste undo boundary. Keep files, Markdown, code and other selection types with their existing handlers. - Declare the clipboard API and test rich-text API at the existing Lexical 0.48.0 version. The scheduled repository bot owns the lockfile refresh; this PR has no lockfile delta. - Add real Lexical paste and link-command regressions through the production editor policy and paste plugin. This restores expected editing behavior; it adds no setting, endpoint or new feature-map entry. ## Verification - Before the fix, real selected-text paste tests fail for JSON, prose and multiline text. They retain the old label and create a link with the replacement as its URL. The valid-URL control passes. - A test-only experiment with the exact recognition predicate from #8506 fails four current decorator relative/fragment cases. The chosen paste-handler fix keeps the manual validator intact. The experiment was removed after preserving its result. - `pnpm --filter @paperclipai/ui exec vitest run src/components/MarkdownEditor.test.tsx src/lib/markdownPaste.test.ts src/lib/normalize-markdown.test.ts src/lib/mention-aware-link-node.test.ts src/lib/mention-deletion.test.ts`: 119 editor-focused tests passed. After the baseline update, the same editor suites plus App and ShellConfigurationGate passed 146 tests. - The React MDXEditor shell is mocked. The configured production predicate, actual paste-normalization plugin, native rich-text paste handler and real Lexical paste/link commands are not mocked. Tests cover URL wrapping, plain replacement, manual/decorator links, executable-scheme handling and paste-owner handoff. - UI typecheck and production build pass. UI token gates, module boundaries and diff checks pass. Initial test event-type errors were fixed. Greptile found that JSON with an email still formed a link. Its real-command regression failed before narrowing whole-address recognition and passes after the fix. An isolated frozen install and SDK build resolved local workspace prerequisite errors. - No live task edit or deployed replay was run. Full repository checks run in current-head CI. The initial quality gate rejected generated lockfile edits; the policy correction removes them without changing tested source. The earlier current-head workspaces-a CI failure was the independently fixed invitation-access fixture in App.test.tsx. Merge #18799 supplied that baseline fixture fix. Its local regression and the editor suites now pass together; all final-head CI checks now pass. Final head `5156085b83c908e1439927bbebf25ab0aa42f81b` has 60 terminal contexts: 56 success, three skipped, and the neutral Paperclip review at 5/5. Greptile is 5/5 with no unresolved findings. - Review regressions also failed before repair for a selected soft line break, formatted HTML with JSON, and international email addresses. These cases now pass. The HTML test checks that bold formatting survives. ## Risks - URL recognition must not turn ordinary text into a link. Ambiguous relative paths use text replacement on paste; the manual link controls still accept them. - The selected HTML path must preserve formatting. It delegates insertion to the native rich-paste API with the original clipboard. File payloads and non-simple selection types still yield. - Existing Markdown normalization still applies. Script/data scheme checks and rendered-link sanitization remain unchanged. - No visual tokens, schema, public API, provider or deployment configuration changes are required. No additional user documentation is needed for this expected editing behavior. ## Model Used OpenAI Codex, `gpt-6.1-sol`, Extra High reasoning, with source inspection, code execution and regression testing. Context-window capacity is not exposed in this session. ## 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) - [x] My branch name describes the change 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 - [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: Paperclip <noreply@paperclip.ing>
107 lines
3.7 KiB
JSON
107 lines
3.7 KiB
JSON
{
|
|
"name": "@paperclipai/ui",
|
|
"version": "0.3.1",
|
|
"description": "Prebuilt Paperclip board UI assets.",
|
|
"license": "MIT",
|
|
"homepage": "https://github.com/paperclipai/paperclip",
|
|
"bugs": {
|
|
"url": "https://github.com/paperclipai/paperclip/issues"
|
|
},
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "https://github.com/paperclipai/paperclip",
|
|
"directory": "ui"
|
|
},
|
|
"type": "module",
|
|
"scripts": {
|
|
"dev": "vite",
|
|
"build": "vite build",
|
|
"build:preview": "vite build --config vite.preview.config.mjs",
|
|
"storybook": "storybook dev -p 6006 -c storybook/.storybook",
|
|
"build-storybook": "storybook build -c storybook/.storybook -o storybook-static",
|
|
"preview": "vite preview",
|
|
"typecheck": "node ../scripts/storybook-catalog.mjs && node ../scripts/run-tsc.mjs -b",
|
|
"clean": "rm -rf dist dist-preview storybook-static tsconfig.tsbuildinfo",
|
|
"prepack": "rm -f package.dev.json && cp package.json package.dev.json && node ../scripts/generate-ui-package-json.mjs",
|
|
"postpack": "if [ -f package.dev.json ]; then mv package.dev.json package.json; fi"
|
|
},
|
|
"publishConfig": {
|
|
"access": "public"
|
|
},
|
|
"dependencies": {
|
|
"@assistant-ui/react": "0.15.22",
|
|
"@base-ui/react": "^1.7.0",
|
|
"@codemirror/lang-yaml": "^6.1.3",
|
|
"@codemirror/language": "^6.12.4",
|
|
"@codemirror/state": "^6.7.2",
|
|
"@codemirror/view": "^6.43.11",
|
|
"@dnd-kit/core": "^6.3.1",
|
|
"@dnd-kit/sortable": "^10.0.0",
|
|
"@dnd-kit/utilities": "^3.2.2",
|
|
"@lexical/clipboard": "0.48.0",
|
|
"@lexical/link": "0.48.0",
|
|
"@lezer/highlight": "^1.2.3",
|
|
"@mdxeditor/editor": "^4.2.3",
|
|
"@paperclipai/adapter-claude-local": "workspace:*",
|
|
"@paperclipai/adapter-codex-local": "workspace:*",
|
|
"@paperclipai/adapter-cursor-cloud": "workspace:*",
|
|
"@paperclipai/adapter-cursor-local": "workspace:*",
|
|
"@paperclipai/adapter-gemini-local": "workspace:*",
|
|
"@paperclipai/adapter-grok-local": "workspace:*",
|
|
"@paperclipai/adapter-kimi-local": "workspace:*",
|
|
"@paperclipai/adapter-openclaw-gateway": "workspace:*",
|
|
"@paperclipai/adapter-opencode-local": "workspace:*",
|
|
"@paperclipai/adapter-pi-local": "workspace:*",
|
|
"@paperclipai/adapter-utils": "workspace:*",
|
|
"@paperclipai/hermes-paperclip-adapter": "workspace:*",
|
|
"@paperclipai/shared": "workspace:*",
|
|
"@radix-ui/react-slot": "^1.3.3",
|
|
"@spekoai/client": "0.0.13",
|
|
"@tailwindcss/typography": "^0.5.20",
|
|
"@tanstack/react-query": "^5.102.8",
|
|
"@xterm/addon-fit": "^0.11.0",
|
|
"@xterm/xterm": "^6.0.0",
|
|
"class-variance-authority": "^0.7.1",
|
|
"clsx": "^2.1.1",
|
|
"cmdk": "^1.1.1",
|
|
"codemirror": "^6.0.2",
|
|
"i18next": "^26.4.2",
|
|
"lexical": "0.48.0",
|
|
"lucide-react": "^1.48.0",
|
|
"mermaid": "^12.1.0",
|
|
"motion": "^13.1.1",
|
|
"radix-ui": "^1.6.7",
|
|
"react": "^19.2.8",
|
|
"react-dom": "^19.2.8",
|
|
"react-i18next": "^17.0.15",
|
|
"react-markdown": "^10.1.0",
|
|
"react-resizable-panels": "^4.12.3",
|
|
"react-router-dom": "^7.18.4",
|
|
"remark-gfm": "^4.0.1",
|
|
"tailwind-merge": "^3.6.0",
|
|
"yaml": "^2.8.1",
|
|
"yjs": "13.6.32"
|
|
},
|
|
"devDependencies": {
|
|
"@lexical/rich-text": "0.48.0",
|
|
"@paperclipai/plugin-sdk": "workspace:*",
|
|
"@sentry/browser": "10.71.0",
|
|
"@storybook/addon-a11y": "10.6.0",
|
|
"@storybook/addon-docs": "10.6.0",
|
|
"@storybook/react-vite": "10.5.10",
|
|
"@tailwindcss/vite": "^4.3.3",
|
|
"@types/node": "^24.0.0",
|
|
"@types/react": "^19.2.18",
|
|
"@types/react-dom": "^19.2.5",
|
|
"@vitejs/plugin-react": "^6.1.1",
|
|
"storybook": "10.6.0",
|
|
"tailwindcss": "^4.3.3",
|
|
"typescript": "^7.0.2",
|
|
"vite": "^8.2.2",
|
|
"vitest": "^5.0.3"
|
|
},
|
|
"engines": {
|
|
"node": ">=24.11.0"
|
|
}
|
|
}
|