Code view:

A painting is a person's account of this edit as text, recorded independently of the node mapping - a rendering often has several equally defensible answers where the mapping has one. Deletions and insertions carry no position on the opposite side in a painting, so that panel draws no caret for them.

Before

…lines 1–40 unchanged (40 lines)
41
42 companion object {
43 private const val TAG = "AssistantViewModel"
44 private const val POLLING_INTERVAL_MS = 15_000L
45 }
46
47 private val _inputBarText = MutableStateFlow<String>("")
48 val inputBarText: StateFlow<String> = _inputBarText
49
50 private val _screenState = MutableStateFlow<AssistantScreenState?>(null)
51 val screenState: StateFlow<AssistantScreenState?> = _screenState
52
53 private val _screenOverlayState = MutableStateFlow<ScreenOverlayState?>(null)
…lines 54–334 unchanged (281 lines)

After

…lines 1–40 unchanged (40 lines)
41
42 companion object {
43 private const val TAG = "AssistantViewModel"
44 private const val POLLING_INTERVAL_MS = 15_000L
45 }
46
47 private val _inputBarText = MutableStateFlow("")
48 val inputBarText: StateFlow<String> = _inputBarText
49
50 private val _screenState = MutableStateFlow<AssistantScreenState?>(null)
51 val screenState: StateFlow<AssistantScreenState?> = _screenState
52
53 private val _screenOverlayState = MutableStateFlow<ScreenOverlayState?>(null)
…lines 54–334 unchanged (281 lines)

Before

