Skip to content

break out wsh editor and clarify behavior. also document -m flag...#2988

Open
sawka wants to merge 1 commit intomainfrom
sawka/update-docs
Open

break out wsh editor and clarify behavior. also document -m flag...#2988
sawka wants to merge 1 commit intomainfrom
sawka/update-docs

Conversation

@sawka
Copy link
Member

@sawka sawka commented Mar 5, 2026

fix documentation issue #2948

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 5, 2026

Walkthrough

Documentation updates to wsh-reference.mdx restructure command descriptions for WSH view and edit commands. Added magnified-block aliases for both view and edit commands (-m flag). Distinguished between two separate commands: wsh edit (opens codeedit block and returns immediately) and wsh editor (blocks until editor closes). Introduced new dedicated editor command section with guidance on configuring the $EDITOR environment variable and clarified that files must exist before editing. Changes total +22/-1 lines.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately captures the main changes: breaking out wsh editor command, clarifying its behavior, and documenting the -m flag for magnified blocks.
Description check ✅ Passed The description references a documentation issue (#2948) that the PR aims to fix, which is related to the changeset's documentation updates.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch sawka/update-docs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@kilo-code-bot
Copy link
Contributor

kilo-code-bot bot commented Mar 5, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

The documentation changes in this PR are accurate and well-structured. The changes:

  1. Add -m flag documentation for wsh view command (line 26)
  2. Add -m flag documentation for wsh edit command (line 38)
  3. Update wsh edit description to clarify it returns immediately after opening the block (lines 41-43)
  4. Add new wsh editor section documenting the blocking editor command (lines 47-60)

The documentation correctly reflects the actual implementation:

  • wsh view -m [path] - opens in magnified mode (verified in cmd/wsh/cmd/wshcmd-view.go:37)
  • wsh edit -m [path] - opens in magnified mode (verified in cmd/wsh/cmd/wshcmd-view.go:39)
  • wsh editor -m [path] - opens in magnified mode and blocks until closed (verified in cmd/wsh/cmd/wshcmd-editor.go:29,72)
Files Reviewed (1 file)
  • docs/docs/wsh-reference.mdx

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: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/docs/wsh-reference.mdx`:
- Line 43: The sentence "blocks until the file is closed" is imprecise; update
the docs entry for `wsh editor` to state that the command blocks until the
editor block is closed (i.e., until the `Event_BlockClose` is received),
matching the implementation in `cmd/wsh/cmd/wshcmd-editor.go` where the code
waits on `Event_BlockClose` (around the wait in lines ~82-89). Mention `wsh
editor` and `Event_BlockClose` explicitly so readers understand the blocking
condition maps to the editor block lifecycle rather than the OS file handle.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: fa8abec8-e805-4195-a0be-8e1aedf935fb

📥 Commits

Reviewing files that changed from the base of the PR and between f59fdb5 and 8df9913.

📒 Files selected for processing (1)
  • docs/docs/wsh-reference.mdx

This will open up codeedit for the specified file. This is useful for quickly editing files on a local or remote machine in our graphical editor. This command will wait until the file is closed before exiting (unlike `view`) so you can set your `$EDITOR` to `wsh editor` for a seamless experience. You can combine this with a `-m` flag to open the editor in magnified mode.
This will open up a codeedit block for the specified file. This is useful for quickly editing files on a local or remote machine in Wave's graphical editor. This command returns immediately after opening the block.

For `$EDITOR` integration (e.g. with `git commit`), see [`wsh editor`](#editor) which blocks until the file is closed.
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Tighten wording on blocking condition (Line [43]).

“Blocks until the file is closed” is slightly imprecise. The implementation blocks until the editor block is closed (cmd/wsh/cmd/wshcmd-editor.go, Lines 82-89 waiting on Event_BlockClose).

✏️ Suggested wording tweak
-For `$EDITOR` integration (e.g. with `git commit`), see [`wsh editor`](`#editor`) which blocks until the file is closed.
+For `$EDITOR` integration (e.g. with `git commit`), see [`wsh editor`](`#editor`) which blocks until the editor block is closed.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
For `$EDITOR` integration (e.g. with `git commit`), see [`wsh editor`](#editor) which blocks until the file is closed.
For `$EDITOR` integration (e.g. with `git commit`), see [`wsh editor`](`#editor`) which blocks until the editor block is closed.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/docs/wsh-reference.mdx` at line 43, The sentence "blocks until the file
is closed" is imprecise; update the docs entry for `wsh editor` to state that
the command blocks until the editor block is closed (i.e., until the
`Event_BlockClose` is received), matching the implementation in
`cmd/wsh/cmd/wshcmd-editor.go` where the code waits on `Event_BlockClose`
(around the wait in lines ~82-89). Mention `wsh editor` and `Event_BlockClose`
explicitly so readers understand the blocking condition maps to the editor block
lifecycle rather than the OS file handle.

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