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

Ensure all slash commands support -h/--help #878

Merged
merged 8 commits into from
Jul 9, 2024

Conversation

krassowski
Copy link
Member

Fixes #798

I think this is a good first step, explaining /learn -h options and preventing destructive action on /clear -h.

Before After
image image
Before After
image image

@krassowski krassowski added the bug Something isn't working label Jul 7, 2024
Copy link
Member

@dlqqq dlqqq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@krassowski Thank you for opening this PR to improve help in slash commands! Left some feedback below.

packages/jupyter-ai/jupyter_ai/chat_handlers/ask.py Outdated Show resolved Hide resolved
packages/jupyter-ai/jupyter_ai/chat_handlers/base.py Outdated Show resolved Hide resolved
packages/jupyter-ai/jupyter_ai/chat_handlers/base.py Outdated Show resolved Hide resolved
@dlqqq dlqqq changed the title Fix inconsistent and missing help for slash commands Ensure all slash commands have a help option Jul 8, 2024
@dlqqq dlqqq changed the title Ensure all slash commands have a help option Ensure all slash commands support -h/--help Jul 8, 2024
@dlqqq
Copy link
Member

dlqqq commented Jul 8, 2024

@krassowski I'm marking this as a draft for now as you work on addressing the feedback above. Feel free to mark this as ready & ping me when done, thanks! 👋

@dlqqq dlqqq marked this pull request as draft July 8, 2024 21:47
@krassowski
Copy link
Member Author

I applied the requested changes:

image

To my taste using lower-case and backtick for each fragment would be better but 🤷

@krassowski krassowski marked this pull request as ready for review July 9, 2024 11:48
@krassowski krassowski requested a review from dlqqq July 9, 2024 11:48
@dlqqq dlqqq added enhancement New feature or request and removed bug Something isn't working labels Jul 9, 2024
Copy link
Member

@dlqqq dlqqq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@krassowski Almost there! One minor naming suggestion below.

packages/jupyter-ai/jupyter_ai/chat_handlers/base.py Outdated Show resolved Hide resolved
Copy link
Member

@dlqqq dlqqq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@krassowski Awesome work, thank you!!! 🎉

@dlqqq dlqqq enabled auto-merge (squash) July 9, 2024 16:47
@dlqqq dlqqq merged commit bc082b5 into jupyterlab:main Jul 9, 2024
8 checks passed
@krassowski krassowski mentioned this pull request Jul 11, 2024
Marchlak pushed a commit to Marchlak/jupyter-ai that referenced this pull request Oct 28, 2024
* Fix help for slash commands

* Do not add `-h` to the help command itself

Co-authored-by: david qiu <[email protected]>

* Fix typo

Co-authored-by: david qiu <[email protected]>

* Centralize handling of `-h`/`--help`, with opt-out via class attribute

by default the `/help` and "default" handlers opt-out from `-h` handling

* Add colon delimiter and wrap the arguments in backticks

* Use Title case for help messages

* Remove final leftover

* Rename `display_arguments_help` to `supports_help`

---------

Co-authored-by: david qiu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The chat -h in chat commands is inconsistent and not very helpful
2 participants