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

update some formatting, add 'default widgets' and remote shell widgets section for custom widgets doc #1837

Merged
merged 2 commits into from
Jan 24, 2025

Conversation

sawka
Copy link
Member

@sawka sawka commented Jan 24, 2025

No description provided.

Copy link
Contributor

coderabbitai bot commented Jan 24, 2025

Walkthrough

The pull request introduces structural changes to the customwidgets.mdx documentation file, focusing on improving the organization and clarity of content related to custom widgets. The modifications include adjusting heading levels, renaming existing sections, and adding new sections to provide more comprehensive guidance.

Key changes involve restructuring the hierarchy of sections such as "Terminal and CLI Widgets," introducing a new "Example Remote Shell Widgets" section, and adding an "Overriding Default Widgets" section. The document now provides more detailed explanations about different types of widgets, including local and remote shell widgets, with a clearer navigation structure.

The updates aim to enhance the readability and comprehensiveness of the documentation, making it easier for users to understand the various widget configurations and customization options available in the system.


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?

❤️ Share
🪧 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 @coderabbitai in 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 @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 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 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. (Beta)
  • @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.

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 (2)
docs/docs/customwidgets.mdx (2)

175-195: Consider enhancing the remote shell widgets documentation.

While the new section is valuable, consider these improvements:

  1. Add specific examples of connection names (e.g., "ssh://user@host" or "wsl://Ubuntu").
  2. Include a reference to where users can find their connection names in the UI or connections.json.
 If you want to open a terminal widget for a particular connection (SSH or WSL), you can use the `connection` meta key. The connection key's value should match connections.json (or what's in your connections dropdown menu). Note that you should only use the canonical name (do not use any custom "display:name" that you've set).

 ```json
 {
 	<... other widgets go here ...>,
 	"remote-term": {
 		"icon": "rectangle-terminal",
 		"label": "remote",
 		"blockdef": {
 			"meta": {
 				"view": "term",
 				"controller": "shell",
-				"connection": "<connection>"
+				"connection": "ssh://user@example.com"  // Example: Use your SSH connection name
 			}
 		}
 	},
 	<... other widgets go here ...>
 }

+For example:
+- SSH connection: "connection": "ssh://user@example.com"
+- WSL connection: "connection": "wsl://Ubuntu-20.04"
+
+You can find your available connection names in the Wave Terminal's connection dropdown menu or in <WAVETERM_HOME>/config/connections.json.


---

`407-419`: **Consider enhancing the default widgets documentation.**

While the new section is valuable, consider these improvements:
1. Add an example of removing or modifying a default widget.
2. Make the GitHub link more specific by pointing to the exact line numbers.

```diff
 To remove any of them, just set that key to `null` in your widgets.json file.

+For example, to remove the AI widget:
+```json
+{
+    "defwidget@ai": null
+}
+```
+
+Or to modify the terminal widget's icon:
+```json
+{
+    "defwidget@terminal": {
+        "icon": "code",
+        "label": "term"
+    }
+}
+```
+
 To see their definitions, to copy/paste them, or to understand how they work, you can view all of their definitions on [GitHub - default widgets.json](https://github.com/wavetermdev/waveterm/blob/main/pkg/wconfig/defaultconfig/widgets.json)
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 7bad4b3 and f963f80.

📒 Files selected for processing (1)
  • docs/docs/customwidgets.mdx (9 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (5)
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Build Docsite
  • GitHub Check: Analyze (go)
  • GitHub Check: merge-gatekeeper
  • GitHub Check: Build for TestDriver.ai
🔇 Additional comments (3)
docs/docs/customwidgets.mdx (3)

Line range hint 69-83: LGTM! Improved document structure.

The heading level adjustment enhances the document hierarchy and makes it more consistent.

🧰 Tools
🪛 LanguageTool

[style] ~67-~67: Consider removing “of” to be more concise
Context: ...ed in blue in the image). This contains all of the details about how the widget actually w...

(ALL_OF_THE)


Line range hint 252-281: LGTM! Improved document structure.

The heading level adjustment enhances the document hierarchy and makes it more consistent.


Line range hint 329-406: LGTM! Improved document structure.

The heading level adjustment enhances the document hierarchy and makes it more consistent.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~356-~356: ‘Amount of’ should usually only be used with uncountable or mass nouns. Consider using “number” if this is not the case.
Context: ...o"`.| | "graph:numpoints" | The maximum amount of points that can be shown on the grap...

(AMOUNTOF_TO_NUMBEROF)


[misspelling] ~357-~357: This word is normally spelled with a hyphen.
Context: ...m", and All CPU`. Note that these are case sensitive. If no value is provided, the plot will...

(EN_COMPOUNDS_CASE_SENSITIVE)


[uncategorized] ~361-~361: Use a comma before ‘and’ if it connects two independent clauses (unless they are closely connected and short).
Context: ...ave a build process that lasts 3 minutes and you'd like to be able to see the entire...

(COMMA_COMPOUND_SENTENCE)

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 (4)
docs/docs/customwidgets.mdx (4)

175-195: Add more context about connection names and validation.

The section provides good information but could be enhanced with:

  1. A note about how to verify the correct connection name format
  2. An example of both SSH and WSL connection strings

Apply this diff to enhance the explanation:

 If you want to open a terminal widget for a particular connection (SSH or WSL), you can use the `connection` meta key. The connection key's value should match connections.json (or what's in your connections dropdown menu). Note that you should only use the canonical name (do not use any custom "display:name" that you've set). For WSL that might look like `wsl://Ubuntu`, and for SSH connections that might look like `user@remotehostname`.

+You can verify your connection names by:
+1. Checking the connections dropdown menu in Wave
+2. Looking at your `connections.json` file
+
+Example connection strings:
+- WSL: `wsl://Ubuntu-20.04`
+- SSH: `admin@prod-server.example.com`
🧰 Tools
🪛 LanguageTool

[typographical] ~177-~177: It is considered good style to insert a comma after introductory phrases with dates or proper nouns.
Context: ...om "display:name" that you've set). For WSL that might look like wsl://Ubuntu, an...

(IN_NNP_COMMA)


407-419: Add a practical example of overriding a default widget.

The section clearly explains how to override default widgets but would benefit from a concrete example.

Add this example after the GitHub link:

 To see their definitions, to copy/paste them, or to understand how they work, you can view all of their definitions on [GitHub - default widgets.json](https://github.com/wavetermdev/waveterm/blob/main/pkg/wconfig/defaultconfig/widgets.json)

+For example, to remove the AI widget and modify the terminal widget's icon:
+
+```json
+{
+    "defwidget@ai": null,
+    "defwidget@terminal": {
+        "icon": "code",
+        "label": "term",
+        "blockdef": {
+            "meta": {
+                "view": "term",
+                "controller": "shell"
+            }
+        }
+    }
+}
+```

177-177: Add a comma after the introductory phrase.

For better readability, add a comma after "For WSL".

Apply this diff:

-For WSL that might look like `wsl://Ubuntu`, and for SSH connections that might look like `user@remotehostname`.
+For WSL, that might look like `wsl://Ubuntu`, and for SSH connections that might look like `user@remotehostname`.
🧰 Tools
🪛 LanguageTool

[typographical] ~177-~177: It is considered good style to insert a comma after introductory phrases with dates or proper nouns.
Context: ...om "display:name" that you've set). For WSL that might look like wsl://Ubuntu, an...

(IN_NNP_COMMA)


187-190: Consider adding explanatory comments in the JSON example.

The JSON example would be more helpful with comments explaining each field's purpose.

Apply this diff:

 			"meta": {
 				"view": "term",
 				"controller": "shell",
-				"connection": "<connection>"
+				"connection": "<connection>" // e.g., "wsl://Ubuntu" or "user@remotehostname"
 			}
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between f963f80 and 805f0a9.

📒 Files selected for processing (1)
  • docs/docs/customwidgets.mdx (9 hunks)
🧰 Additional context used
🪛 LanguageTool
docs/docs/customwidgets.mdx

[typographical] ~177-~177: It is considered good style to insert a comma after introductory phrases with dates or proper nouns.
Context: ...om "display:name" that you've set). For WSL that might look like wsl://Ubuntu, an...

(IN_NNP_COMMA)

⏰ Context from checks skipped due to timeout of 90000ms (5)
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Build Docsite
  • GitHub Check: merge-gatekeeper
  • GitHub Check: Analyze (go)
  • GitHub Check: Build for TestDriver.ai
🔇 Additional comments (1)
docs/docs/customwidgets.mdx (1)

69-69: LGTM! The heading level adjustments improve document hierarchy.

The restructuring creates a more logical flow and better organization of content.

Also applies to: 113-113, 175-175, 252-252, 329-329, 359-359

@sawka sawka merged commit 4035974 into main Jan 24, 2025
10 checks passed
@sawka sawka deleted the sawka/docs-v11 branch January 24, 2025 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant