Workflow
Opening a File from the UI
Flow from user clicking a file in explorer to content loaded from disk by Mountain and rendered in editor by Wind.
Opening a File from the UI
Details the flow from a user clicking a file in the File Explorer to the file’s content being loaded into an editor.
Data Flow
User clicks file in File Explorer
-> IEditorService.openEditor({ resource: fileUri })
-> TextEditorService resolves EditorInput
-> EditorGroupsService finds target editor group
-> TextFileEditorModel.load()
-> IFileService.readFile(fileUri)
-> TauriDiskFileSystemProvider.lookup(file: scheme)
-> ReadFile Effect executes
-> TauriInvoke('plugin:fs|ReadFile', { path: fileUri.fsPath })
-> Mountain: tokio::fs::read(path)
-> File content returned as Vec<u8>
-> Uint8Array returned up the chain
-> TextFileEditorModel hydrated
-> TextEditorPane created in editor group
-> Monaco editor receives text model
-> User sees file open in editorPhase 1: UI Interaction (Wind/Sky)
- User clicks a file
<div>in the File Explorer. TheonClickhandler knows the file’s URI. IEditorService.openEditor()is called with{ resource: fileUri }. The effect resolves the input into a concreteEditorInputviaTextEditorService, then finds the target editor group.
Phase 2: Editor and Filesystem Logic (Wind -> Mountain)
EditorGroupsServicechecks if the file is already open. If not, it callsEditorInput.resolve()to load the underlying model.TextFileEditorModel.load()needs file content. It callsIFileService.readFile(fileUri).IFileServicelooks up the provider for thefile:scheme and findsTauriDiskFileSystemProvider.TauriDiskFileSystemProvider.readFile()executes theReadFileEffect from the Tauri Integration layer:Effect.runPromise(ReadFile(fileUri)).- The
ReadFileEffect callsTauriInvoke('plugin:fs|ReadFile', { path: fileUri.fsPath }), sending the request from the webview to Mountain.
Phase 3: Native File I/O (Mountain)
- Tauri routes the command to
tauri-plugin-fs. The plugin performstokio::fs::read(path). - File content (
Vec<u8>) is read from disk, serialized, and returned as the promise resolution.
Phase 4: UI Rendering (Wind)
- The
TauriInvokepromise resolves with file content as aUint8Array. TextFileEditorModel.load()succeeds. The model is hydrated.EditorGroupsServicecreates aTextEditorPaneand sets theTextFileEditorModelon the Monaco editor instance.- Monaco renders the text content to screen.
Key Source Files
Wind/Source/Application/Editor/Definition.ts— editor serviceWind/Source/Application/FileSystem/Definition.ts— filesystem providerWind/Integration/Tauri/Wrap/ReadFile.ts— Tauri invoke effectMountain/src/main.rs— Tauri fs plugin
