Skip to content

Conversation

@Popidge
Copy link
Contributor

@Popidge Popidge commented Jan 31, 2026

feat(workspace): add workspace file browser and markdown viewer

Add comprehensive workspace exploration functionality allowing users to browse and view files from the host filesystem. This feature enables inspection of AI agent workspace contents directly through the web interface.

Add workspace-fs library for safe file system operations with path validation

Create tRPC workspace router with directory listing and file reading endpoints

Implement workspace UI components with directory tree navigation

Add markdown file viewer with syntax highlighting

Configure Docker volume mounting for ~/.openclaw/workspace access

Update navigation with tab-based switching between Monitor and Workspace views.

Fix commits cover windows compatibility (note, not verified on actual windows, just unit-tested path handling logic), refresh behaviour and error-handling on refresh for deleted files.

Read-only MVP of issue #24

Primarily coded+reviewed with assistance from Kimi K2.5 in Kilo Code.

Tabbed multi-file view, search and CRUD will be worked on in future PRs.

Add comprehensive workspace exploration functionality allowing users to browse and view files from the host filesystem. This feature enables inspection of AI agent workspace contents directly through the web interface.

- Add workspace-fs library for safe file system operations with path validation
- Create tRPC workspace router with directory listing and file reading endpoints
- Implement workspace UI components with directory tree navigation
- Add markdown file viewer with syntax highlighting
- Configure Docker volume mounting for ~/.openclaw/workspace access
- Update navigation with tab-based switching between Monitor and Workspace views
Normalize path separators for consistent comparison across Windows and Unix systems. Fixes path traversal validation to handle backslash separators and corrects extension detection for dotfiles like .gitignore.

- Add normalizeForComparison helper to convert backslashes to forward slashes
- Fix isTextFile to properly handle files starting with dots
- Add getParentDirPath utility for cross-platform directory navigation
- Prevent false positives in path traversal detection on Windows
Fix file tree not properly resetting when refreshing workspace directory. Add useEffect hook to reset children state when entry path changes, preventing stale data display. Update handleRefresh to properly clear cache before reload and handle cases where selected files are deleted during refresh. Remove children.length check from loadChildren to allow directory re-expansion after refresh.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant