Skip to content

Conversation

@CamelliaRui
Copy link

Summary

Implements issue #6 - adds a copy button to code blocks with improved UX

Changes Made

  • Copy button now only appears on hover over code blocks (smooth opacity transition)
  • Replaced toast notification with inline "Copied!" confirmation message in green
  • Auto-reset confirmation after 2 seconds
  • Added smooth CSS transitions for better visual feedback

Implementation Details

  • Modified src/renderer/components/Markdown.tsx
  • Added copied state to track copy status
  • Updated onClickCopy handler to show inline feedback instead of toast
  • Applied Tailwind CSS classes for hover effects and transitions
  • Copy button uses opacity-0 group-hover:opacity-30 hover:!opacity-100 for progressive visibility

Testing

  • Build passes successfully
  • No TypeScript errors
  • Copy functionality works as expected with visual confirmation

Resolves

Closes #6

🤖 Generated with Claude Code

Bin-Huang and others added 30 commits January 11, 2025 21:31
new TextDecoder() needs to be reused throughout the entire stream parsing process, otherwise a new decoder will be created each time and the { stream: true } feature cannot be used.
Co-authored-by: yangruichao <houxin@hongxin>
* bugfix/Remove generate title setting disabling actual chat instead of title generation

* bugfix/Add generate title setting check to generateName effect
feat: update package name

chore: remove unused files
* feat: stop generating in input box

* chore: update electron app icon

* feat: default xAI models

* feat: highlight links in error message

* fix: cancel message generating before modifying message
* feat: catch api error and upload to sentry

* fix: sentry tag name
* feat: remove update reminder badge

* chore: move electron builder config to seperated config file

* feat: show update reminder on toolbar

* chore: remove unused file

* style: format

* fix: off event name, remove unnecessary atom
themez and others added 30 commits August 7, 2025 20:14
* feat: add a minimum width to the settings page

* feat: flexible width of the settings menu & provider list

* fix: flex basis
…xai#357)

* feat: transform mermaid static block for mobile compatibility

* chore: adjust ios version requirement

* feat: adjust targets

* fix: ios target
* feat: update copilots page layout

* fix: styles
* fix: session settings reset

* fix: use pick instead of omit
* feat(InputBox): support draft

* feat(hooks): useMessageInput hook w/ draft

* fix(useMessageInput): typo

* feat(useMessageInput): support debounce

* fix(useMessageInput): handle new chat case

* feat(useMessageInput): isNewSession as option

* Update src/renderer/hooks/useMessageInput.ts

Co-authored-by: Zeng Xian <xianz@iftech.io>

---------

Co-authored-by: Zeng Xian <xianz@iftech.io>
* fix: clear draft immediately when sending message

Previously, drafts were cleared with a debounce delay (300ms), causing them to persist briefly after sending. This fix adds a clearDraft method that immediately removes the draft from localStorage without delay.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: prevent add modified item into inputbox history

---------

Co-authored-by: Claude <noreply@anthropic.com>
* fix: mobile useProxy request

* feat: capacitor stream http

* feat: update to published capacitor-stream-http package

* refactor: clean code

* fix: improve native streaming error handling and SSE support

- Add proper error handling in createNativeReadableStream to prevent listener leaks
- Reuse TextEncoder instance for better performance
- Add Accept: text/event-stream header for proper SSE negotiation
- Support AbortSignal for request cancellation on mobile
- Fix error detection for status codes (0, <200, >=400)
- Add Cache-Control header to prevent SSE stream caching

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: enhance error handling and request cancellation in mobile requests

- Improve handling of abort signals for stream cancellation
- Refactor error throwing for ApiError to prevent unnecessary retries
- Ensure proper origin detection for network errors

This update aims to streamline mobile request processing and enhance error management.

* fix: improve error message formatting in API requests

- Update ApiError throwing to include the error message as a second argument, ensuring better clarity in error reporting.

This change enhances the debugging experience by providing more context in error messages.

---------

Co-authored-by: Claude <noreply@anthropic.com>
* feat: display artifacts in full screen

* chore: minor fixes
* feat: show unnormal stop reason

* fix: type def
* fix: clear draft imediatly after submitted

* fix: type safe

* fix: update InputBox onSubmit type and clean up imports in routes

* Update src/renderer/components/InputBox.tsx

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
…ai#374)

* fix: prevent duplicate conversation name generation requests

- Add debouncing mechanism to prevent multiple name generation requests
- Check if messages are still generating before triggering name generation
- Use global tracking to maintain request state across session switches
- Delay name generation by 1 second to ensure stream completion

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Update src/renderer/stores/sessionActions.ts

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
* feat: upgrade ai sdk for gpt5 support

* chore: update @ai-sdk/openai-compatible patch for v0.2.16

Update patch file to support the new version of @ai-sdk/openai-compatible (0.2.16).
The patch adds support for the 'reasoning' field as a fallback to 'reasoning_content'.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
Previously, ApiError instances were being re-wrapped, causing the responseBody
to be lost and showing nested error messages like "API Error: Error from OpenAI:
Error: API Error: Status Code 400" instead of the actual error details.

Now ApiError instances are passed through without re-wrapping, ensuring the
responseBody is preserved and displayed correctly in MessageErrTips.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
… documentation (chatboxai#2597)

* docs:added setup notes

* chore: tooling/environment

---------

Co-authored-by: Deepak Terse <deepak.terse@XINMBMAC45VJ9.local>
…de blocks

Implements issue chatboxai#6 - adds a copy button to code blocks that appears on hover and displays inline "Copied!" feedback.

Changes:
- Copy button now only visible on hover (opacity-0 to opacity-30 transition)
- Replaced toast notification with inline "Copied!" message in green
- Added 2-second auto-reset for the confirmation message
- Improved UX with smooth transitions and visual feedback

Resolves chatboxai#6

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
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.

Issue #2 - [FEATURE] Add copy button for code blocks