Skip to content

Conversation

@Githubguy132010
Copy link
Contributor

@Githubguy132010 Githubguy132010 commented May 8, 2025

This pull request modifies how input values are handled in the PromptsView and AutosizeTextarea components to prevent automatic trimming of whitespace. The changes ensure that user-provided values are preserved as-is, improving flexibility and accuracy in handling text inputs.

Changes in PromptsView Component (webview-ui/src/components/prompts/PromptsView.tsx):

  • Updated multiple instances where value.trim() was used to simply use value, ensuring that leading and trailing whitespace in user input is preserved. This adjustment affects updates to roleDefinition, customInstructions, and supportPrompt. [1] [2] [3] [4]

Changes in AutosizeTextarea Component (webview-ui/src/components/ui/autosize-textarea.tsx):

  • Modified the setTriggerAutoSize function to avoid trimming the value when updating the autosize behavior. This ensures that the full input, including whitespace, is reflected in the textarea.
  • Added a comment and updated the onChange handler to explicitly preserve the input value without trimming.

Important

Preserve whitespace in user inputs for PromptsView, AutosizeTextarea, and ChatTextArea components.

  • Behavior:
    • PromptsView.tsx: Removed trim() from roleDefinition, customInstructions, and supportPrompt updates to preserve whitespace.
    • autosize-textarea.tsx: Modified setTriggerAutoSize to avoid trimming value.
    • ChatTextArea.tsx: Updated setInputValue to preserve whitespace in user input.
  • Misc:
    • Removed unescapeSpaces import from ChatTextArea.tsx.

This description was created by Ellipsis for ef10350. You can customize this summary. It will automatically update as commits are pushed.

- In ChatTextArea, modified input handling to prevent trimming of values when setting state, ensuring that user input is preserved.
- Updated PromptsView to avoid trimming role definitions and custom instructions when updating modes, allowing for more flexible input handling.
- Adjusted AutosizeTextarea to ensure that the trigger for resizing is set without trimming the value, improving user experience when interacting with the text area.
@changeset-bot
Copy link

changeset-bot bot commented May 8, 2025

⚠️ No Changeset found

Latest commit: 70ffcaf

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@Githubguy132010 Githubguy132010 marked this pull request as ready for review May 8, 2025 14:33
@dosubot dosubot bot added the size:XXL This PR changes 1000+ lines, ignoring generated files. label May 8, 2025
@ellipsis-dev
Copy link
Contributor

ellipsis-dev bot commented May 8, 2025

Hi @Githubguy132010, thank you for your contribution!

I've reviewed this pull request and noticed that it contains two distinct groups of changes that could benefit from being separated into individual PRs:

  1. Whitespace Trimming Fix: The changes to PromptsView.tsx and autosize-textarea.tsx that address the issue of preserving whitespace in text inputs (which appears to be the main focus based on your PR description).

  2. ChatTextArea Component Rewrite: The extensive changes to ChatTextArea.tsx that include many new features beyond whitespace handling:

    • Drag-and-drop and paste support for images and files
    • URL handling and commit search functionality
    • TTS controls
    • API configuration selectors
    • Enhanced mention handling
    • And other UI improvements

Splitting these changes would make the review process more focused and manageable. The whitespace preservation fix could be merged quickly, while the more extensive ChatTextArea rewrite could receive the detailed review it deserves.

Would you consider separating these changes into two pull requests? This would align with our best practices for code review and make it easier to track the specific fixes for issue #3309.

Thank you!

@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. and removed size:XXL This PR changes 1000+ lines, ignoring generated files. labels May 8, 2025
@hannesrudolph hannesrudolph linked an issue May 8, 2025 that may be closed by this pull request
@hannesrudolph hannesrudolph moved this from New to Issue [In Progress] in Roo Code Roadmap May 8, 2025
@hannesrudolph hannesrudolph moved this from Issue [In Progress] to PR [Pre Approval Review] in Roo Code Roadmap May 8, 2025
@mrubens
Copy link
Collaborator

mrubens commented May 13, 2025

I think issue #3309 was already resolved by a revert. Beyond that issue, how important is it to stop trimming the inputs? I hadn't heard any complaints previously.

@Githubguy132010
Copy link
Contributor Author

I think issue #3309 was already resolved by a revert. Beyond that issue, how important is it to stop trimming the inputs? I hadn't heard any complaints previously.

Yea, it's fixed. I will close it.

@github-project-automation github-project-automation bot moved this from PR [Pre Approval Review] to Done in Roo Code Roadmap May 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Typing a space in a prompt editor results in an immediate trim

2 participants