gitdiagram icon indicating copy to clipboard operation
gitdiagram copied to clipboard

fix(button): update disabled state styles to include cursor behavior

Open VedantAnand17 opened this issue 7 months ago • 12 comments
trafficstars

Changes

  • Updated disabled button state to show cursor-not-allowed instead of blocking all pointer events
  • Maintained visual opacity feedback (50%) for disabled state
  • Preserved SVG pointer event blocking for consistent behavior

Before

disabled:pointer-events-none disabled:opacity-50

After

disabled:cursor-not-allowed disabled:opacity-50

Why

This change improves the user experience by:

  • ✨ Providing better visual feedback through cursor indication
  • 🎯 Maintaining hover state visibility while preventing interactions
  • 🔍 Making the disabled state more intuitive and user-friendly
  • 🎨 Following established UI/UX patterns for disabled elements

Testing

  • [✅] Verified disabled button shows not-allowed cursor on hover
  • [✅] Confirmed clicks are still prevented on disabled state
  • [✅] Tested across all button variants

Screenshots

image

Related Issues

Closes #45

VedantAnand17 avatar Mar 30 '25 08:03 VedantAnand17

Can confirm reverting #31727 ( and #31804 ) fixes the problem

hellobbn avatar Jan 06 '25 09:01 hellobbn

  1. What's the last key you pressed before Nvim exits?
  2. Can you reproduce this problem when suspending Nvim using CTRL-Z as well?

zeertzjq avatar Jan 06 '25 09:01 zeertzjq

  1. What's the last key you pressed before Nvim exits?

    1. Can you reproduce this problem when suspending Nvim using CTRL-Z as well?
  1. The last key pressed is enter
  2. CTRL-Z does not seem to cause the problem

hellobbn avatar Jan 06 '25 09:01 hellobbn

Hmm, that means the release event actually came from the key before the Enter key, because the Enter key does not emit a release event.

A solution I can think of is to send a request to the terminal after disabling kitty keyboard protocol, and only stop reading from stdin when the response to that request is received. That'll make the code a bit complicated, though.

zeertzjq avatar Jan 06 '25 10:01 zeertzjq

Confirming the same issue on Ubuntu 24.04.1 LTS:

NVIM Version

  • NVIM v0.11.0-dev-1515+g7c00e0efbb
  • Build type: RelWithDebInfo
  • LuaJIT 2.1.1734355927

OS

  • Ubuntu 24.04.1

Terminal

  • iTerm2 Build 3.5.11

wjohnson-varicent avatar Jan 15 '25 03:01 wjohnson-varicent

A solution I can think of is to send a request to the terminal after disabling kitty keyboard protocol, and only stop reading from stdin when the response to that request is received. That'll make the code a bit complicated, though.

Ah, this is one of the recommended solutions in https://github.com/kovidgoyal/kitty/issues/8200#issuecomment-2572737815:

  1. After disabling key reporting send <ESC>[c to terminal and wait for terminal to respond. When you get the response you are guaranteed no more release events will some.

Doing this isn't easy because of the event loop (especially when suspending). And the other solution is to just disable release events.

zeertzjq avatar Jan 17 '25 03:01 zeertzjq

And the other solution is to just disable release events.

I think realistically we will (temporarily) do this before any 0.11 release anyway to give terminals time to catch up with the other issues this has unearthed. So we have some time to solve this.

But longer term I think yours/Kovid's suggestion makes sense.

gpanders avatar Jan 21 '25 15:01 gpanders

Image Image

Also getting this. debian + iterm2.

https://github.com/neovim/neovim/pull/31804

^

git clone https://github.com/neovim/neovim.git cd neovim git fetch origin pull/31804/head:fix-tty-restore git checkout fix-tty-restore make CMAKE_BUILD_TYPE=Release sudo make install

I still get it with this though. I'm not even sure what's going on.

thenengah avatar Mar 11 '25 15:03 thenengah

Disabled for the 0.11 release, will revisit during the 0.12 dev cycle.

clason avatar Mar 16 '25 11:03 clason

  1. Can you reproduce this problem when suspending Nvim using CTRL-Z as well?

After upgrading to NVIM v0.11.0, suspending nvim twice in a row leaves trailing escape sequences in kitty:

$ kitty --config NONE --dump-commands -o shell_integration=disabled bash
$ nvim --clean
^Z
[1]+  Stopped                 nvim --clean
$ fg
nvim --clean
^Z
[1]+  Stopped                 nvim --clean
$ ;35;125;1015;1875t

Any input after the resume makes the issue no longer reproducible.

And these are the differences between suspends as shown by kitty:

1a2,4
> screen_set_mode 2031 1
> screen_set_mode 2048 1
> screen_push_key_encoding_flags 1
30a34,35
> draw $ 
> screen_bell

tomushkin avatar Mar 30 '25 13:03 tomushkin

Not related to this issue. Please create a new one.

zeertzjq avatar Mar 30 '25 13:03 zeertzjq

@tomushkin See https://github.com/neovim/neovim/issues/32769

gpanders avatar Mar 30 '25 15:03 gpanders