Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
210bf80
feat: add Flutter file manager with MCP WebSocket support
claude Nov 30, 2025
72d4579
fix: correct ConfigLoader method names and add HTTP server tests
claude Nov 30, 2025
6c3802d
fix(server-http): load configuration before starting server
Nov 30, 2025
0e2e5b6
fix(flutter): add generic types to PopupMenuItem for Flutter 3.0 comp…
Nov 30, 2025
2c376f1
feat(flutter): add JetBrainsMono font files
Nov 30, 2025
eac96c2
feat(flutter): add macOS platform support
Nov 30, 2025
7685b95
chore(flutter): add generated Flutter project files
Nov 30, 2025
6452e98
feat(flutter): add Settings screen with default editor configuration
Nov 30, 2025
588f576
feat(flutter): add file download/open and auto-sync to remote
Nov 30, 2025
b121b8d
feat(flutter): add transparent auto-connect with embedded MCP server
Nov 30, 2025
ec00f35
feat(flutter): add advanced settings with server management and tool …
Nov 30, 2025
f5fb5b0
feat(flutter): add dual-pane FileZilla-style layout with local and re…
Nov 30, 2025
5c28a37
fix(server): fix tilde expansion and add default_dir support in ssh_l…
Nov 30, 2025
313b807
feat(flutter): add server selector with grid/list view and search
Nov 30, 2025
db6aa18
feat(flutter): implement file opening on double-click
Nov 30, 2025
a1a3420
feat(flutter): auto-sync remote files on save
Nov 30, 2025
91c199e
feat(flutter): add context menu for file operations
Nov 30, 2025
093a2c9
fix: prevent double context menu and fix layout overflow
Nov 30, 2025
b4b85cd
feat: migrate all icons to HugeIcons package
Nov 30, 2025
7f8a5e9
test: add comprehensive test infrastructure with CLAUDE.md documentation
Nov 30, 2025
2418ca0
feat: add drag & drop file transfer between local and remote browsers
Nov 30, 2025
c691b35
feat: add sortable columns and auto-refresh after transfer
Nov 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
157 changes: 157 additions & 0 deletions PLAN_SETTINGS_FEATURE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
# Plan: Settings with Default Editor for File Opening

## Overview

Add a Settings screen to configure default applications for opening remote files. When double-clicking a file, the app will download it to a temp folder and open it with the configured editor.

## Current State

- Double-click on files triggers `FileBrowserProvider.open()`
- Files (non-directories) have a TODO at line 184: `// TODO: Handle file opening`
- `path_provider` and `file_picker` dependencies already present
- Pattern: Providers with ChangeNotifier, dialogs for user input

## Implementation Plan

### Phase 1: Settings Provider & Model

**1.1 Create `lib/models/app_settings.dart`**
```dart
class AppSettings {
String defaultEditor; // e.g., "code", "cursor", "subl"
String defaultEditorPath; // Full path to executable
Map<String, String> editorsByExtension; // Extension overrides
String tempDownloadPath; // Where to download files
bool autoOpenAfterDownload; // Auto-open or ask
}
```

**1.2 Create `lib/services/settings_service.dart`**
- Load/save settings using `shared_preferences`
- Default editors detection (VS Code, Cursor, Sublime, etc.)
- Methods: `load()`, `save()`, `getEditorForFile(filename)`

**1.3 Create `lib/providers/settings_provider.dart`**
- Wrap SettingsService with ChangeNotifier
- Expose settings to UI
- Handle persistence

### Phase 2: Settings UI

**2.1 Create `lib/screens/settings_screen.dart`**
- General settings section
- Default editor dropdown with "Browse..." option
- Extension mappings table (optional, v2)
- Download path configuration

**2.2 Create `lib/widgets/settings_dialog.dart`**
- Modal dialog version for quick access
- Shows only essential settings

**2.3 Update `lib/screens/home_screen.dart`**
- Add Settings icon button in toolbar
- Navigate to SettingsScreen or show SettingsDialog

### Phase 3: File Opening Logic

