ChatALL
ChatALL copied to clipboard
Feat: support managing predefined prompts with editing and replacement"
… after editing, it will replace the original prompt. Otherwise, it will create a new prompt.
Summary by CodeRabbit
-
New Features
- The edit button is now always visible, enhancing user accessibility.
- Introduced a new computed property to filter and display prompts based on user selections.
-
Bug Fixes
- Improved logic for adding prompts, allowing new prompts to be added at the end if no specific index is provided.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| chatall | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Jul 22, 2023 0:31am |
@tanchekwei Could you give a review? I believe you must have some reason to prevent editing the predefined prompts.
@tanchekwei Could you give a review? I believe you must have some reason to prevent editing the predefined prompts.
Added comment.
If a user wants to edit a predefined prompt, currently they can pin a prompt (which will add it to local storage) and then edit it.
@sunner, do you think we need to add another button, Duplicate button, for users to duplicate a predefined prompt and let them click the Edit button to modify it? Or, should we go with @qcgm1978’s approach and simply use the current Edit button for both duplicate and edit actions?
If we choose to add a Duplicate button, users will need to click two buttons to edit a predefined prompt: first, they click the Duplicate button, and then they click the Edit button. This approach is clearer.
if we use the Edit button for both actions, users will only need to click it once to edit the prompt. However, the existing edit button already use to edit the current user's prompt, same button with different behaviors may lead to confusion. What do you think?
Frankly speaking, I prefer an empty customized prompt library. The owner can choose to insert/edit/delete prompts, and import bulk prompts from other sources.
@coderabbitai review
:white_check_mark: Actions performed
Review triggered.
Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.
Walkthrough
The changes involve updates to the rendering logic and state management within the application. In PromptModal.vue, the edit button is now always rendered, while the delete button retains its conditional display. Additionally, a new computed property filters prompts based on user-defined titles. In the Vuex store, the editPrompt mutation has been modified to allow adding new prompts at the end of the list if no specific index is provided.
Changes
| File | Change Summary |
|---|---|
src/components/PromptModal.vue |
The edit button is always rendered; a new computed property userPromptsTitles is added to filter prompts based on user-defined titles. |
src/store/index.js |
The editPrompt mutation now sets index to the length of the state.prompts array if values.index is undefined, allowing for new prompt additions. |
Poem
In the meadow where prompts play,
A button shines bright, come what may.
With titles that dance and twirl,
New prompts join the happy swirl.
Hopping along, we cheer and say,
"Let's edit and create, hip-hip-hooray!" 🐇✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
🪧 Tips
Chat
There are 3 ways to chat with CodeRabbit:
- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
I pushed a fix in commit <commit_id>, please review it.Generate unit testing code for this file.Open a follow-up GitHub issue for this discussion.
- Files and specific lines of code (under the "Files changed" tab): Tag
@coderabbitaiin a new review comment at the desired location with your query. Examples:@coderabbitai generate unit testing code for this file.@coderabbitai modularize this function.
- PR comments: Tag
@coderabbitaiin a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.@coderabbitai read src/utils.ts and generate unit testing code.@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.@coderabbitai help me debug CodeRabbit configuration file.
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.
CodeRabbit Commands (Invoked using PR comments)
@coderabbitai pauseto pause the reviews on a PR.@coderabbitai resumeto resume the paused reviews.@coderabbitai reviewto trigger an incremental review. This is useful when automatic reviews are disabled for the repository.@coderabbitai full reviewto do a full review from scratch and review all the files again.@coderabbitai summaryto regenerate the summary of the PR.@coderabbitai resolveresolve all the CodeRabbit review comments.@coderabbitai configurationto show the current CodeRabbit configuration for the repository.@coderabbitai helpto get help.
Other keywords and placeholders
- Add
@coderabbitai ignoreanywhere in the PR description to prevent this PR from being reviewed. - Add
@coderabbitai summaryto generate the high-level summary at a specific location in the PR description. - Add
@coderabbitaianywhere in the PR title to generate the title automatically.
CodeRabbit Configuration File (.coderabbit.yaml)
- You can programmatically configure CodeRabbit by adding a
.coderabbit.yamlfile to the root of your repository. - Please see the configuration documentation for more information.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation:
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
Documentation and Community
- Visit our Documentation for detailed information on how to use CodeRabbit.
- Join our Discord Community to get help, request features, and share feedback.
- Follow us on X/Twitter for updates and announcements.
@qcgm1978 Hi! Just checking if you still want to continue with this project. Let me know if you have other thoughts! 😊
@qcgm1978 Hi! Just checking if you still want to continue with this project. Let me know if you have other thoughts! 😊
I haven't been following the project for a while now, so I don't recall well what the changes here are about, and it's possible the approach back then was inadequate. You should feel more confident to refine it.