Skip to content

feat: File Explorer & File Operations (Issue #6)#11

Merged
suda merged 3 commits intomainfrom
feature/6-file-operations
Mar 9, 2026
Merged

feat: File Explorer & File Operations (Issue #6)#11
suda merged 3 commits intomainfrom
feature/6-file-operations

Conversation

@ada-evorada
Copy link

Summary

Implements file browsing and basic file operations for the Claude Code Mattermost plugin.

Changes

  • ✅ Added /claude-files command to browse project files
  • ✅ Added /claude-new-file command to create new files
  • ✅ Implemented file action menu (view, edit, delete)
  • ✅ View file content with syntax highlighting
  • ✅ Delete files with confirmation
  • ✅ Extended BridgeClient with file operation methods
  • ✅ Registered HTTP endpoints for file actions
  • ✅ Updated help command with file operation documentation

Bridge Server

File API endpoints were already implemented in Issue #3:

  • GET /api/sessions/:id/files - List files
  • GET /api/sessions/:id/files/:path - Get file content
  • POST /api/sessions/:id/files - Create file
  • PUT /api/sessions/:id/files/:path - Update file
  • DELETE /api/sessions/:id/files/:path - Delete file

Implementation Notes

  • File browser displays up to 20 files in interactive message format
  • File content is displayed in code blocks with syntax highlighting
  • Large files are truncated to fit Mattermost message limits
  • Edit functionality shows guidance (full interactive editing deferred to Issue Interactive Message Components #5)
  • All file paths validated to prevent directory traversal
  • Mobile-friendly button-based interface

Testing

  • Code compiles successfully
  • Manual testing with Mattermost instance (requires deployment)
  • File browsing works
  • File viewing displays content correctly
  • File creation works
  • File deletion works with confirmation

Closes

#6

Related Issues

Ada added 2 commits March 9, 2026 21:22
- Add file_operations.go with file browser and action handlers
- Implement /claude-files command to browse project files
- Implement /claude-new-file command to create files
- Add file action menu (view, edit, delete)
- View file content with syntax highlighting
- Delete files with confirmation
- Extend BridgeClient with file operation methods
- Register HTTP endpoints for file actions
- Update help command with file operation docs

Bridge server endpoints already implemented in Issue #3.
Full interactive editing deferred to Issue #5.
- Remove duplicate ServeHTTP handler from plugin.go
- Remove duplicate getPluginURL implementation
- Keep unified handlers from actions.go/post_utils.go

Verified with make test (backend + frontend passing).
@ada-evorada ada-evorada force-pushed the feature/6-file-operations branch from 8ba3ad1 to 65a5a9f Compare March 9, 2026 21:23
@ada-evorada
Copy link
Author

Rebased on latest \ and resolved conflicts. I also fixed duplicate handler methods introduced during rebase (\ and ), then ran full test suite via \ (backend + frontend both passing).

@ada-evorada
Copy link
Author

Rebased on latest main and resolved conflicts. Also fixed duplicate handler methods introduced during rebase (ServeHTTP and getPluginURL), then ran full test suite with make test (backend + frontend both passing).

@suda suda merged commit 6d7d254 into main Mar 9, 2026
5 checks passed
@suda suda deleted the feature/6-file-operations branch March 9, 2026 22:10
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.

2 participants