Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Don't change console history if Shift held down #2384

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mofojed
Copy link
Member

@mofojed mofojed commented Mar 7, 2025

  • If a modifier key was held down to select text in a console input and you were pressing up/down, you would change history items and it was very annoying

- If a modifier key was held down to select text in a console input and you were pressing up/down, you would change history items and it was very annoying
@mofojed mofojed requested review from a team and Copilot March 7, 2025 22:00
@mofojed mofojed self-assigned this Mar 7, 2025
@mofojed mofojed requested review from vbabich and removed request for a team March 7, 2025 22:00

Choose a reason for hiding this comment

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

PR Overview

This PR fixes an issue where holding a modifier key (such as Shift) while navigating the console input using arrow keys inadvertently changes the command history.

  • Wraps arrow key history navigation logic in a condition that checks for no active modifier keys.
  • Removes a redundant modifier check from the Enter key handling block.

Reviewed Changes

File Description
packages/console/src/ConsoleInput.tsx Adds a modifier key condition to prevent history changes when Shift is held, and removes a redundant check in the Enter key handling branch

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

Copy link

codecov bot commented Mar 7, 2025

Codecov Report

Attention: Patch coverage is 92.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 46.80%. Comparing base (d595d88) to head (16c3cc7).

Files with missing lines Patch % Lines
packages/console/src/ConsoleInput.tsx 92.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2384   +/-   ##
=======================================
  Coverage   46.80%   46.80%           
=======================================
  Files         710      710           
  Lines       39240    39240           
  Branches     9793     9793           
=======================================
+ Hits        18365    18366    +1     
+ Misses      20864    20863    -1     
  Partials       11       11           
Flag Coverage Δ
unit 46.80% <92.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

2 participants