Skip to content

Conversation

@CamelliaRui
Copy link

Summary

Fixes issue #8 - Deleting a chat session no longer triggers unwanted session switches when the deleted session is not the currently active one.

Changes Made

  • Modified removeSession() function in sessionStorageMutations.ts to check if the deleted session is currently active
  • Only switches sessions when the active session is being deleted
  • When switching is necessary, navigates to the next session in the list (or previous if deleting the last session)
  • Maintains user's current view state when deleting non-active sessions

Behavior

Before:

  • Deleting any session would automatically switch to the first session in the list
  • User lost context even when deleting a different session

After:

  • Deleting a non-active session: No session switch occurs, user stays on current session
  • Deleting the active session: Automatically switches to the next session (or previous if last)
  • Predictable navigation behavior

Test plan

  • Create multiple chat sessions
  • Select session 2
  • Delete session 3 from sidebar → Verify session 2 remains active
  • Delete session 2 (currently active) → Verify app switches to adjacent session
  • Test deleting the last session in the list → Verify app switches to previous session

Closes #8

🤖 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>
This commit fixes issue chatboxai#8 where deleting a chat session would trigger an
unwanted session switch, disrupting the user's workflow.

Changes:
- Modified removeSession() to check if the deleted session is the currently active one
- Only switches sessions when the active session is being deleted
- When switching is necessary, navigates to the next session (or previous if last)
- Maintains user's current view state when deleting non-active sessions

Resolves chatboxai#8

🤖 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 #4 - [BUG] Deleting session triggers unwanted session switch