Skip to content

fix: insertion issue#84

Merged
Junyi-99 merged 1 commit intomainfrom
fix/insertion-not-work
Jan 15, 2026
Merged

fix: insertion issue#84
Junyi-99 merged 1 commit intomainfrom
fix/insertion-not-work

Conversation

@Junyi-99
Copy link
Member

@Junyi-99 Junyi-99 commented Jan 15, 2026

description:

The "insert" button is always disabled because we cleared the selectedText and selectionRange.


Note

Fixes selection handling in chat input and tightens TS config.

  • In PromptInput, submit() now conditionally clears selection: if selectedText exists, call setSelectedText(null) and setSurroundingText(null); otherwise use clear(). Added corresponding store getters and updated useCallback deps
  • Minor: tsconfig.app.json removes bun from types and excludes **/*.test.ts(x) from the app build

Written by Cursor Bugbot for commit 124531c. This will update automatically on new commits. Configure here.

Copilot AI review requested due to automatic review settings January 15, 2026 03:22
@Junyi-99 Junyi-99 added the bug Something isn't working label Jan 15, 2026
@Junyi-99 Junyi-99 self-assigned this Jan 15, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes an issue where the "insert" button in the text patches component was always disabled after sending a message. The root cause was that the clearSelection() function was clearing the selectionRange, which is needed for the insert button to be enabled.

Changes:

  • Modified the selection clearing logic in the submit handler to preserve selectionRange when only selectedText exists
  • Removed "bun" from TypeScript types configuration and added test file exclusions

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
webapp/_webapp/tsconfig.app.json Removed "bun" type reference and added test file exclusions
webapp/_webapp/src/views/chat/footer/index.tsx Modified submit handler to conditionally clear selection state, preserving selectionRange for the insert button

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Junyi-99 Junyi-99 moved this from Icebox to QA / Testing in Project PaperDebugger Jan 15, 2026
@Junyi-99 Junyi-99 merged commit da52ddf into main Jan 15, 2026
10 checks passed
@Junyi-99 Junyi-99 deleted the fix/insertion-not-work branch January 15, 2026 03:31
@github-project-automation github-project-automation bot moved this from QA / Testing to Done in Project PaperDebugger Jan 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants