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

Re-focus input after modifying model, keep input for 0.5s #77

Closed
wants to merge 5 commits into from

Conversation

krassowski
Copy link
Owner

@krassowski krassowski commented Dec 1, 2023

References

Fixes https://github.com/jupyterlab/jupyterlab/issues/ 12322

Code changes

  • immediately after submission the input box will reject inputs (but not disabled to keep focus)
  • a green ✓tick will show next to the input box in 0.1s after submission
  • the input box will fade away in 0.4s
  • the input box will be detached after 0.5s

TODO:

  • add a test case
  • maybe add a config option?

User-facing changes

  • users will receive a subtle visual indication confirming their input was sent (previously this was impossible to distinguish for sending an empty reply)
  • users will be able to quickly send replies without the input box loosing focus and leading to the code editor being overwritten

Backwards-incompatible changes

None

Tested that it fails on main reproducing the issue:

```
    - Expected  - 0
    + Received  + 8

      from time import sleep
      input()
      print('before sleep')
      sleep(0.1)
      print('after sleep')
    +
    +
    + x
    +
    +
    +
    +
    +
```
@krassowski krassowski closed this Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant