Skip to content

[Bug]: Editor shows empty content for opened files on Windows #26

@matiaspalmac

Description

@matiaspalmac

Describe the bug

The model cleanup effect introduced in apps/desktop/src/components/EditorArea.tsx (commit 0efec72e, "imp: CPU & Ram optimization") disposes Monaco models that should remain active.

On Windows, paths stored in openFiles use backslashes (e.g. C:\Proyectos\ide\package.json), while Monaco model URIs normalize to forward slashes and encode the drive letter. The current matching with === against model.uri.fsPath / model.uri.path or modelPath.endsWith(f.path) never matches, so every model is treated as "not in openFiles" and disposed — including the model that was just created for the file being opened. The editor then renders against a disposed model, which shows as empty content.

Additional notes:

  • The local variable openPaths is created but never referenced.
  • Dep array [openFiles, currentFile] causes extra runs on tab switches.

Steps to Reproduce

  1. Open the app on Windows (pnpm desktop).
  2. Open any folder via File → Open Folder.
  3. Click any file in the explorer (e.g. package.json).
  4. The tab appears at the top but the editor area stays blank.
  5. Repeat with any other file — same result.

Trixty Version

v1.0.8 (main @ 50923f8)

OS

Windows

Fix yourself?

Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions