chucker icon indicating copy to clipboard operation
chucker copied to clipboard

Unable to select all response body

Open scruffyfox opened this issue 6 years ago • 6 comments

:loudspeaker: Describe the bug

Selecting response body using "select all" IME prompt only selects the line and not entire body, incidentally you are unable to select more than 1 line using the drag handles.

:bomb: To Reproduce

  1. do request
  2. open response
  3. select a word via double tap then either press "select all" or try to drag the handles
  4. you are unable to

:wrench: Expected behavior

As with Chuck, I expect to be able to select the entire response body

:camera: Screenshots

untitled

:iphone: Smartphone

  • Device: Emulator
  • OS: Android 8.1.0
  • Lib version: develop-SNAPSHOT

:page_facing_up: Additional context

Library is very close to being a good replacement to Chuck but some regressions like this means I can't use it yet :(

scruffyfox avatar Jan 13 '20 11:01 scruffyfox

Hey @scruffyfox

Yes, it is a regression, but it is due to #172 fix, which is quite crucial as well. So it is sort of intendent behavior at the moment 😞 We will try to address it quite later.

vbuberen avatar Jan 13 '20 12:01 vbuberen

As @vbuberen mentioned, this is expected. If you need to select the body in order to share it @scruffyfox, you can probably achieve the same result with the Share menu action.

cortinico avatar Jan 14 '20 16:01 cortinico

An idea then;

This was added because of large response bodies being too large to render in a single textview so you changed the functionality to be a recycler to make it a bit more 'efficient'

Would it make sense then, to have this functionality behind a 'pretty format' toggle which would allow devs to toggle between text view impl and recycler impl?

Something that would be extremely useful for this recycler view style formatter would be the ability to collapse/expand object/array groupings within json response, and/or in addition, the ability to select the grouping from the root character, for example, if i select { next to _embedded it would auto select all json text up until the matching } (this is essentially what I use the select functionality for - sending the json to our backend devs to tell them something is wrong ;)

I appreciate this is complex and probably isnt something that would be doable in the immediate future, but just throwing out possible solutions

scruffyfox avatar Jan 15 '20 09:01 scruffyfox

Would it make sense then, to have this functionality behind a 'pretty format' toggle which would allow devs to toggle between text view impl and recycler impl?

Thanks for the suggestion @scruffyfox

Having a TextView/RecyclerView switch is definitely doable. This will allow you to "select all" on the body. On the other hand: have you tried to use the "Share" action from the Menu as I suggested?

Something that would be extremely useful for this recycler view style formatter would be the ability to collapse/expand object/array groupings within json response, and/or in addition, the ability to select the grouping from the root character, for example, if i select { next to _embedded it would auto select all json text up until the matching } (this is essentially what I use the select functionality for - sending the json to our backend devs to tell them something is wrong ;)

Definitely cool, although probably something worth an independent library as it's definitely outside the scope of Chucker.

cortinico avatar Jan 20 '20 23:01 cortinico

@scruffyfox Nice idea about the selection of a brace { up until the matching brace } this is my first time, commenting on an issue here, and this seems like quite the nice thing to take a stab at, wouldn't mind digging into source code, and see if I could help

smilecs avatar Jan 24 '20 08:01 smilecs

this is my first time, commenting on an issue here, and this seems like quite the nice thing to take a stab at

Hey @smilecs thanks for commenting, you're very welcome to contribute!

Please note that, after #172, this feature might be not the easiest to implement. Let us know if you need any support

cortinico avatar Jan 24 '20 14:01 cortinico