feat: Implement accessible SFTP file browser and native editor

This commit is contained in:
2025-12-22 14:15:43 -06:00
parent 7a967ef759
commit 1bd7df79d8
8 changed files with 387 additions and 10 deletions

View File

@@ -23,8 +23,11 @@ class _ConnectionViewState extends ConsumerState<ConnectionView> {
// Listen for global connection errors (e.g. lost connection)
ref.listen<String?>(connectionErrorProvider, (previous, next) {
if (next != null) {
_showErrorDialog(next);
ref.read(connectionErrorProvider.notifier).state = null;
SemanticsService.sendAnnouncement(
View.of(context),
next,
TextDirection.ltr,
);
}
});
@@ -252,6 +255,7 @@ class _NewConnectionFormState extends ConsumerState<NewConnectionForm> {
}
Future<void> _pickKeyFile() async {
final view = View.of(context);
try {
FilePickerResult? result = await FilePicker.platform.pickFiles(
type: FileType.any, // SSH keys often have no extension or .pem/.key
@@ -265,7 +269,11 @@ class _NewConnectionFormState extends ConsumerState<NewConnectionForm> {
_privateKeyContent = content;
_privateKeyName = file.name;
});
SemanticsService.announce('Key selected: ${file.name}', TextDirection.ltr);
SemanticsService.sendAnnouncement(
view,
'Key selected: ${file.name}',
TextDirection.ltr,
);
}
}
} catch (e) {