source_file
block_comment "/*\n * Nextcloud - Android Client\n *\n * SPDX-FileCopyrightTex"...
package_header
package "package"
qualified_identifier
identifier "com"
. "."
identifier "nextcloud"
. "."
identifier "client"
. "."
identifier "assistant"
import
import "import"
qualified_identifier
identifier "androidx"
. "."
identifier "lifecycle"
. "."
identifier "ViewModel"
import
import "import"
qualified_identifier
identifier "androidx"
. "."
identifier "lifecycle"
. "."
identifier "viewModelScope"
import
import "import"
qualified_identifier
identifier "com"
. "."
identifier "nextcloud"
. "."
identifier "client"
. "."
identifier "assistant"
. "."
identifier "model"
. "."
identifier "AssistantScreenState"
import
import "import"
qualified_identifier
identifier "com"
. "."
identifier "nextcloud"
. "."
identifier "client"
. "."
identifier "assistant"
. "."
identifier "model"
. "."
identifier "ScreenOverlayState"
import
import "import"
qualified_identifier
identifier "com"
. "."
identifier "nextcloud"
. "."
identifier "client"
. "."
identifier "assistant"
. "."
identifier "repository"
. "."
identifier "local"
. "."
identifier "AssistantLocalRepository"
import
import "import"
qualified_identifier
identifier "com"
. "."
identifier "nextcloud"
. "."
identifier "client"
. "."
identifier "assistant"
. "."
identifier "repository"
. "."
identifier "remote"
. "."
identifier "AssistantRemoteRepository"
import
import "import"
qualified_identifier
identifier "com"
. "."
identifier "nextcloud"
. "."
identifier "utils"
. "."
identifier "TimeConstants"
. "."
identifier "MILLIS_PER_SECOND"
import
import "import"
qualified_identifier
identifier "com"
. "."
identifier "nextcloud"
. "."
identifier "utils"
. "."
identifier "extensions"
. "."
identifier "isHuman"
import
import "import"
qualified_identifier
identifier "com"
. "."
identifier "owncloud"
. "."
identifier "android"
. "."
identifier "R"
import
import "import"
qualified_identifier
identifier "com"
. "."
identifier "owncloud"
. "."
identifier "android"
. "."
identifier "lib"
. "."
identifier "common"
. "."
identifier "utils"
. "."
identifier "Log_OC"
import
import "import"
qualified_identifier
identifier "com"
. "."
identifier "owncloud"
. "."
identifier "android"
. "."
identifier "lib"
. "."
identifier "resources"
. "."
identifier "assistant"
. "."
identifier "chat"
. "."
identifier "model"
. "."
identifier "ChatMessage"
import
import "import"
qualified_identifier
identifier "com"
. "."
identifier "owncloud"
. "."
identifier "android"
. "."
identifier "lib"
. "."
identifier "resources"
. "."
identifier "assistant"
. "."
identifier "chat"
. "."
identifier "model"
. "."
identifier "ChatMessageRequest"
import
import "import"
qualified_identifier
identifier "com"
. "."
identifier "owncloud"
. "."
identifier "android"
. "."
identifier "lib"
. "."
identifier "resources"
. "."
identifier "assistant"
. "."
identifier "v2"
. "."
identifier "model"
. "."
identifier "Task"
import
import "import"
qualified_identifier
identifier "com"
. "."
identifier "owncloud"
. "."
identifier "android"
. "."
identifier "lib"
. "."
identifier "resources"
. "."
identifier "assistant"
. "."
identifier "v2"
. "."
identifier "model"
. "."
identifier "TaskTypeData"
import
import "import"
qualified_identifier
identifier "kotlinx"
. "."
identifier "coroutines"
. "."
identifier "Dispatchers"
import
import "import"
qualified_identifier
identifier "kotlinx"
. "."
identifier "coroutines"
. "."
identifier "Job"
import
import "import"
qualified_identifier
identifier "kotlinx"
. "."
identifier "coroutines"
. "."
identifier "delay"
import
import "import"
qualified_identifier
identifier "kotlinx"
. "."
identifier "coroutines"
. "."
identifier "flow"
. "."
identifier "MutableStateFlow"
import
import "import"
qualified_identifier
identifier "kotlinx"
. "."
identifier "coroutines"
. "."
identifier "flow"
. "."
identifier "StateFlow"
import
import "import"
qualified_identifier
identifier "kotlinx"
. "."
identifier "coroutines"
. "."
identifier "flow"
. "."
identifier "combine"
import
import "import"
qualified_identifier
identifier "kotlinx"
. "."
identifier "coroutines"
. "."
identifier "flow"
. "."
identifier "update"
import
import "import"
qualified_identifier
identifier "kotlinx"
. "."
identifier "coroutines"
. "."
identifier "isActive"
import
import "import"
qualified_identifier
identifier "kotlinx"
. "."
identifier "coroutines"
. "."
identifier "launch"
class_declaration
modifiers
annotation
@ "@"
constructor_invocation
user_type
identifier "Suppress"
value_arguments
( "("
value_argument
string_literal
" "\""
string_content "TooManyFunctions"
" "\""
) ")"
class "class"
identifier "AssistantViewModel"
primary_constructor (+41 nodes collapsed)
: ":"
delegation_specifiers
delegation_specifier
constructor_invocation
user_type
identifier "ViewModel"
value_arguments
( "("
) ")"
class_body
{ "{"
companion_object (+31 nodes collapsed)
property_declaration
modifiers
visibility_modifier
private "private"
val "val"
variable_declaration
identifier "_inputBarText"
= "="
binary_expression
binary_expression
identifier "MutableStateFlow"
< "<"
identifier "String"
> ">"
parenthesized_expression
( "("
string_literal
" "\""
" "\""
) ")"
property_declaration
val "val"
variable_declaration
identifier "inputBarText"
: ":"
user_type
identifier "StateFlow"
type_arguments
< "<"
type_projection
user_type
identifier "String"
> ">"
= "="
identifier "_inputBarText"
property_declaration (+23 nodes collapsed)
property_declaration
val "val"
variable_declaration
identifier "screenState"
: ":"
user_type
identifier "StateFlow"
type_arguments
< "<"
type_projection
nullable_type
user_type
identifier "AssistantScreenState"
? "?"
> ">"
= "="
identifier "_screenState"
property_declaration (+23 nodes collapsed)
property_declaration
val "val"
variable_declaration
identifier "screenOverlayState"
: ":"
user_type
identifier "StateFlow"
type_arguments
< "<"
type_projection
nullable_type
user_type
identifier "ScreenOverlayState"
? "?"
> ">"
= "="
identifier "_screenOverlayState"
property_declaration
modifiers
visibility_modifier
private "private"
val "val"
variable_declaration
identifier "_sessionId"
= "="
call_expression
identifier "MutableStateFlow"
value_arguments
( "("
value_argument
identifier "sessionIdArg"
) ")"
property_declaration
val "val"
variable_declaration
identifier "sessionId"
: ":"
user_type
identifier "StateFlow"
type_arguments
< "<"
type_projection
nullable_type
user_type
identifier "Long"
? "?"
> ">"
= "="
identifier "_sessionId"
property_declaration (+23 nodes collapsed)
property_declaration
val "val"
variable_declaration
identifier "snackbarMessageId"
: ":"
user_type
identifier "StateFlow"
type_arguments
< "<"
type_projection
nullable_type
user_type
identifier "Int"
? "?"
> ">"
= "="
identifier "_snackbarMessageId"
property_declaration (+23 nodes collapsed)
property_declaration
val "val"
variable_declaration
identifier "selectedTaskType"
: ":"
user_type
identifier "StateFlow"
type_arguments
< "<"
type_projection
nullable_type
user_type
identifier "TaskTypeData"
? "?"
> ">"
= "="
identifier "_selectedTaskType"
property_declaration (+29 nodes collapsed)
property_declaration (+23 nodes collapsed)
property_declaration
modifiers
visibility_modifier
private "private"
var "var"
variable_declaration
identifier "taskList"
: ":"
nullable_type
user_type
identifier "List"
type_arguments
< "<"
type_projection
user_type
identifier "Task"
> ">"
? "?"
= "="
identifier "null"
property_declaration (+29 nodes collapsed)
property_declaration (+23 nodes collapsed)
property_declaration (+31 nodes collapsed)
property_declaration (+21 nodes collapsed)
property_declaration
modifiers
visibility_modifier
private "private"
val "val"
variable_declaration
identifier "_isAssistantAnswering"
= "="
call_expression
identifier "MutableStateFlow"
value_arguments
( "("
value_argument
identifier "false"
) ")"
property_declaration
val "val"
variable_declaration
identifier "isAssistantAnswering"
: ":"
user_type
identifier "StateFlow"
type_arguments
< "<"
type_projection
user_type
identifier "Boolean"
> ">"
= "="
identifier "_isAssistantAnswering"
property_declaration
modifiers
visibility_modifier
private "private"
var "var"
variable_declaration
identifier "pollingJob"
: ":"
nullable_type
user_type
identifier "Job"
? "?"
= "="
identifier "null"
property_declaration
modifiers
visibility_modifier
private "private"
var "var"
variable_declaration
identifier "currentChatTaskId"
: ":"
nullable_type
user_type
identifier "String"
? "?"
= "="
identifier "null"
anonymous_initializer
init "init"
block
{ "{"
call_expression
identifier "observeScreenState"
value_arguments
( "("
) ")"
call_expression
identifier "fetchTaskTypes"
value_arguments
( "("
) ")"
} "}"
line_comment "// region task polling"
function_declaration (+233 nodes collapsed)
function_declaration (+22 nodes collapsed)
line_comment "// endregion"
function_declaration (+142 nodes collapsed)
function_declaration (+180 nodes collapsed)
function_declaration (+189 nodes collapsed)
line_comment "// region chat"
function_declaration (+165 nodes collapsed)
function_declaration (+78 nodes collapsed)
function_declaration (+82 nodes collapsed)
function_declaration (+47 nodes collapsed)
line_comment "// endregion"
line_comment "// region task"
function_declaration (+111 nodes collapsed)
function_declaration (+126 nodes collapsed)
function_declaration (+98 nodes collapsed)
function_declaration (+174 nodes collapsed)
function_declaration (+118 nodes collapsed)
line_comment "// endregion"
function_declaration (+28 nodes collapsed)
function_declaration (+27 nodes collapsed)
function_declaration (+27 nodes collapsed)
function_declaration (+25 nodes collapsed)
function_declaration (+47 nodes collapsed)
} "}"

