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

Fix bug in file switching #4577

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Commits on Oct 26, 2024

  1. Fix bug in file switching

    Fixes All-Hands-AI#4576
    
    Add debounce mechanism to handle rapid file switching in the editor.
    
    * **frontend/src/context/files.tsx**
      - Import `debounce` from `lodash`.
      - Add `debouncedSetSelectedPath` to handle rapid file switching.
      - Update `value` to use `debouncedSetSelectedPath`.
    
    * **frontend/src/components/file-explorer/FileExplorer.tsx**
      - Import `debounce` from `lodash`.
      - Add `debouncedSetSelectedPath` to handle rapid file switching.
      - Update `FileExplorer` to use `debouncedSetSelectedPath`.
    
    * **frontend/src/routes/_oh.app._index/route.tsx**
      - Import `debounce` from `lodash`.
      - Add `debouncedSetSelectedPath` to handle rapid file switching.
      - Update `CodeEditor` to use `debouncedSetSelectedPath`.
    
    ---
    
    For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/All-Hands-AI/OpenHands/issues/4576?shareId=XXXX-XXXX-XXXX-XXXX).
    PierrunoYT committed Oct 26, 2024
    Configuration menu
    Copy the full SHA
    e9fa350 View commit details
    Browse the repository at this point in the history
  2. Add test cases for rapid file switching in FileExplorer

    * Enable previously skipped tests
    * Add test for rendering an empty workspace
    * Add test for uploading files by dragging them to the explorer
    * Add test for downloading a file
    * Add test for displaying correct file content when switching files quickly
    PierrunoYT committed Oct 26, 2024
    Configuration menu
    Copy the full SHA
    32a17ff View commit details
    Browse the repository at this point in the history