Skip to content

[FEATURE]:Add refresh Folder Tree #30661

Closed as not planned
Closed as not planned

Description

@DamThanQuy

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Feature Description

Currently, when a new file or folder is added to the workspace directly from the file system (or via external tools), the OpenCode Explorer/Folder Tree does not automatically detect and display the newly created items. Users have to manually close and reopen the workspace or restart the application to see the updates, which differs from the seamless real-time syncing behavior found in VS Code.

This feature requests adding a manual Refresh button/action to the Folder Tree, or implementing a file system watcher to automatically trigger a refresh when changes occur.

Expected Behavior

  • Manual Trigger: A "Refresh" icon/button should be added to the Explorer/Folder Tree toolbar. Clicking it should force-reload the current directory structure.
  • Context Menu: A "Refresh Explorer" option should be available in the right-click context menu of the workspace.
  • (Optional but Ideal) Auto-Sync: Ideally, implement a file system watcher (like chokidar or native FS events) to automatically update the tree view when files are added, deleted, or renamed outside of OpenCode.

Current Behavior / Steps to Reproduce

  1. Open a workspace folder in OpenCode.
  2. Open your terminal or OS File Explorer, and create a new file inside that workspace directory (e.g., touch new-file.ts).
  3. Look at the OpenCode Folder Tree -> The new-file.ts does not appear in the sidebar.
  4. (Current workaround) There is no way to force a refresh other than reloading the entire workspace window.

Proposed Solution (Tech Stack Context)

  • If handling manually: Add a click event to the Explorer toolbar that re-executes the file-tree fetching logic.
  • If handling automatically: Leverage a file system watcher within the backend/node layer to dispatch an event to the frontend state (React/TypeScript) whenever a file-system mutation is detected.

Additional Context

  • This feature will significantly improve DX (Developer Experience), especially when working with CLI code-generators or git checkouts that modify the file tree externally.
  • Behavior reference: VS Code's built-in file watcher and its "Refresh Explorer" button.

Activity

  1. github-actions commented on Jun 4, 2026

    @github-actions
    Contributor

    This issue doesn't fully meet our contributing guidelines.

    What needs to be fixed:

    • The description appears to be AI-generated (highly structured with multiple formatted sections, tech stack suggestions, and verbose prose). We ask that issues be written in your own words describing what you personally experienced or need.

    Please edit this issue to address the above within 2 hours, or it will be automatically closed.


    This issue might be a duplicate of existing issues. Please check:

    If you believe this was flagged incorrectly, please let a maintainer know.

  2. github-actions commented on Jun 4, 2026

    @github-actions
    Contributor

    This issue has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window.

    Feel free to open a new issue that follows our issue templates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions