IssueReporterViewModel

Owns the report draft and submission state. Form fields survive submission and are cleared on dismissal; a reset requested during sending is deferred until that send finishes. Success is rendered by the confirmation state rather than a transient message.

A send passes three gates before it reaches GitHub: validateReport, whose errors show under the fields, then the cooldown and the duplicate check of historyRepository, which show as a message. Each attempt is logged once as send_issue with the gate that stopped it.

Both repositories are main-safe, so this needs no dispatcher.

Constructors

Link copied to clipboard
constructor(repository: IssueReporterRepository, historyRepository: IssueReportHistoryRepository, validateReport: ValidateIssueReportUseCase, githubTarget: GithubTarget, githubToken: String, telemetryRepository: TelemetryRepository)

Properties

Link copied to clipboard
val messages: StateFlow<ImmutableList<UiMessage>>
Link copied to clipboard
val state: StateFlow<IssueReporterUiState>

Functions

Link copied to clipboard
open fun addCloseable(closeable: AutoCloseable)
fun addCloseable(key: String, closeable: AutoCloseable)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard