feat: paste detection in chat — collapsible code attachments#582
Merged
feat: paste detection in chat — collapsible code attachments#582
Conversation
When a user pastes a large text block (≥5 lines or ≥500 chars) into the chat textarea, it's intercepted and shown as a removable chip with auto-detected language. On send, pasted blocks are wrapped as fenced markdown code blocks. User messages containing code blocks render with collapsible preview (200px max-height with gradient fade). Also: mobile message actions (edit, summarize, regenerate, delete), mobile chat API methods, systemd service updated to use start_gpu.sh. Admin: pasteDetect utility, ChatView paste handling + chips UI + CSS. Mobile: ChatInput paste handling + chips, MessageBubble markdown render. i18n: pastedLines + removePasted keys in ru/en/kk. ## NEWS 📎 **Умная вставка кода в чат** Теперь при вставке большого текста (код, логи, конфиги) в чат — он автоматически определяется как вложение с языком программирования (Python, TypeScript, SQL и ещё ~15 языков). Вложение отображается как компактный чип, который можно удалить до отправки. В истории чата код показывается в сворачиваемом блоке — как в Claude.ai. Работает и в админке, и в мобильном приложении. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
```lang ... ```in message content — no backend changes needededitMessage,summarizeBranch,regenerateResponsemethodsstart_gpu.shwith proper kill/timeout signalspastedLines+removePastedkeys in ru/en/kkNEWS
📎 Умная вставка кода в чат
Теперь при вставке большого текста (код, логи, конфиги) в чат — он
автоматически определяется как вложение с языком программирования
(Python, TypeScript, SQL и ещё ~15 языков). Вложение отображается
как компактный чип, который можно удалить до отправки. В истории
чата код показывается в сворачиваемом блоке — как в Claude.ai.
Работает и в админке, и в мобильном приложении.
Test plan
cd admin && npm run build✅cd mobile && npm run build✅🤖 Generated with Claude Code