**3.1 Create `lib/services/file_opener_service.dart`**
```dart
class FileOpenerService {
Future<void> openRemoteFile({
required McpClient client,
required String server,
required String remotePath,
required String localTempPath,
required String editorCommand,
});
}
```
- Download file via MCP `ssh_download`
- Launch editor with `Process.run()` or `url_launcher`
- Handle errors gracefully

**3.2 Update `lib/providers/file_browser_provider.dart`**
- Inject SettingsProvider or FileOpenerService
- Replace TODO with actual file opening logic
- Show download progress (optional)

### Phase 4: Platform Integration

**4.1 macOS specific**
- Use `open -a "Visual Studio Code" file.txt` pattern
- Or direct path: `/Applications/Visual Studio Code.app/Contents/Resources/app/bin/code`

**4.2 Editor detection**
```dart
Map<String, EditorInfo> knownEditors = {
'vscode': EditorInfo(
name: 'Visual Studio Code',
macCommand: 'code',
macPath: '/Applications/Visual Studio Code.app',
),
'cursor': EditorInfo(
name: 'Cursor',
macCommand: 'cursor',
macPath: '/Applications/Cursor.app',
),
'sublime': EditorInfo(
name: 'Sublime Text',
macCommand: 'subl',
macPath: '/Applications/Sublime Text.app',
),
// ...
};
```

## Files to Create

1. `lib/models/app_settings.dart`
2. `lib/services/settings_service.dart`
3. `lib/services/file_opener_service.dart`
4. `lib/providers/settings_provider.dart`
5. `lib/screens/settings_screen.dart`
6. `lib/widgets/settings_dialog.dart`

## Files to Modify

1. `lib/main.dart` - Add SettingsProvider
2. `lib/screens/home_screen.dart` - Add settings button
3. `lib/providers/file_browser_provider.dart` - Implement file opening
4. `pubspec.yaml` - Add `shared_preferences`, `url_launcher`

## Dependencies to Add

```yaml
dependencies:
shared_preferences: ^2.2.2
url_launcher: ^6.2.1
```

## Implementation Order

1. Add dependencies to pubspec.yaml
2. Create models/app_settings.dart
3. Create services/settings_service.dart
4. Create providers/settings_provider.dart
5. Create widgets/settings_dialog.dart
6. Update main.dart with SettingsProvider
7. Update home_screen.dart with settings button
8. Create services/file_opener_service.dart
9. Update file_browser_provider.dart with file opening
10. Test end-to-end flow

## Testing Checklist

- [ ] Settings persist after app restart
- [ ] Can select different editors
- [ ] File downloads correctly from remote
- [ ] Editor opens with downloaded file
- [ ] Error handling for network issues
- [ ] Error handling for missing editor

## Future Enhancements (v2)

- Per-extension editor mapping
- Recent editors history
- Inline file preview for text files
- Auto-sync modified files back to server
45 changes: 45 additions & 0 deletions flutter_app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.build/
.buildlog/
.history
.svn/
.swiftpm/
migrate_working_dir/

# IntelliJ related
*.iml
*.ipr
*.iws
.idea/

# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/

# Flutter/Dart/Pub related
**/doc/api/
**/ios/Flutter/.last_build_id
.dart_tool/
.flutter-plugins-dependencies
.pub-cache/
.pub/
/build/
/coverage/

# Symbolication related
app.*.symbols

# Obfuscation related
app.*.map.json

# Android Studio will place build artifacts here
/android/app/debug
/android/app/profile
/android/app/release
30 changes: 30 additions & 0 deletions flutter_app/.metadata
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled and should not be manually edited.

version:
revision: "adc901062556672b4138e18a4dc62a4be8f4b3c2"
channel: "stable"

project_type: app

# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: adc901062556672b4138e18a4dc62a4be8f4b3c2
base_revision: adc901062556672b4138e18a4dc62a4be8f4b3c2
- platform: macos
create_revision: adc901062556672b4138e18a4dc62a4be8f4b3c2
base_revision: adc901062556672b4138e18a4dc62a4be8f4b3c2

# User provided section

# List of Local paths (relative to this file) that should be
# ignored by the migrate tool.
#
# Files that are not part of the templates will be ignored by default.
unmanaged_files:
- 'lib/main.dart'
- 'ios/Runner.xcodeproj/project.pbxproj'
Loading
Loading