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

bug: pressing UpArrow in multiline message has surprising behavior #1134

Closed
olafurpg opened this issue Mar 19, 2024 · 3 comments · Fixed by #1323
Closed

bug: pressing UpArrow in multiline message has surprising behavior #1134

olafurpg opened this issue Mar 19, 2024 · 3 comments · Fixed by #1323
Labels
bug Something isn't working

Comments

@olafurpg
Copy link
Member

Cody Version

5.4.6-nightly

IDE Information

IntelliJ IDEA 2023.2.4 (Ultimate Edition)
Build #IU-232.10203.10, built on October 24, 2023
Licensed to Sourcegraph / Olaf Geirsson
Subscription is active until May 12, 2024.
Runtime version: 17.0.8.1+7-b1000.32 aarch64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 13.6.4
GC: G1 Young Generation, G1 Old Generation
Memory: 16000M
Cores: 10
Metal Rendering is ON
Registry:
    ide.browser.jcef.debug.port=9222
    ide.experimental.ui=true
    scala.erase.compiler.process.jdk.once=false
    eslint.additional.file.extensions=svelte

Non-Bundled Plugins:
    MatlabSupport (0.8.5)
    org.rust.lang (0.4.201.5424-232)
    IdeaVIM (2.7.5)
    com.github.shiraji.ccch (1.0.1)
    com.facebook.ktfmt_idea_plugin (1.1.0.47)
    google-java-format (1.21.0.0)
    com.jetbrains.intellij.code.search.polaris (0.232.1.119)
    org.jetbrains.kotlin (232-1.9.23-release-779-IJ10072.27)
    com.intellij.ml.llm (232.9826)
    com.virtuslab.git-machete (4.2.0)
    com.intellij.lang.jsgraphql (4.0.2)
    dev.blachut.svelte.lang (232.9921.36)
    org.intellij.scala (2023.2.29)
    com.sourcegraph.jetbrains (5.4.6-nightly)

Kotlin: 232-1.9.23-release-779-IJ10072.27

Describe the bug

  • Start chat
  • Send "Hello"
  • Type new multiline message a\n\nb
  • Press up arrow
  • Actual behavior: chat input moves in history to previous "Hello" message

Expected behavior

I expected the cursor to move up one line in the chat input

Additional context

No response

@olafurpg olafurpg added the bug Something isn't working label Mar 19, 2024
@olafurpg
Copy link
Member Author

I'm regularly hitting on this bug making it quite annoying to use the chat in JB. I would rather disable the custom up/down arrows than have this buggy behavior. I'm not sure why/when this regressed because I'm pretty sure I tested this thoroughly when we launched it

@danielmarquespt
Copy link
Contributor

@olafurpg
Copy link
Member Author

The regression happened in this PR here @pkukielka https://sourcegraph.com/github.com/sourcegraph/jetbrains/-/commit/88a21694097716fbe53b84e76b3124cb3454af76

Specifically, the isInHistoryMode variable was responsible to only enabling this behavior when the text input was empty. This variable got removed in that commit

https://sourcegraph.com/github.com/sourcegraph/jetbrains/-/commit/88a21694097716fbe53b84e76b3124cb3454af76#diff-91c99de25d8f01dab68bee8fa28fb6f1L80

olafurpg added a commit that referenced this issue Apr 16, 2024
Fixes #1134

Previously, pressing up/down arrow keys in the chat input always
replaced the entire contents of the chat input with the previous/next
chat message from history. This was a regression that was introduced
in the commit https://sourcegraph.com/github.com/sourcegraph/jetbrains/-/commit/88a21694097716fbe53b84e76b3124cb3454af76#diff-91c99de25d8f01dab68bee8fa28fb6f1L80
where the variable `isInHistoryMode` got removed. This PR adds back the
original logic for `isInHistoryMode` so the chat input works like
before.

Demo https://www.loom.com/share/4806fcaeaa9e44519d12e8b6d16a29a0
olafurpg added a commit that referenced this issue Apr 16, 2024
Fixes #1134

Previously, pressing up/down arrow keys in the chat input always
replaced the entire contents of the chat input with the previous/next
chat message from history. This was a regression that was introduced in
the commit
https://sourcegraph.com/github.com/sourcegraph/jetbrains/-/commit/88a21694097716fbe53b84e76b3124cb3454af76#diff-91c99de25d8f01dab68bee8fa28fb6f1L80
where the variable `isInHistoryMode` got removed. This PR adds back the
original logic for `isInHistoryMode` so the chat input works like
before.

## Test plan

Manually tested. See demo
https://www.loom.com/share/4806fcaeaa9e44519d12e8b6d16a29a0
<!-- All pull requests REQUIRE a test plan:
https://sourcegraph.com/docs/dev/background-information/testing_principles

Why does it matter?

These test plans are there to demonstrate that are following industry
standards which are important or critical for our customers.
They might be read by customers or an auditor. There are meant be simple
and easy to read. Simply explain what you did to ensure
your changes are correct!

Here are a non exhaustive list of test plan examples to help you:

- Making changes on a given feature or component:
- "Covered by existing tests" or "CI" for the shortest possible plan if
there is zero ambiguity
  - "Added new tests"
- "Manually tested" (if non trivial, share some output, logs, or
screenshot)
- Updating docs:
  - "previewed locally"
  - share a screenshot if you want to be thorough
- Updating deps, that would typically fail immediately in CI if
incorrect
  - "CI"
  - "locally tested"
-->
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
None yet
Development

Successfully merging a pull request may close this issue.

2 participants