Skip to content

feat(config): add open_file_with_default_app option - #1613

Open
Longchuanzheng wants to merge 2 commits into
yorukot:mainfrom
Longchuanzheng:feat/open-file-with-default-app-config
Open

feat(config): add open_file_with_default_app option#1613
Longchuanzheng wants to merge 2 commits into
yorukot:mainfrom
Longchuanzheng:feat/open-file-with-default-app-config

Conversation

@Longchuanzheng

@Longchuanzheng Longchuanzheng commented Aug 5, 2026

Copy link
Copy Markdown

Add a new boolean config open_file_with_default_app (default: true) that controls whether pressing confirm (Enter/right/l) on a file launches the system default application (open/xdg-open/rundll32).

Set to false to disable launching external programs — the file is just selected and its preview shown. Directories are still entered, and the chooser mode is unaffected.

Summary by CodeRabbit

  • New Features
    • Added a configuration option to control whether selected files open with the system’s default application.
    • When disabled, files are selected and previewed without launching another application.
    • Directory navigation continues to work as before.
    • The option is enabled by default.

Add a new boolean config `open_file_with_default_app` (default: true)
that controls whether pressing confirm (Enter/right/l) on a file
launches the system default application (open/xdg-open/rundll32).

Set to false to disable launching external programs — the file is just
selected and its preview shown. Directories are still entered, and the
chooser mode is unaffected.

Co-Authored-By: Claude Opus 4.7 <[email protected]>
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

No new commits to review since the last review.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: decb3673-df86-41e4-a9b5-4ab3deeca8b7

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds OpenFileWithDefaultApp configuration. When disabled, confirming a file does not launch an external application. Directory navigation remains unchanged.

Changes

Default application file opening

Layer / File(s) Summary
Configurable file opening
src/internal/common/config_type.go, src/superfile_config/config.toml, src/internal/handle_panel_movement.go
Adds the open_file_with_default_app setting with a default value of true. The panel movement handler skips external file launches when the setting is disabled.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • yorukot/superfile#1197: Both PRs modify ConfigType and executeOpenCommand to control file-opening behavior, but implement distinct settings and logic.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely identifies the new configuration option, which is the primary change in the pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

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 current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/internal/handle_panel_movement.go`:
- Around line 67-71: Ensure executeOpenCommand enforces
common.Config.OpenFileWithDefaultApp before invoking the system opener,
returning without launching an external program when disabled. Keep the existing
enterPanel behavior intact and apply the guard at the command execution boundary
for all callers.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 20c61bfe-47e4-4057-9603-fef4d1a7e214

📥 Commits

Reviewing files that changed from the base of the PR and between a97381e and 3dac5b6.

📒 Files selected for processing (3)
  • src/internal/common/config_type.go
  • src/internal/handle_panel_movement.go
  • src/superfile_config/config.toml

Comment thread src/internal/handle_panel_movement.go Outdated
Move the OpenFileWithDefaultApp check from enterPanel into
executeOpenCommand so the guard applies at the system-opener execution
boundary for all callers, not just confirm-on-file. enterPanel behavior
is unchanged.

Co-Authored-By: Claude Opus 4.7 <[email protected]>
@Longchuanzheng

Copy link
Copy Markdown
Author

@coderabbitai help

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

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.
    • 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.
  • 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 the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

CodeRabbit commands

These commands are invoked using PR/Issue 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 rate limit to show your current review rate limit status.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai evaluate custom pre-merge check --instructions <custom-checks-instructions> --name <custom-checks-title> [--mode <error|warning>] to validate the custom pre-merge checks instructions. Defaults to error when --mode is omitted.
  • @coderabbitai ignore pre-merge checks to override pre-merge checks and get an approval on PR.
  • @coderabbitai run pre-merge checks to run pre-merge checks on the pull request.
  • @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 generate unit tests to generate unit tests for this PR.
  • @coderabbitai emit path instructions to emit generated path-specific review instructions for this repository.
  • @coderabbitai resolve merge conflict to automatically resolve merge conflicts.
  • @coderabbitai autofix to automatically fix issues identified in unresolved review comments.
  • @coderabbitai fix-ci to automatically fix failing CI checks in a stacked pull request.
  • @coderabbitai fix-ci commit to automatically fix failing CI checks by committing fixes to the current branch.
  • @coderabbitai resolve to resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai generate configuration to create a PR that adds the current resolved configuration as .coderabbit.yaml (or show it if already present).
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit 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.
  • You can also validate your configuration using the online YAML validator.
  • 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

Status, support, documentation and community

  • Visit our status page to check the current availability of CodeRabbit.
  • Create a ticket on our support page for assistance with any issues or questions.
  • Visit our documentation site for detailed information on how to use CodeRabbit.
  • Join our Discord community to connect with other users and get help from the community.
  • Follow us on X/Twitter for updates and announcements.

@Longchuanzheng

Copy link
Copy Markdown
Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Already reviewed.

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.

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.

1 participant