Skip to content

Conversation

@haslinghuis
Copy link
Member

@haslinghuis haslinghuis commented May 20, 2025

Summary by CodeRabbit

  • New Features
    • The support request ID is now displayed in the output window after submitting support data.
    • When saving CLI output, the support request ID (if available) is included at the beginning of the saved file.

@haslinghuis haslinghuis added this to the 11.0 milestone May 20, 2025
@haslinghuis haslinghuis self-assigned this May 20, 2025
@haslinghuis haslinghuis moved this to App in 2025.12.0 May 20, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented May 20, 2025

"""

Walkthrough

A new property, lastSupportId, is introduced to the CLI object to store the support request identifier from the server. When saving CLI output to a file, the stored support ID, if present, is prepended to the saved content. The support ID is set asynchronously upon receiving a response from the server and displayed in the output window.

Changes

File(s) Change Summary
src/js/tabs/cli.js Added lastSupportId property to the cli object; updated save logic to prepend support ID to saved content.

Assessment against linked issues

Objective Addressed Explanation
Include the Support ID in the output when "Save to File" is used (#4482)
"""

📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between c3e0ebc and 5d5b6f0.

📒 Files selected for processing (1)
  • src/js/tabs/cli.js (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/js/tabs/cli.js
✨ 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.

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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (3)
src/js/tabs/cli.js (3)

106-109: Consider resetting lastSupportId when clearing history.

When the history is cleared, the lastSupportId is not reset. This could potentially lead to a situation where a saved file includes a support ID from a previous session that is unrelated to the current content.

Consider resetting lastSupportId when clearing history:

function clearHistory() {
    self.outputHistory = "";
    self.GUI.windowWrapper.empty();
+   self.lastSupportId = null;
}

238-240: Consider resetting lastSupportId when starting a new support request.

When submitting new support data, the history is cleared but lastSupportId isn't reset. While it will be overwritten when the new key is received, it's safer to reset it immediately when starting a new request to avoid potential issues if the API call fails.

Consider resetting lastSupportId when starting a new support request:

function submitSupportData(data) {
    clearHistory();
+   self.lastSupportId = null;
    const api = new BuildApi();

100-102: Reset lastSupportId during initialization.

The initialize function resets other CLI properties but doesn't reset lastSupportId. For consistency and to ensure a clean state when reopening the CLI tab, consider resetting lastSupportId here as well.

Consider adding reset for lastSupportId:

self.outputHistory = "";
self.cliBuffer = "";
self.startProcessing = false;
+ self.lastSupportId = null;
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 9f72b8a and c3e0ebc.

📒 Files selected for processing (1)
  • src/js/tabs/cli.js (3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: deploy
🔇 Additional comments (3)
src/js/tabs/cli.js (3)

29-29: Good addition of lastSupportId property.

Adding this property to store the support ID is a good approach for tracking the ID throughout the CLI session. The initialization to null correctly handles the case when no support ID is available.


214-220: Properly implemented support ID inclusion in saved files.

The implementation correctly checks if a support ID exists and prepends it to the file content before saving. This makes it easier for users to reference their support case when sharing log files.


251-251: Correctly stores the support ID for future use.

The code appropriately stores the returned key from the server in the lastSupportId property, making it available for the save functionality.

Co-authored-by: nerdCopter <[email protected]>
@sonarqubecloud
Copy link

@github-actions
Copy link
Contributor

Preview URL: https://5d5b6f09.betaflight-configurator.pages.dev

@haslinghuis haslinghuis requested a review from nerdCopter May 21, 2025 18:23
@haslinghuis haslinghuis merged commit 0349f3e into betaflight:master May 21, 2025
8 checks passed
@haslinghuis haslinghuis deleted the save-support-id branch May 21, 2025 21:08
@github-project-automation github-project-automation bot moved this from App to Done in 2025.12.0 May 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[feature request] when saving to file, a support id output, please include the supprt id.

4 participants