mirror of
https://github.com/permissionlesstech/bitchat-android.git
synced 2026-07-25 08:45:20 +00:00
REFACTOR: Break ChatViewModel into smaller specialized files
- Created ChatState.kt for centralized state management - Created DataManager.kt for persistence operations - Created MessageManager.kt for message handling and deduplication - Created ChannelManager.kt for channel operations and encryption - Created PrivateChatManager.kt for private chat functionality - Created CommandProcessor.kt for IRC-style command processing ChatViewModel.kt reduced from 1000+ lines to ~300 lines while maintaining 100% functionality. All existing functionality preserved, just better organized.
This commit is contained in:
@@ -101,8 +101,8 @@ fun MessageInput(
|
||||
|
||||
@Composable
|
||||
fun CommandSuggestionsBox(
|
||||
suggestions: List<ChatViewModel.CommandSuggestion>,
|
||||
onSuggestionClick: (ChatViewModel.CommandSuggestion) -> Unit,
|
||||
suggestions: List<CommandSuggestion>,
|
||||
onSuggestionClick: (CommandSuggestion) -> Unit,
|
||||
modifier: Modifier = Modifier
|
||||
) {
|
||||
val colorScheme = MaterialTheme.colorScheme
|
||||
@@ -113,7 +113,7 @@ fun CommandSuggestionsBox(
|
||||
.border(1.dp, colorScheme.outline.copy(alpha = 0.3f), RoundedCornerShape(4.dp))
|
||||
.padding(vertical = 8.dp)
|
||||
) {
|
||||
suggestions.forEach { suggestion ->
|
||||
suggestions.forEach { suggestion: CommandSuggestion ->
|
||||
CommandSuggestionItem(
|
||||
suggestion = suggestion,
|
||||
onClick = { onSuggestionClick(suggestion) }
|
||||
@@ -124,7 +124,7 @@ fun CommandSuggestionsBox(
|
||||
|
||||
@Composable
|
||||
fun CommandSuggestionItem(
|
||||
suggestion: ChatViewModel.CommandSuggestion,
|
||||
suggestion: CommandSuggestion,
|
||||
onClick: () -> Unit
|
||||
) {
|
||||
val colorScheme = MaterialTheme.colorScheme
|
||||
|
||||
Reference in New Issue
Block a user