codechef-cli icon indicating copy to clipboard operation
codechef-cli copied to clipboard

Enhance Response Text Styling

Open sk364 opened this issue 4 years ago • 16 comments

Responses from various options require styling as to enhance the UI/UX.

Example (output of --search option):

This prints out a table with headers as capitals. Could print out as bold, title-cased. Also, in rows it could print out the Code in different color.

NAME                                                 CODE       SUCCESSFUL SUBMISSION   ACCURACY   

MEX-ception                                          TOTEM      7                       32.26

sk364 avatar Jul 18 '20 23:07 sk364

Hi there! I would like to work on this issue. Could you please give me a elaborated description of what this issue is about?

sreesh-mallya avatar Jul 19 '20 14:07 sreesh-mallya

@sreesh-mallya Check the issue description.

sk364 avatar Jul 19 '20 20:07 sk364

Thinking of using library rich to prettify the responses.

sk364 avatar Jul 21 '20 14:07 sk364

Great! Would this be of any use here? Should I keep working, or are you taking a look? @sk364. I've started going through trying to understand how it all works.

sreesh-mallya avatar Jul 21 '20 14:07 sreesh-mallya

Halo looks good to me. We can use it.

Sure, you can keep working. I will be taking a look later.

sk364 avatar Jul 21 '20 14:07 sk364

@sk364 is @sreesh-mallya still working on this, or could I give this a whirl?

travis-sauer-oltech avatar Aug 17 '20 14:08 travis-sauer-oltech

@aUsefulMethod I've started to work on this, but haven't done much in the past week. @sk364 please make the call. I can probably get this done this weekend, or if you want @aUsefulMethod to go ahead with this, that's fine by me too. :)

sreesh-mallya avatar Aug 18 '20 03:08 sreesh-mallya

@sreesh-mallya can you describe the changes that you are doing? @aUsefulMethod, if interested, can either fill the gaps or extend it.

sk364 avatar Aug 18 '20 03:08 sk364

@sk364 I'm not sure if I've done something very significant yet. All I've done is used rich.table to print out the search results in helpers.print_response_util. I need to check the tests and see what lines of code is not required anymore, since rich does all the work for creating and printing the table. I was also thinking of using halo as mentioned before.

sreesh-mallya avatar Aug 18 '20 05:08 sreesh-mallya

I've some suggestions too: How about using subcommands instead of using options for logging in, getting the problem description, listing contests, and submitting code?

Maybe something like codechefcli login to login, or codechefcli problem WEICOM to get the problem description, and so on. We can use click or Typer, I've found them easier to use than argparse.

@sk364 what do you think?

sreesh-mallya avatar Aug 18 '20 06:08 sreesh-mallya

@sreesh-mallya yeah, we can use subcommands. You can create a separate issue for it.

sk364 avatar Aug 19 '20 11:08 sk364

@aUsefulMethod check out this issue.

sreesh-mallya avatar Aug 19 '20 11:08 sreesh-mallya

@sk364 There are a few functions for printing tables and styling responses which I think we won't be needing since we're using rich. Shall I go ahead and remove them?

sreesh-mallya avatar Aug 27 '20 13:08 sreesh-mallya

Yes, go ahead

sk364 avatar Aug 27 '20 13:08 sk364

Hi, I was just curious that in the problems.py . get_description(...) , on line 36 onward the code is defining a list which is storing certain properties of problems like, Name, Author, Date Added and so on image

but then on line 59 code is using .join to which is converting every object in the list into string and returning it as response , image

the problem is, for making tables I think it would be a lot more easier if the data is returned in a dictionary format rather than string so that separate columns can be constructed using the keys of the dictionary and corresponding values can be filled in cell

Jai2305 avatar Aug 25 '21 08:08 Jai2305

Hi there! I would like to work on this issue. Can you please assign this issue to me!

ajjayymahato avatar Sep 25 '22 18:09 ajjayymahato