zed icon indicating copy to clipboard operation
zed copied to clipboard

"Share Feedback" modal triggers the "Discard feedback?" modal when escape is pressed in Vim mode

Open sudomateo opened this issue 1 year ago • 1 comments

Check for existing issues

  • [X] Completed

Describe the bug / provide steps to reproduce it

The Share Feedback modal triggers the Discard feedback? modal when escape is pressed in Vim mode.

Reproduction

  1. Configure Zed to use Vim mode.
  2. Click the Share Feedback button in the dock.
  3. Click into the text area.
  4. Hit i to enter insert mode.
  5. Type some text.
  6. Hit Escape to exit insert mode.
  7. Observe the Discard feedback? modal pops up.

Expected Behavior

The Discard feedback? modal should not pop up unless:

  • The user is already in command mode in Vim.
  • The user clicks the Cancel button.

Environment

Zed: v0.119.20 (Zed) OS: macOS 14.3.0 Memory: 32 GiB Architecture: aarch64

If applicable, add mockups / screenshots to help explain present your vision of the feature

Screenshot 2024-01-29 at 13 11 50

If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.

If you only need the most recent lines, you can run the zed: open log command palette action to see the last 1000.

2024-01-29T18:26:59 [INFO] ========== starting zed ==========
2024-01-29T18:26:59 [INFO] Opening main db
2024-01-29T18:26:59 [INFO] set environment variables from shell:/opt/homebrew/bin/fish, path:REDACTED
2024-01-29T18:26:59 [ERROR] crates/zed/src/zed.rs:538: EOF while parsing a value at line 1 column 0
2024-01-29T18:26:59 [INFO] Opening main db
2024-01-29T18:26:59 [INFO] Node runtime install_if_needed
2024-01-29T18:27:00 [INFO] 0 unhandled notification LogMessage:
{
  "level": 0,
  "message": "[DEBUG] [agent] [2024-01-29T18:27:00.428Z] Agent service starting",
  "metadataStr": "[DEBUG] [agent] [2024-01-29T18:27:00.428Z]",
  "extra": [
    "Agent service starting"
  ]
}
2024-01-29T18:27:00 [INFO] 0 unhandled notification client/registerCapability:
{
  "registrations": [
    {
      "id": "d676028c-d18a-4336-a8bc-fe4385acced3",
      "method": "workspace/didChangeWorkspaceFolders",
      "registerOptions": {}
    }
  ]
}
2024-01-29T18:27:00 [INFO] 0 unhandled notification LogMessage:
{
  "level": 0,
  "message": "[DEBUG] [agent] [2024-01-29T18:27:00.436Z] Telemetry initialized",
  "metadataStr": "[DEBUG] [agent] [2024-01-29T18:27:00.436Z]",
  "extra": [
    "Telemetry initialized"
  ]
}

sudomateo avatar Jan 29 '24 18:01 sudomateo

Thanks for the report @sudomateo, we will likely try to look intot this this week.

JosephTLyons avatar Jan 29 '24 22:01 JosephTLyons

You're welcome! No rush at all. Thank you all for the great editor.

sudomateo avatar Jan 30 '24 21:01 sudomateo

Some extra info: https://github.com/zed-industries/zed/pull/7569 fixed issues with this modal spawning extra Discard feedback? dialogues popping up, but this one is still not fixed. The reason for this seems to be the feedback panel reacting to ESC here: https://github.com/zed-industries/zed/blob/8372b4a0784dbce8dae3299830f1338e75dcd42e/crates/feedback/src/feedback_modal.rs#L407-L409

Which suggests that some global Vim-related fix has to be applied, not only related to this modal. cc @ConradIrwin just in case he as some pointers for this

SomeoneToIgnore avatar Feb 08 '24 14:02 SomeoneToIgnore

The right fix is probably to make sure vim mode isn't enabled inside the feedback modal (or to change how vim works to bind its actions to the editor instead of the workspace so it takes priority). Neither is super trivial right now unfortunately.

ConradIrwin avatar Feb 08 '24 16:02 ConradIrwin