Skip to content

Rewrite dialog bindings#98

Merged
Goooler merged 13 commits into
trunkfrom
compose-migration-cleanups-part-2
Apr 22, 2026
Merged

Rewrite dialog bindings#98
Goooler merged 13 commits into
trunkfrom
compose-migration-cleanups-part-2

Conversation

@Goooler
Copy link
Copy Markdown
Owner

@Goooler Goooler commented Apr 21, 2026

Refs #65.

@Goooler Goooler force-pushed the compose-migration-cleanups-part-2 branch from a4e42e0 to 84103f0 Compare April 21, 2026 15:18
@Goooler Goooler changed the title Compose migration cleanups part 1 Compose migration cleanups part 2 Apr 21, 2026
@Goooler Goooler force-pushed the compose-migration-cleanups-part-2 branch from 84103f0 to 70edb6f Compare April 22, 2026 05:07
@Goooler Goooler force-pushed the compose-migration-cleanups-part-2 branch from 70edb6f to d7b79f6 Compare April 22, 2026 07:18
@Goooler Goooler changed the title Compose migration cleanups part 2 Eliminate dialog bindings Apr 22, 2026
@Goooler Goooler changed the title Eliminate dialog bindings Rewrite dialog bindings Apr 22, 2026
@Goooler Goooler requested a review from Copilot April 22, 2026 13:09
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Migrates legacy dialog implementations from XML/ViewBinding-based Material dialogs to Jetpack Compose dialogs as part of the broader Compose UI rewrite (refs #65).

Changes:

  • Replaced ViewBinding-based input/progress dialogs with Compose ModelTextInputDialog and ModelProgressBarDialog.
  • Updated PropertiesDesign, LogcatDesign, and FilesDesign to drive dialogs via Compose state instead of suspend dialog helpers.
  • Removed ViewBinding support and deleted unused dialog XML layouts and binding-backed dialog helpers.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
design/src/main/res/layout/dialog_text_field.xml Removed obsolete XML dialog layout (migrated to Compose).
design/src/main/res/layout/dialog_fetch_status.xml Removed obsolete XML progress dialog layout (migrated to Compose).
design/src/main/java/com/github/kr328/clash/design/dialog/Progress.kt Removed legacy suspend-based progress dialog helper.
design/src/main/java/com/github/kr328/clash/design/dialog/Input.kt Removed legacy suspend-based text input dialog helper.
design/src/main/java/com/github/kr328/clash/design/component/ModelTextInputDialog.kt Added Compose text input dialog component.
design/src/main/java/com/github/kr328/clash/design/component/ModelProgressBarDialog.kt Added Compose progress dialog + state holder.
design/src/main/java/com/github/kr328/clash/design/PropertiesDesign.kt Converted property-edit dialogs and progress UI to Compose state-driven dialogs.
design/src/main/java/com/github/kr328/clash/design/LogcatDesign.kt Added Compose progress state for export flow and renders progress dialog.
design/src/main/java/com/github/kr328/clash/design/FilesDesign.kt Converted rename dialog to Compose and moved new-name into request payload.
design/build.gradle.kts Disabled ViewBinding in the design module.
app/src/main/java/com/github/kr328/clash/LogcatActivity.kt Reworked export flow to update progress via LogcatDesign state.
app/src/main/java/com/github/kr328/clash/FilesActivity.kt Uses new rename request payload; import no longer prompts for/validates filename.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread app/src/main/java/com/github/kr328/clash/FilesActivity.kt
Comment thread app/src/main/java/com/github/kr328/clash/LogcatActivity.kt Outdated
Goooler and others added 4 commits April 22, 2026 21:16
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread app/src/main/java/com/github/kr328/clash/LogcatActivity.kt Outdated
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +115 to 120
} finally {
withContext(Dispatchers.Main) {
progressBarState.visible = false
progressBarState.text = null
processingState = false
}
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

withProcessing does UI cleanup in a finally block via withContext(Dispatchers.Main). If the parent coroutine is cancelled (e.g., activity finishing / scope cancellation), this withContext can throw CancellationException before resetting processingState/progressBarState.visible, leaving the progress dialog stuck visible. Consider wrapping the finally UI reset in withContext(NonCancellable + Dispatchers.Main) (or Dispatchers.Main.immediate) so cleanup always runs.

Copilot uses AI. Check for mistakes.
Comment on lines +110 to +114
suspend fun finishExportProgress() =
withContext(Dispatchers.Main) {
exportProgressState.visible = false
exportProgressState.text = null
}
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

finishExportProgress() uses withContext(Dispatchers.Main) to hide the progress dialog. When called from a finally block, this can be skipped if the coroutine is already cancelled (since withContext is cancellable), leaving exportProgressState.visible stuck true. Consider using withContext(NonCancellable + Dispatchers.Main) for this cleanup path.

Copilot uses AI. Check for mistakes.
Comment thread app/src/main/java/com/github/kr328/clash/LogcatActivity.kt Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@Goooler Goooler merged commit aab7364 into trunk Apr 22, 2026
2 checks passed
@Goooler Goooler deleted the compose-migration-cleanups-part-2 branch April 22, 2026 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants