Opening Files and Folders
Navigate your project by sailing to files and folders and interacting with them.Approach an Object
Sail your boat toward any file or folder object in the world:
- Folder objects: Represented by folder 3D models
- File objects: Represented by file 3D models
- Collision detection activates when you get close enough
src/browser/hooks/useNode/shortcuts/index.ts:23-29.Open with Keyboard Shortcut
While colliding with an object, use a keyboard shortcut to open it:
- Shift + Enter: Open the file or explore the folder
- The shortcut is throttled to 500ms to prevent accidental double-opens
src/browser/hooks/useNode/shortcuts/index.ts:75-86 and src/browser/config/index.ts:11-15.File vs Folder Behavior
The system handles files and folders differently:
- Files (
type: "file"): Sends anopen_filecommand to VS Code - Folders (
type: "folder"): Updates the current path to show folder contents
src/browser/hooks/useNode/shortcuts/index.ts:34-42 and src/extension/handlers/openFile/index.ts:4-9.Navigating Directories
Move through your project’s folder structure efficiently.Enter a Directory
To explore a folder:
- Sail your boat to a folder object
- Wait until you’re in collision range
- Press Shift + Enter
- The world updates to show the folder’s contents
src/extension/handlers/readDirectory/index.ts:10-36.Go Back One Directory
Press Escape to navigate up one directory level:
- Returns you to the parent folder
- Throttled to 500ms to prevent accidental navigation
- Won’t go above the base project folder
src/browser/hooks/useNode/shortcuts/index.ts:49-62 and src/browser/hooks/useNode/shortcuts/index.ts:70-73.Jump to Any Parent Directory
Use breadcrumbs to jump directly to any parent folder:
- Click on any folder name in the breadcrumb path
- Instantly navigate to that directory without sailing
- Useful for moving up several levels at once
Reading Directory Contents
Understand how Gitlantis loads and displays your project structure.Directory Loading Process
When you navigate to a folder, Gitlantis:
- Reads the directory using VS Code’s file system API
- Identifies the folder URI and label
- Retrieves all entries (files and folders)
- Categorizes each entry by type
src/extension/handlers/readDirectory/index.ts:6-16.Understanding File Types
Each entry is categorized as:
- Folder (
type: "folder"): Directories you can explore - File (
type: "file"): Files you can open - Unknown (
type: "unknown"): Other file system entries - Symlink flag (
isSymlink: boolean): Whether the entry is a symbolic link
src/extension/handlers/readDirectory/index.ts:18-28.Keyboard Shortcuts Reference
All available keyboard shortcuts for file and folder management.Shift + Enter
Open file or explore folder (when colliding with object)
Escape
Go back one directory level
H
Sound the boat horn (no file operation)
Shortcut Key Detection
Gitlantis uses a key tracking system for reliable shortcut detection:Key Tracking
The system maintains a set of currently pressed keys:
- Keys are added to the set on
keydownevents - Keys are removed from the set on
keyupevents - The set is cleared when the window loses focus
src/browser/hooks/useNode/shortcuts/index.ts:21 and src/browser/hooks/useNode/shortcuts/index.ts:91-92.Combination Detection
For shortcuts with multiple keys (like Shift + Enter):All required keys must be in the pressed set simultaneously. See
src/browser/hooks/useNode/shortcuts/index.ts:76-78.Throttling
File/folder operations are throttled to 500ms:
- Prevents accidental double-opening
- Uses trailing: false to trigger immediately
- Independent throttles for “open” and “go back” actions
src/browser/hooks/useNode/shortcuts/index.ts:31-46 and src/browser/hooks/useNode/shortcuts/index.ts:49-62.File Opening Details
How File Opening Works
How File Opening Works
When you open a file:
- Your browser sends a message to the VS Code extension
- The extension receives the
open_filecommand with the file path - VS Code creates a URI from the file path
- VS Code opens the file in a text editor
src/extension/handlers/openFile/index.ts:3-10.Error Handling
Error Handling
If a file can’t be opened:This typically happens when:
- The file path is invalid
- The file has been deleted or moved
- There are permission issues
src/extension/handlers/openFile/index.ts:8.Collision State Management
Collision State Management
Gitlantis tracks collisions using a ref array:
- Each index corresponds to a node (file/folder)
truemeans the boat is colliding with that node- The first colliding node is selected when you press a shortcut
src/browser/hooks/useNode/shortcuts/index.ts:13 and src/browser/hooks/useNode/shortcuts/index.ts:23-29.Tips for Efficient File Management
- Use shortcuts: Memorize Shift+Enter and Escape for fast navigation
- Watch breadcrumbs: Always know where you are in the project structure
- Sail close: Make sure you’re in collision range before trying shortcuts
- Use the minimap: Quickly locate folders in large projects
- Go back with Escape: Faster than sailing back to the parent folder icon