AttachmentsPickerViewModel
ViewModel for the attachment picker. Drives picker tab state, device storage browsing, and the isSelected checkmarks shown in attachments.
Note: attachments reflects only the checkmark selection, not the full attachment list staged for the message. The composer attachment list is owned by MessageComposerViewModel.
The active tab and checkmark selection survive process death (e.g. "Don't keep activities"). Checkmarks are not reset on hide — they persist until the session is explicitly consumed (e.g. after a message is sent, a poll is created, or a command is selected).
Parameters
Provides device storage queries and attachment conversion.
Provides the current ChannelState for channel-specific configuration.
Persists picker tab and selection state across process death.
Constructors
Properties
The attachment list for the active pickerMode, with each item's AttachmentPickerItemState.isSelected reflecting the current picker selection.
Whether the attachment picker is currently visible.
The active picker tab.
One-shot events for attachments resolved from system picker URIs. Collected by the parent composable to submit attachments and show error toasts.
Functions
Converts the given metaData into lightweight Attachments ready to be staged in the composer.
Loads attachment metadata from device storage for the current pickerMode.
Resolves uris from a system picker into Attachments and emits the result via submittedAttachments.
Switches the active picker tab.
Shows or hides the attachment picker. Hiding clears cached media data but preserves the current selection so checkmarks remain when the picker is reopened.
Toggles the attachment picker visibility.