rubyapi/rubyapi

RBS Type Signatures toggle appears to fail

olivierlacan opened this issue · 3 comments

Not seeing an error message in any of the network requests but the request triggered seems to fail:
image

Oddly it also seems to do a full page refresh:
image

So I noticed 2 things looking at this just now:

  1. It doesn't seems like the button text ever changes. I press the button on the String class, and it does toggle signatures on and off, but the button doesn't change to the word "Disable" ever.

Type Signatures on
Screen Shot 2023-01-26 at 11 42 58 PM

Type Signatures off
Screen Shot 2023-01-26 at 11 42 24 PM

  1. I don't think we have OptionParser::Completion type signatures. It's just showing that button if this is Ruby >= 3.0. There's no per-class logic right now (seems like there should be). I see that there's type signatures for OptionParser (toggling does change the method definitions), but OptionParser::Completion doesn't seem to work. I know the type signatures are pulled from the RBS gem, but I'm not exactly sure how it all works.

👋🏻 Apologies for the delay in responding. I worked on a fix for the button not correctly updating the label a few days ago but it never went out because of a flaky spec.

I've pushed the change out to production and the button is using the correct labels now.

Re: OptionParser::Completion Type signatures. There doesn't seem to be any type signatures specifically for OptionParser::Completion from looking at the RBS repository https://github.com/ruby/rbs/blob/master/stdlib/optparse/0/optparse.rbs

Thanks so much @colby-swandale! 😃