After

source_file
block_comment "/*\n * Nextcloud - Android Client\n *\n * SPDX-FileCopyrightTex"...
package_header
package "package"
qualified_identifier
identifier "com"
. "."
identifier "nextcloud"
. "."
identifier "client"
. "."
identifier "assistant"
import
import "import"
qualified_identifier
identifier "androidx"
. "."
identifier "lifecycle"
. "."
identifier "ViewModel"
import
import "import"
qualified_identifier
identifier "androidx"
. "."
identifier "lifecycle"
. "."
identifier "viewModelScope"
import
import "import"
qualified_identifier
identifier "com"
. "."
identifier "nextcloud"
. "."
identifier "client"
. "."
identifier "assistant"
. "."
identifier "model"
. "."
identifier "AssistantScreenState"
import
import "import"
qualified_identifier
identifier "com"
. "."
identifier "nextcloud"
. "."
identifier "client"
. "."
identifier "assistant"
. "."
identifier "model"
. "."
identifier "ScreenOverlayState"
import
import "import"
qualified_identifier
identifier "com"
. "."
identifier "nextcloud"
. "."
identifier "client"
. "."
identifier "assistant"
. "."
identifier "repository"
. "."
identifier "local"
. "."
identifier "AssistantLocalRepository"
import
import "import"
qualified_identifier
identifier "com"
. "."
identifier "nextcloud"
. "."
identifier "client"
. "."
identifier "assistant"
. "."
identifier "repository"
. "."
identifier "remote"
. "."
identifier "AssistantRemoteRepository"
import
import "import"
qualified_identifier
identifier "com"
. "."
identifier "nextcloud"
. "."
identifier "utils"
. "."
identifier "TimeConstants"
. "."
identifier "MILLIS_PER_SECOND"
import
import "import"
qualified_identifier
identifier "com"
. "."
identifier "nextcloud"
. "."
identifier "utils"
. "."
identifier "extensions"
. "."
identifier "isHuman"
import
import "import"
qualified_identifier
identifier "com"
. "."
identifier "owncloud"
. "."
identifier "android"
. "."
identifier "R"
import
import "import"
qualified_identifier
identifier "com"
. "."
identifier "owncloud"
. "."
identifier "android"
. "."
identifier "lib"
. "."
identifier "common"
. "."
identifier "utils"
. "."
identifier "Log_OC"
import
import "import"
qualified_identifier
identifier "com"
. "."
identifier "owncloud"
. "."
identifier "android"
. "."
identifier "lib"
. "."
identifier "resources"
. "."
identifier "assistant"
. "."
identifier "chat"
. "."
identifier "model"
. "."
identifier "ChatMessage"
import
import "import"
qualified_identifier
identifier "com"
. "."
identifier "owncloud"
. "."
identifier "android"
. "."
identifier "lib"
. "."
identifier "resources"
. "."
identifier "assistant"
. "."
identifier "chat"
. "."
identifier "model"
. "."
identifier "ChatMessageRequest"
import
import "import"
qualified_identifier
identifier "com"
. "."
identifier "owncloud"
. "."
identifier "android"
. "."
identifier "lib"
. "."
identifier "resources"
. "."
identifier "assistant"
. "."
identifier "v2"
. "."
identifier "model"
. "."
identifier "Task"
import
import "import"
qualified_identifier
identifier "com"
. "."
identifier "owncloud"
. "."
identifier "android"
. "."
identifier "lib"
. "."
identifier "resources"
. "."
identifier "assistant"
. "."
identifier "v2"
. "."
identifier "model"
. "."
identifier "TaskTypeData"
import
import "import"
qualified_identifier
identifier "kotlinx"
. "."
identifier "coroutines"
. "."
identifier "Dispatchers"
import
import "import"
qualified_identifier
identifier "kotlinx"
. "."
identifier "coroutines"
. "."
identifier "Job"
import
import "import"
qualified_identifier
identifier "kotlinx"
. "."
identifier "coroutines"
. "."
identifier "delay"
import
import "import"
qualified_identifier
identifier "kotlinx"
. "."
identifier "coroutines"
. "."
identifier "flow"
. "."
identifier "MutableStateFlow"
import
import "import"
qualified_identifier
identifier "kotlinx"
. "."
identifier "coroutines"
. "."
identifier "flow"
. "."
identifier "StateFlow"
import
import "import"
qualified_identifier
identifier "kotlinx"
. "."
identifier "coroutines"
. "."
identifier "flow"
. "."
identifier "combine"
import
import "import"
qualified_identifier
identifier "kotlinx"
. "."
identifier "coroutines"
. "."
identifier "flow"
. "."
identifier "update"
import
import "import"
qualified_identifier
identifier "kotlinx"
. "."
identifier "coroutines"
. "."
identifier "isActive"
import
import "import"
qualified_identifier
identifier "kotlinx"
. "."
identifier "coroutines"
. "."
identifier "launch"
class_declaration
modifiers
annotation
@ "@"
constructor_invocation
user_type
identifier "Suppress"
value_arguments
( "("
value_argument
string_literal
" "\""
string_content "TooManyFunctions"
" "\""
) ")"
class "class"
identifier "AssistantViewModel"
primary_constructor (+41 nodes collapsed)
: ":"
delegation_specifiers
delegation_specifier
constructor_invocation
user_type
identifier "ViewModel"
value_arguments
( "("
) ")"
class_body
{ "{"
companion_object (+31 nodes collapsed)
property_declaration
modifiers
visibility_modifier
private "private"
val "val"
variable_declaration
identifier "_inputBarText"
= "="
call_expression
identifier "MutableStateFlow"
value_arguments
( "("
value_argument
string_literal
" "\""
" "\""
) ")"
property_declaration
val "val"
variable_declaration
identifier "inputBarText"
: ":"
user_type
identifier "StateFlow"
type_arguments
< "<"
type_projection
user_type
identifier "String"
> ">"
= "="
identifier "_inputBarText"
property_declaration (+23 nodes collapsed)
property_declaration
val "val"
variable_declaration
identifier "screenState"
: ":"
user_type
identifier "StateFlow"
type_arguments
< "<"
type_projection
nullable_type
user_type
identifier "AssistantScreenState"
? "?"
> ">"
= "="
identifier "_screenState"
property_declaration (+23 nodes collapsed)
property_declaration
val "val"
variable_declaration
identifier "screenOverlayState"
: ":"
user_type
identifier "StateFlow"
type_arguments
< "<"
type_projection
nullable_type
user_type
identifier "ScreenOverlayState"
? "?"
> ">"
= "="
identifier "_screenOverlayState"
property_declaration
modifiers
visibility_modifier
private "private"
val "val"
variable_declaration
identifier "_sessionId"
= "="
call_expression
identifier "MutableStateFlow"
value_arguments
( "("
value_argument
identifier "sessionIdArg"
) ")"
property_declaration
val "val"
variable_declaration
identifier "sessionId"
: ":"
user_type
identifier "StateFlow"
type_arguments
< "<"
type_projection
nullable_type
user_type
identifier "Long"
? "?"
> ">"
= "="
identifier "_sessionId"
property_declaration (+23 nodes collapsed)
property_declaration
val "val"
variable_declaration
identifier "snackbarMessageId"
: ":"
user_type
identifier "StateFlow"
type_arguments
< "<"
type_projection
nullable_type
user_type
identifier "Int"
? "?"
> ">"
= "="
identifier "_snackbarMessageId"
property_declaration (+23 nodes collapsed)
property_declaration
val "val"
variable_declaration
identifier "selectedTaskType"
: ":"
user_type
identifier "StateFlow"
type_arguments
< "<"
type_projection
nullable_type
user_type
identifier "TaskTypeData"
? "?"
> ">"
= "="
identifier "_selectedTaskType"
property_declaration (+29 nodes collapsed)
property_declaration (+23 nodes collapsed)
property_declaration
modifiers
visibility_modifier
private "private"
var "var"
variable_declaration
identifier "taskList"
: ":"
nullable_type
user_type
identifier "List"
type_arguments
< "<"
type_projection
user_type
identifier "Task"
> ">"
? "?"
= "="
identifier "null"
property_declaration (+29 nodes collapsed)
property_declaration (+23 nodes collapsed)
property_declaration (+31 nodes collapsed)
property_declaration (+21 nodes collapsed)
property_declaration
modifiers
visibility_modifier
private "private"
val "val"
variable_declaration
identifier "_isAssistantAnswering"
= "="
call_expression
identifier "MutableStateFlow"
value_arguments
( "("
value_argument
identifier "false"
) ")"
property_declaration
val "val"
variable_declaration
identifier "isAssistantAnswering"
: ":"
user_type
identifier "StateFlow"
type_arguments
< "<"
type_projection
user_type
identifier "Boolean"
> ">"
= "="
identifier "_isAssistantAnswering"
property_declaration
modifiers
visibility_modifier
private "private"
var "var"
variable_declaration
identifier "pollingJob"
: ":"
nullable_type
user_type
identifier "Job"
? "?"
= "="
identifier "null"
property_declaration
modifiers
visibility_modifier
private "private"
var "var"
variable_declaration
identifier "currentChatTaskId"
: ":"
nullable_type
user_type
identifier "String"
? "?"
= "="
identifier "null"
anonymous_initializer
init "init"
block
{ "{"
call_expression
identifier "observeScreenState"
value_arguments
( "("
) ")"
call_expression
identifier "fetchTaskTypes"
value_arguments
( "("
) ")"
} "}"
line_comment "// region task polling"
function_declaration (+233 nodes collapsed)
function_declaration (+22 nodes collapsed)
line_comment "// endregion"
function_declaration (+142 nodes collapsed)
function_declaration (+180 nodes collapsed)
function_declaration (+189 nodes collapsed)
line_comment "// region chat"
function_declaration (+165 nodes collapsed)
function_declaration (+78 nodes collapsed)
function_declaration (+82 nodes collapsed)
function_declaration (+47 nodes collapsed)
line_comment "// endregion"
line_comment "// region task"
function_declaration (+111 nodes collapsed)
function_declaration (+126 nodes collapsed)
function_declaration (+98 nodes collapsed)
function_declaration (+174 nodes collapsed)
function_declaration (+118 nodes collapsed)
line_comment "// endregion"
function_declaration (+28 nodes collapsed)
function_declaration (+27 nodes collapsed)
function_declaration (+27 nodes collapsed)
function_declaration (+25 nodes collapsed)
function_declaration (+47 nodes collapsed)
} "}"