Skip to content

Conversation

@PeterDaveHello
Copy link
Member

@PeterDaveHello PeterDaveHello commented Jun 7, 2025

User description

Summary

  • expand the prompt for code explanation with more detailed guidance

Testing

  • npm ci
  • npm run lint

https://chatgpt.com/codex/tasks/task_e_684441aa5a5083279adf7f2e74f77485


PR Type

Enhancement


Description

  • Enhanced prompt instructions for all selection tools

    • Added expert roles and detailed guidance to prompts
    • Improved clarity and specificity for translation, summary, and code explanation
  • Refined web page summarization prompt for clarity


Changes walkthrough 📝

Relevant files
Enhancement
index.mjs
Refine web page summarization prompt for clarity                 

src/content-script/menu-tools/index.mjs

  • Improved the summarization prompt for web pages
  • Added expert role and clearer instructions for summaries
  • +1/-1     
    index.mjs
    Expand and clarify prompts for all selection tools             

    src/content-script/selection-tools/index.mjs

  • Enhanced all tool prompts with expert roles and detailed instructions
  • Improved translation prompt to specify tone, formatting, and
    bidirectional logic
  • Expanded code explanation prompt with step-by-step breakdown and
    design rationale
  • Clarified summary, sentiment, polish, divide, and ask prompts for
    better output
  • +14/-9   

    Need help?
  • Type /help how to ... in the comments thread for any questions about Qodo Merge usage.
  • Check out the documentation for more information.
  • Summary by CodeRabbit

    • New Features

      • Enhanced prompt instructions for content summarization, translation, explanation, polishing, sentiment analysis, paragraph division, code explanation, and question answering, resulting in more professional and focused responses.
      • Improved clarity and structure of prompts for summarizing academic papers, videos, articles, code repositories, and online discussions across multiple platforms.
    • Style

      • Updated prompts to provide clearer guidance and improved tone for generated content across various tools.

    @coderabbitai
    Copy link
    Contributor

    coderabbitai bot commented Jun 7, 2025

    Walkthrough

    The changes update prompt strings across multiple content generation and site adapter modules to be more explicit, detailed, and professional. Each prompt now clearly defines the role, expected output format, and focus areas for summarization, translation, explanation, or analysis tasks. No changes were made to exported entities, control flow, or error handling.

    Changes

    File(s) Change Summary
    src/content-script/menu-tools/index.mjs Revised the summarizePage prompt in genPrompt to provide more detailed and expert-level instructions.
    src/content-script/selection-tools/index.mjs Updated all prompts for translation, explanation, summary, polish, sentiment analysis, paragraph division, code explanation, and Q&A to be more explicit and professional.
    src/content-script/site-adapters/arxiv/index.mjs Expanded prompt for summarizing paper abstracts with structured academic analysis and labeled metadata.
    src/content-script/site-adapters/bilibili/index.mjs Changed prompt from concise Chinese to detailed English instructions for expert video summarization with markdown output.
    src/content-script/site-adapters/followin/index.mjs Rewrote prompt to English with explicit instructions for expert content summarization with markdown list of main points.
    src/content-script/site-adapters/github/index.mjs Expanded prompts for GitHub issues, PRs, and commit patches with detailed structured markdown instructions for summaries and commit messages.
    src/content-script/site-adapters/gitlab/index.mjs Enhanced prompts for file content analysis and git commit patches with detailed expert-level instructions and markdown formatting.
    src/content-script/site-adapters/juejin/index.mjs Changed prompt to English, requesting article and comment analysis with labeled fields and multiple output sections.
    src/content-script/site-adapters/quora/index.mjs Rewrote prompt to structured English format with explicit role and labeled question/answer sections for summary and opinion.
    src/content-script/site-adapters/reddit/index.mjs Revised prompt to clearer, segmented English format labeling title, description, and comments for expert forum analysis.
    src/content-script/site-adapters/stackoverflow/index.mjs Replaced informal prompt with detailed expert role and structured tasks for solution and overview with markdown formatting.
    src/content-script/site-adapters/weixin/index.mjs Changed prompt from segmented Chinese to continuous English with expert role and structured request for source, summary, conclusions, and opinion.
    src/content-script/site-adapters/youtube/index.mjs Updated prompt to English with expert video summarizer role, markdown format, and labeled video title and subtitle content.
    src/content-script/site-adapters/zhihu/index.mjs Translated and rephrased prompts from Chinese to English with clear labels and expert analyst role for Q&A content summary and opinion.

    Poem

    🐇
    With prompts refined and roles defined,
    Each task now clearer, well aligned.
    Summaries crisp, opinions bright,
    Translations polished, shining light.
    The rabbit hops with joyful cheer—
    For words made sharp and meaning clear! ✨

    Warning

    There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

    🔧 ESLint

    If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

    npm error Exit handler never called!
    npm error This is an error with npm itself. Please report this error at:
    npm error https://github.com/npm/cli/issues
    npm error A complete log of this run can be found in: /.npm/_logs/2025-06-08T08_24_28_448Z-debug-0.log


    📜 Recent review details

    Configuration used: CodeRabbit UI
    Review profile: CHILL
    Plan: Pro

    📥 Commits

    Reviewing files that changed from the base of the PR and between cda5ce2 and 021a7d5.

    📒 Files selected for processing (14)
    • src/content-script/menu-tools/index.mjs (1 hunks)
    • src/content-script/selection-tools/index.mjs (4 hunks)
    • src/content-script/site-adapters/arxiv/index.mjs (1 hunks)
    • src/content-script/site-adapters/bilibili/index.mjs (1 hunks)
    • src/content-script/site-adapters/followin/index.mjs (1 hunks)
    • src/content-script/site-adapters/github/index.mjs (2 hunks)
    • src/content-script/site-adapters/gitlab/index.mjs (1 hunks)
    • src/content-script/site-adapters/juejin/index.mjs (1 hunks)
    • src/content-script/site-adapters/quora/index.mjs (1 hunks)
    • src/content-script/site-adapters/reddit/index.mjs (1 hunks)
    • src/content-script/site-adapters/stackoverflow/index.mjs (1 hunks)
    • src/content-script/site-adapters/weixin/index.mjs (1 hunks)
    • src/content-script/site-adapters/youtube/index.mjs (1 hunks)
    • src/content-script/site-adapters/zhihu/index.mjs (2 hunks)
    ✅ Files skipped from review due to trivial changes (7)
    • src/content-script/site-adapters/quora/index.mjs
    • src/content-script/site-adapters/weixin/index.mjs
    • src/content-script/site-adapters/followin/index.mjs
    • src/content-script/site-adapters/zhihu/index.mjs
    • src/content-script/site-adapters/arxiv/index.mjs
    • src/content-script/site-adapters/youtube/index.mjs
    • src/content-script/site-adapters/reddit/index.mjs
    🚧 Files skipped from review as they are similar to previous changes (2)
    • src/content-script/menu-tools/index.mjs
    • src/content-script/selection-tools/index.mjs
    🔇 Additional comments (8)
    src/content-script/site-adapters/bilibili/index.mjs (1)

    61-64: Excellent prompt enhancement for video summarization.

    The updated prompt provides clear role definition, structured input format, and specific output requirements. This should significantly improve the quality of video summaries generated.

    src/content-script/site-adapters/juejin/index.mjs (1)

    24-29: Well-structured prompt improvement for content analysis.

    The enhanced prompt clearly defines the analyst role and provides structured input format with specific task requirements. The labeled sections and explicit output expectations should improve analysis quality.

    src/content-script/site-adapters/stackoverflow/index.mjs (1)

    17-26: Comprehensive prompt enhancement for technical Q&A analysis.

    The substantially improved prompt provides expert role definition, structured input sections, and detailed numbered tasks. The markdown formatting guidance and clear task separation should significantly improve the quality of technical problem analysis.

    src/content-script/site-adapters/gitlab/index.mjs (2)

    26-31: Excellent file analysis prompt enhancement.

    The updated prompt provides clear senior engineer role definition and comprehensive analysis requirements. The markdown formatting guidance and specific areas to cover (purpose, functionality, issues, improvements) should significantly improve code review quality.


    39-44: Professional git commit analysis prompt improvement.

    The enhanced prompt clearly defines expert role and provides structured tasks with specific requirements. The commit message convention guidance (50 char limit, imperative mood) and separation of commit message generation from change summary is well-designed.

    src/content-script/site-adapters/github/index.mjs (3)

    92-95: Excellent prompt enhancement for issue analysis.

    The improved prompt effectively establishes an expert role and provides clear, structured guidance for GitHub issue summarization. The inclusion of specific elements to identify (main problem, key discussion points, proposed solutions, current status) and the requirement for structured markdown format will significantly improve summary quality.


    98-101: Well-crafted PR analysis prompt with appropriate specialization.

    The enhanced prompt appropriately expands the expert role to include code review expertise and provides PR-specific guidance. The identification of proposed changes, review discussion points, and PR status examples (approved, needs changes, merged) makes this prompt highly effective for pull request summarization.


    162-167: Comprehensive enhancement for commit analysis with industry-standard guidance.

    The dramatically improved prompt establishes clear expertise and provides two well-defined tasks with detailed requirements. The inclusion of standard commit message conventions (imperative subject line, 50-character limit, explanatory body) and the emphasis on explaining both "what" and "why" of changes will generate significantly higher-quality commit messages and analysis.

    ✨ Finishing Touches
    • 📝 Generate Docstrings

    🪧 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.
      • Explain this complex logic.
      • Open a follow-up GitHub issue for this discussion.
    • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
      • @coderabbitai explain this code block.
      • @coderabbitai modularize this function.
    • PR comments: Tag @coderabbitai in 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 explain its main purpose.
      • @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.

    Support

    Need help? Create a ticket on our support page for assistance with any issues or questions.

    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 pause to pause the reviews on a PR.
    • @coderabbitai resume to resume the paused reviews.
    • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
    • @coderabbitai full review to do a full review from scratch and review all the files again.
    • @coderabbitai summary to regenerate the summary of the PR.
    • @coderabbitai generate docstrings to generate docstrings for this PR.
    • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
    • @coderabbitai resolve resolve all the CodeRabbit review comments.
    • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
    • @coderabbitai help to get help.

    Other keywords and placeholders

    • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
    • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
    • Add @coderabbitai anywhere in the PR title to generate the title automatically.

    CodeRabbit Configuration File (.coderabbit.yaml)

    • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file 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.

    @qodo-merge-pro
    Copy link
    Contributor

    qodo-merge-pro bot commented Jun 7, 2025

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Prompt Length

    The enhanced prompts are significantly longer than the original ones. Consider whether this might impact performance or user experience, especially for the code explanation prompt which is now quite detailed.

    message:
      'You are a senior software engineer and system architect. Break down the following code step by step, explain how each part works and why it was designed that way, note any potential issues, and summarize the overall purpose',
    includeLanguagePrefix: true,

    @qodo-merge-pro
    Copy link
    Contributor

    qodo-merge-pro bot commented Jun 7, 2025

    PR Code Suggestions ✨

    Latest suggestions up to cda5ce2

    CategorySuggestion                                                                                                                                    Impact
    General
    Use safer text delimiters

    The triple quotes (''') used for text delimitation might cause issues with
    certain content that contains triple quotes itself. Consider using a more unique
    delimiter or backticks to avoid potential parsing problems.

    src/content-script/selection-tools/index.mjs [36]

    -return `${prefix}${fullMessage}:\n'''\n${selection}\n'''`
    +return `${prefix}${fullMessage}:\n\`\`\`\n${selection}\n\`\`\``
    • Apply / Chat
    Suggestion importance[1-10]: 4

    __

    Why: Valid suggestion to prevent potential parsing issues when selected content contains triple quotes. However, this is a minor edge case improvement rather than a critical fix.

    Low
    General
    Add space after prefix

    Add a space after the prefix when it's not empty to ensure proper formatting
    between the language instruction and the following message. Without this space,
    text may run together when a prefix is present.

    src/content-script/selection-tools/index.mjs [35-36]

    -const prefix = includeLanguagePrefix ? `Reply in ${preferredLanguage}.` : ''
    +const prefix = includeLanguagePrefix ? `Reply in ${preferredLanguage}. ` : ''
     return `${prefix}${fullMessage}:\n'''\n${selection}\n'''`
    • Apply / Chat
    Suggestion importance[1-10]: 6

    __

    Why: The suggestion correctly identifies a formatting issue where the prefix would concatenate directly with fullMessage without proper spacing, creating awkward text flow. Adding a trailing space after the period improves readability when the prefix is present.

    Low
    • Update

    Previous suggestions

    Suggestions up to commit f198be7
    CategorySuggestion                                                                                                                                    Impact
    Incremental [*]
    Add language detection step

    The bidirectional translation logic should check if the text is already in the
    target language before attempting translation, but the current implementation
    doesn't include this verification step. This could lead to incorrect
    translations or unnecessary processing.

    src/content-script/selection-tools/index.mjs [33]

    -fullMessage += ` If the text is already in ${preferredLanguage}, translate it into English instead following the same requirements.`
    +fullMessage += ` First determine if the text is already in ${preferredLanguage}. If it is, translate it into English instead following the same requirements. Otherwise, proceed with the translation to ${preferredLanguage}.`
    Suggestion importance[1-10]: 4

    __

    Why: The suggestion proposes making the bidirectional translation prompt more explicit by adding language detection instructions. While this could potentially improve clarity, the current prompt already handles the conditional logic adequately, and AI models typically understand "if X then Y" logic without additional explicit steps.

    Low
    ✅ Suggestions up to commit 1bc643b
    CategorySuggestion                                                                                                                                    Impact
    Incremental [*]
    Fix inconsistent prompt formatting
    Suggestion Impact:The commit addressed the formatting issue identified in the suggestion, but used a different approach. Instead of just changing the space to a period, the entire sentence was reworded to improve clarity while still addressing the formatting concern.

    code diff:

    -      fullMessage += ` If it is already in ${preferredLanguage}, translate it into English and only show me the translated content.`
    +      fullMessage += ` If the text is already in ${preferredLanguage}, translate it into English instead following the same requirements.`

    The bidirectional translation instruction is appended with a space at the
    beginning, which creates inconsistent spacing when combined with the previous
    message. This could lead to formatting issues in the prompt.

    src/content-script/selection-tools/index.mjs [33]

    -fullMessage += ` If it is already in ${preferredLanguage}, translate it into English and only show me the translated content.`
    +fullMessage += `. If it is already in ${preferredLanguage}, translate it into English and only show me the translated content.`

    [Suggestion processed]

    Suggestion importance[1-10]: 7

    __

    Why: Valid formatting concern - using a period to connect sentences is grammatically correct, while the space creates awkward sentence flow. The change from period to space may have been unintentional.

    Medium
    Reduce prompt token usage

    The translation prompt is now much longer than before, which could lead to token
    usage inefficiency. Consider a more concise version that still conveys the key
    instructions.

    src/content-script/selection-tools/index.mjs [29-31]

     let fullMessage = isTranslation
    -  ? `You are a professional translator. Translate the following text into ${preferredLanguage}, preserving meaning, tone, and formatting. Only provide the translated result.`
    +  ? `Translate to ${preferredLanguage}, preserving meaning and formatting. Only show translation.`
       : message
    Suggestion importance[1-10]: 4

    __

    Why: While the suggestion is technically valid about token efficiency, it contradicts the PR's apparent intent to make prompts more detailed and professional. The original change seems deliberate to improve prompt quality.

    Low
    General
    Maintain consistent prompt style
    Suggestion Impact:The commit implemented the suggestion's intent by updating the bidirectional translation prompt to be more consistent with the professional translator style, though with slightly different wording than what was suggested

    code diff:

    -      fullMessage += ` If it is already in ${preferredLanguage}, translate it into English and only show me the translated content.`
    +      fullMessage += ` If the text is already in ${preferredLanguage}, translate it into English instead following the same requirements.`

    The bidirectional translation prompt is inconsistent with the new professional
    translator prompt style. Update it to match the tone and format of the main
    translation prompt for consistency.

    src/content-script/selection-tools/index.mjs [32-34]

     if (enableBidirectional) {
    -  fullMessage += ` If it is already in ${preferredLanguage}, translate it into English and only show me the translated content.`
    +  fullMessage += ` If the text is already in ${preferredLanguage}, translate it into English instead, preserving meaning, tone, and formatting. Only provide the translated result.`
     }

    [Suggestion processed]

    Suggestion importance[1-10]: 6

    __

    Why: The suggestion correctly identifies an inconsistency between the new professional translator prompt style and the bidirectional translation text. The improvement maintains consistent tone and terminology across related prompts, enhancing overall code quality.

    Low
    General
    Fix spacing in prompt construction

    There's a potential spacing issue when combining prefix and fullMessage. If
    prefix is not empty, there should be a space between it and fullMessage to
    ensure proper formatting of the prompt.

    src/content-script/selection-tools/index.mjs [35-36]

    -const prefix = includeLanguagePrefix ? `Reply in ${preferredLanguage}.` : ''
    +const prefix = includeLanguagePrefix ? `Reply in ${preferredLanguage}. ` : ''
     return `${prefix}${fullMessage}:\n'''\n${selection}\n'''`
    Suggestion importance[1-10]: 5

    __

    Why: Valid suggestion that fixes a minor spacing issue in prompt formatting. When prefix and fullMessage are concatenated, adding a space after the period improves readability of the generated prompt.

    Low
    ✅ Suggestions up to commit 6e0e6d5
    CategorySuggestion                                                                                                                                    Impact
    General
    Fix inconsistent punctuation
    Suggestion Impact:The commit implemented exactly the suggested changes, adding a period at the end of the first translation prompt and removing the period at the beginning of the bidirectional addition text

    code diff:

    -      ? `You are a professional translator. Translate the following text into ${preferredLanguage}, preserving meaning, tone, and formatting. Only provide the translated result`
    +      ? `You are a professional translator. Translate the following text into ${preferredLanguage}, preserving meaning, tone, and formatting. Only provide the translated result.`
           : message
         if (enableBidirectional) {
    -      fullMessage += `. If it is already in ${preferredLanguage}, translate it into English and only show me the translated content.`
    +      fullMessage += ` If it is already in ${preferredLanguage}, translate it into English and only show me the translated content.`

    The bidirectional translation logic has inconsistent formatting. The first
    translation prompt ends without a period, but the bidirectional addition
    includes one. This creates an awkward sentence structure when combined.

    src/content-script/selection-tools/index.mjs [29-34]

     fullMessage = isTranslation
    -  ? `You are a professional translator. Translate the following text into ${preferredLanguage}, preserving meaning, tone, and formatting. Only provide the translated result`
    +  ? `You are a professional translator. Translate the following text into ${preferredLanguage}, preserving meaning, tone, and formatting. Only provide the translated result.`
       : message
     if (enableBidirectional) {
    -  fullMessage += `. If it is already in ${preferredLanguage}, translate it into English and only show me the translated content.`
    +  fullMessage += ` If it is already in ${preferredLanguage}, translate it into English and only show me the translated content.`
     }
    Suggestion importance[1-10]: 4

    __

    Why: The suggestion correctly identifies a minor punctuation inconsistency that creates awkward sentence flow when enableBidirectional is true. While technically correct, this is a minor stylistic improvement with limited impact.

    Low

    @PeterDaveHello
    Copy link
    Member Author

    @coderabbitai, please give me a code suggestion patch based on Qodo's suggestion so that I can directly apply it.

    @coderabbitai
    Copy link
    Contributor

    coderabbitai bot commented Jun 7, 2025

    Tip

    For best results, initiate chat on the files or code changes.

    @PeterDaveHello, here's a patch based on Qodo's suggestion to fix the inconsistent punctuation in the bidirectional translation logic:

    diff --git a/src/content-script/selection-tools/index.mjs b/src/content-script/selection-tools/index.mjs
    index 1234567..abcdefg 100644
    --- a/src/content-script/selection-tools/index.mjs
    +++ b/src/content-script/selection-tools/index.mjs
    @@ -27,10 +27,10 @@ const configs = [
         genPrompt: async (selection) => {
           let fullMessage = isTranslation
    -        ? `You are a professional translator. Translate the following text into ${preferredLanguage}, preserving meaning, tone, and formatting. Only provide the translated result`
    +        ? `You are a professional translator. Translate the following text into ${preferredLanguage}, preserving meaning, tone, and formatting. Only provide the translated result.`
             : message
           if (enableBidirectional) {
    -        fullMessage += `. If it is already in ${preferredLanguage}, translate it into English and only show me the translated content.`
    +        fullMessage += ` If it is already in ${preferredLanguage}, translate it into English and only show me the translated content.`
           }
           return fullMessage + ':\n\n' + selection
         },

    You can save this as a .patch file and apply it using git apply filename.patch or copy the changes directly to your file.

    🐰📝
    Hopping along with proper punctuation patches!

    @PeterDaveHello PeterDaveHello requested a review from Copilot June 7, 2025 18:48

    This comment was marked as outdated.

    @PeterDaveHello
    Copy link
    Member Author

    @coderabbitai use PR Review function with suggestion block for the patch.

    @coderabbitai
    Copy link
    Contributor

    coderabbitai bot commented Jun 7, 2025

    Tip

    For best results, initiate chat on the files or code changes.

    @PeterDaveHello, here's the punctuation fix in a proper suggestion block format:

    src/content-script/selection-tools/index.mjs

          let fullMessage = isTranslation
            ? `You are a professional translator. Translate the following text into ${preferredLanguage}, preserving meaning, tone, and formatting. Only provide the translated result.`
            : message
          if (enableBidirectional) {
            fullMessage += ` If it is already in ${preferredLanguage}, translate it into English and only show me the translated content.`
          }
    

    This fixes the inconsistent punctuation by:

    1. Adding a period to the end of the translation prompt
    2. Removing the redundant period at the start of the bidirectional addition

    This ensures proper sentence flow when both parts are combined.

    @PeterDaveHello PeterDaveHello changed the title Refine code explanation prompt Refine built-in prompts Jun 7, 2025
    @PeterDaveHello
    Copy link
    Member Author

    I spent several hours teaching Codex how to improve the prompt, but I didn’t expect it wouldn’t even know how to name the title and branch... It seems I still have to manually revise everything to save trouble.

    @PeterDaveHello
    Copy link
    Member Author

    @coderabbitai, can you create a commit in the current branch based on Qodo's suggestion? I believe that's something you can do.

    @coderabbitai
    Copy link
    Contributor

    coderabbitai bot commented Jun 7, 2025

    Tip

    For best results, initiate chat on the files or code changes.

    @PeterDaveHello, I understand your request, but I'm not able to directly commit code to the repository. However, I can plan the code changes based on Qodo's suggestion, and another agent will execute the actual commit for you.

    Task: Fix punctuation inconsistency in bidirectional translation logic

    • Apply Qodo's suggestion to fix inconsistent punctuation in the translation prompts
    • Add period to translation prompt and remove redundant period from bidirectional addition

    The planning agent will now create a commit with this punctuation fix. This ensures proper sentence flow when the translation and bidirectional prompts are combined.


    ⏳ Preparing changes...

    @coderabbitai
    Copy link
    Contributor

    coderabbitai bot commented Jun 7, 2025

    A summary of the edits CodeRabbit can apply:

    Will apply punctuation fixes to the bidirectional translation logic in src/content-script/selection-tools/index.mjs

    A plan of each step that CodeRabbit will take in order to execute the edits for each file (with inline rough draft snippets):

    ✏️ src/content-script/selection-tools/index.mjs

    Locate the ternary assignment of fullMessage at line 29. Replace the branch for isTranslation to include a trailing period. Use this suggestion block:

          let fullMessage = isTranslation
            ? `You are a professional translator. Translate the following text into ${preferredLanguage}, preserving meaning, tone, and formatting. Only provide the translated result.`
            : message
    

    Locate the enableBidirectional concatenation at line 32. Remove the leading period before "If" so that the sentence flows correctly. Use this suggestion block:

          if (enableBidirectional) {
            fullMessage += ` If it is already in ${preferredLanguage}, translate it into English and only show me the translated content.`
          }
    
    • ✅ Create PR with these edits
    • 📌 Create commit in current branch
    • 📋 Get copyable edits

    @PeterDaveHello PeterDaveHello requested a review from Copilot June 7, 2025 19:36

    This comment was marked as outdated.

    @PeterDaveHello
    Copy link
    Member Author

    @coderabbitai review

    @coderabbitai
    Copy link
    Contributor

    coderabbitai bot commented Jun 7, 2025

    ✅ 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.

    @PeterDaveHello
    Copy link
    Member Author

    The built-in prompts under src/content-script/site-adapters/ haven't been handled, and Codex can't detect the changes we make here. In the end, I still have to go back to local to take care of all this...lol

    @PeterDaveHello PeterDaveHello force-pushed the codex/強化內建-prompt-使用技巧 branch from cda5ce2 to 021a7d5 Compare June 8, 2025 08:23
    @PeterDaveHello PeterDaveHello requested a review from Copilot June 8, 2025 08:23
    Copy link

    Copilot AI left a comment

    Choose a reason for hiding this comment

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

    Pull Request Overview

    This PR refines and expands the prompt instructions used across various content and selection tools to provide more detailed, role-based guidance for content analysis and summarization. Key changes include:

    • Conversion of prompts from Chinese to detailed English instructions with expert roles.
    • Enhanced clarity and structure in prompts for Q&A, video, article, commit, and forum content analysis.
    • Consistent formatting improvements across all site adapter and selection tool modules.

    Reviewed Changes

    Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.

    Show a summary per file
    File Description
    src/content-script/site-adapters/zhihu/index.mjs Updated Zhihu Q&A prompts for clear analysis and summary output.
    src/content-script/site-adapters/youtube/index.mjs Refined YouTube video summarizing prompt with structured format.
    src/content-script/site-adapters/weixin/index.mjs Enhanced WeChat article analysis with detailed role instructions.
    src/content-script/site-adapters/stackoverflow/index.mjs Expanded Stack Overflow Q&A prompt for solution and overview.
    src/content-script/site-adapters/reddit/index.mjs Improved Reddit discussion analysis prompt with clear format.
    src/content-script/site-adapters/quora/index.mjs Clarified Quora Q&A discussion prompt with expert guidance.
    src/content-script/site-adapters/juejin/index.mjs Revised Juejin article analysis prompt with commentary summary.
    src/content-script/site-adapters/gitlab/index.mjs Enhanced GitLab file and commit analysis prompts with detailed tasks.
    src/content-script/site-adapters/github/index.mjs Updated GitHub issue/PR discussion prompts and commit message guidance.
    src/content-script/site-adapters/followin/index.mjs Improved prompt for article and long tweet summarization.
    src/content-script/site-adapters/bilibili/index.mjs Refined Bilibili video summarizing prompt with markdown formatting.
    src/content-script/site-adapters/arxiv/index.mjs Upgraded arXiv paper abstract analysis prompt with academic tone.
    src/content-script/selection-tools/index.mjs Broadened prompt functions for translation, explanation, and summarization.
    src/content-script/menu-tools/index.mjs Updated web page summarization prompt to provide expert analysis.
    Comments suppressed due to low confidence (1)

    src/content-script/site-adapters/juejin/index.mjs:21

    • If the variable 'comment' holds multiple comment elements, consider renaming it to 'comments' to better reflect its content. Additionally, ensure that if 'comment' is an array, it is properly joined or formatted before being injected into the prompt.
    comment += `answer${i}: ${comment[i - 1].textContent}|`
    

    @PeterDaveHello PeterDaveHello merged commit 46f2b1d into master Jun 8, 2025
    2 checks passed
    @PeterDaveHello PeterDaveHello deleted the codex/強化內建-prompt-使用技巧 branch June 8, 2025 09:24
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Projects

    None yet

    Development

    Successfully merging this pull request may close these issues.

    2 participants