Skip to content

add term:allowbracketedpaste, default false#1688

Merged
sawka merged 1 commit intomainfrom
sawka/ignore-bpm
Jan 7, 2025
Merged

add term:allowbracketedpaste, default false#1688
sawka merged 1 commit intomainfrom
sawka/ignore-bpm

Conversation

@sawka
Copy link
Member

@sawka sawka commented Jan 6, 2025

No description provided.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 6, 2025

Walkthrough

The pull request introduces a new configuration option term:allowbracketedpaste across multiple components of the Wave application. This configuration allows users to control the bracketed paste mode in the terminal. The changes span several files in the project, including documentation, frontend TypeScript files, Go package configurations, and type definitions.

The implementation involves adding a new constant, updating type signatures, modifying configuration structs, and integrating the new setting into the frontend terminal view. The changes are consistent across different parts of the application, ensuring that the new configuration option can be set, retrieved, and applied uniformly. The modification provides users with more granular control over terminal paste behavior while maintaining the existing structure and functionality of the Wave terminal configuration system.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b51ff83 and 417d4c3.

📒 Files selected for processing (7)
  • docs/docs/config.mdx (1 hunks)
  • frontend/app/view/term/term.tsx (3 hunks)
  • frontend/types/gotypes.d.ts (2 hunks)
  • pkg/waveobj/metaconsts.go (1 hunks)
  • pkg/waveobj/wtypemeta.go (1 hunks)
  • pkg/wconfig/metaconsts.go (1 hunks)
  • pkg/wconfig/settingsconfig.go (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • pkg/waveobj/wtypemeta.go
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Analyze (go)
  • GitHub Check: Build for TestDriver.ai
🔇 Additional comments (7)
pkg/wconfig/metaconsts.go (1)

37-37: LGTM! The constant follows the established naming convention.

The new configuration key is correctly placed in the terminal settings section and follows the existing pattern.

pkg/waveobj/metaconsts.go (1)

97-97: LGTM! The constant is consistent with wconfig package.

The new configuration key maintains consistency with the corresponding constant in the wconfig package.

pkg/wconfig/settingsconfig.go (1)

64-64: LGTM! The new field is correctly defined.

The TermAllowBracketedPaste field:

  • Uses the correct type *bool for optional boolean setting
  • Has the correct JSON tag matching the constant
  • Includes the omitempty tag as per the pattern
frontend/types/gotypes.d.ts (1)

496-496: LGTM! Type definitions are consistent with Go types.

The new configuration option is correctly added to both MetaType and SettingsType interfaces with:

  • Correct property name matching the Go constants
  • Optional modifier ?
  • Correct boolean type

Also applies to: 603-603

frontend/app/view/term/term.tsx (2)

Line range hint 930-945: LGTM! Configuration retrieval is well-implemented.

The new configuration atom for term:allowbracketedpaste follows the established pattern and correctly handles the default value.


Line range hint 945-960: Verify the negation logic for bracketed paste mode.

The configuration is correctly applied, but let's ensure the negation logic is as intended:

  • When term:allowbracketedpaste is true, ignoreBracketedPasteMode will be false (enabling bracketed paste)
  • When term:allowbracketedpaste is false, ignoreBracketedPasteMode will be true (disabling bracketed paste)

Run this script to verify the configuration usage:

✅ Verification successful

Negation logic for bracketed paste mode is correctly implemented

The configuration aligns perfectly with its intended behavior:

  • When term:allowbracketedpaste is true, bracketed paste is enabled (ignoreBracketedPasteMode: false)
  • When term:allowbracketedpaste is false (default), bracketed paste is disabled (ignoreBracketedPasteMode: true)
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the configuration usage and its effects on bracketed paste mode.

# Test: Search for other occurrences of bracketed paste mode configuration
rg -A 5 'ignoreBracketedPasteMode|allowbracketedpaste'

# Test: Search for any related tests
rg -A 5 'test.*[Bb]racketed[Pp]aste'

Length of output: 5761

docs/docs/config.mdx (1)

50-50: Documentation is clear and consistent.

The new configuration key is well-documented, following the established format and providing essential information about type, default value, and purpose.

Comment on lines +54 to +63
TermClear bool `json:"term:*,omitempty"`
TermFontSize float64 `json:"term:fontsize,omitempty"`
TermFontFamily string `json:"term:fontfamily,omitempty"`
TermTheme string `json:"term:theme,omitempty"`
TermDisableWebGl bool `json:"term:disablewebgl,omitempty"`
TermLocalShellPath string `json:"term:localshellpath,omitempty"`
TermLocalShellOpts []string `json:"term:localshellopts,omitempty"`
TermScrollback *int64 `json:"term:scrollback,omitempty"`
TermCopyOnSelect *bool `json:"term:copyonselect,omitempty"`
TermTransparency *float64 `json:"term:transparency,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Codebase verification

Removing terminal settings will break terminal functionality

The terminal settings fields are actively used in the frontend code (frontend/app/view/term/term.tsx) for critical functionality:

  • Visual settings (theme, font, transparency)
  • Terminal behavior (scrollback, WebGL)
  • Shell configuration
  • The removal needs to be reverted or these settings need to be migrated to maintain terminal functionality
🔗 Analysis chain

Verify the impact of removing terminal settings fields.

Multiple terminal configuration fields have been removed. Please confirm if this is intentional and whether there are any migration steps needed for existing configurations.

Run the following script to check for usage of the removed settings:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for usage of removed terminal settings
# Search for usage of removed terminal settings in the codebase

echo "Checking for usage of removed terminal settings..."
for setting in "term:*" "term:fontsize" "term:fontfamily" "term:theme" "term:disablewebgl" \
               "term:localshellpath" "term:localshellopts" "term:scrollback" \
               "term:copyonselect" "term:transparency"; do
    echo "Checking setting: $setting"
    rg -l "$setting"
done

Length of output: 10942


Script:

#!/bin/bash
# Check implementation details in term.tsx and recent changes

echo "Checking term.tsx implementation:"
rg -A 5 -B 5 "term:(fontsize|fontfamily|theme|disablewebgl|localshellpath|localshellopts|scrollback|copyonselect|transparency)" "frontend/app/view/term/term.tsx"

echo -e "\nChecking for recent changes:"
rg -A 5 -B 5 "term:" "RELEASES.md"

Length of output: 7475


Script:

#!/bin/bash
# Check for migration or replacement of terminal settings

echo "Checking for migration or replacement:"
rg -A 10 -B 10 "term:" "pkg/wconfig/defaultconfig/settings.json"

echo -e "\nChecking recent commits for terminal changes:"
git log --oneline -n 10 -- pkg/wconfig/settingsconfig.go frontend/app/view/term/

Length of output: 657

@sawka sawka merged commit 55f0373 into main Jan 7, 2025
7 checks passed
@sawka sawka deleted the sawka/ignore-bpm branch January 7, 2025 18:55
xxyy2024 pushed a commit to xxyy2024/waveterm_aipy that referenced this pull request Jun 24, 2025
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.

1 participant