v1.0.26: fix multi-selection reactivity, redesign icon, security review
Fix multi-selection: selectedKeys exposed as StateFlow, collected in FilesScreen so checkboxes and highlights update correctly on every tap. fileKey() made public so UI can check membership without ViewModel calls. Icon: white cloud body with two cyan/teal circular sync arcs (AutoSync style), deep blue-to-teal gradient background. Security review clean: no hardcoded credentials, cleartext blocked by network_security_config, allowBackup=false, path traversal guards in place on both server responses and local resolution. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -60,6 +60,7 @@ class FilesViewModel @Inject constructor(
|
||||
val isDownloading: StateFlow<Boolean> = _isDownloading
|
||||
|
||||
private val _selectedKeys = MutableStateFlow<Set<String>>(emptySet())
|
||||
val selectedKeys: StateFlow<Set<String>> = _selectedKeys
|
||||
val isSelectionMode: StateFlow<Boolean> = _selectedKeys.map { it.isNotEmpty() }
|
||||
.stateIn(viewModelScope, SharingStarted.WhileSubscribed(5_000), false)
|
||||
val selectedCount: StateFlow<Int> = _selectedKeys.map { it.size }
|
||||
@@ -152,7 +153,7 @@ class FilesViewModel @Inject constructor(
|
||||
}
|
||||
}
|
||||
|
||||
private fun fileKey(file: SyncFileStateEntity) = "${file.syncPairId}:${file.relativePath}"
|
||||
fun fileKey(file: SyncFileStateEntity) = "${file.syncPairId}:${file.relativePath}"
|
||||
|
||||
// ── Download-then-open/share ──────────────────────────────────────────────
|
||||
|
||||
|
||||
Reference in New Issue
Block a user