feat(widgets): intro and gallery sheet#972
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 786e4c67dd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c0d7a07c0d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e1242fc8ed
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| val navController = rememberNavController() | ||
| val onDismiss = app::hideSheet | ||
| val onDone = { | ||
| app.hideSheet() |
There was a problem hiding this comment.
Avoid cancelling widget saves on close
When a user saves or deletes a non-price widget from the new sheet, the preview handlers call the ViewModel method and then onClose() immediately (for example SuggestionsPreviewScreen does addWidget() then closes). This app.hideSheet() removes WidgetsSheet, and the sheet-scoped ViewModelStore is cleared on disposal, cancelling those viewModelScope.launch { widgetsRepo.addWidget/deleteWidget(...) } jobs before the suspend DataStore update reliably finishes, so saving/deleting widgets from the sheet can be lost. Keep the sheet alive until the repository operation completes, or move the operation to a scope that is not cleared by dismissing the sheet.
Useful? React with 👍 / 👎.
Closes #966
Description
This PR:
Preview
addwidget.mp4
QA Notes
Hint: Use the new "Reset Widgets intro flag" from Dev Settings to retest the intro screen and its wiring.
Manual Tests
regression:Add Widget gallery → tap the Bitcoin Price chart line and Bitcoin Headlines content: both open their in-sheet preview, with no chart tooltip or external URL open.Automated Checks
app/src/test/java/to/bitkit/ui/sheets/WidgetsRouteTest.kt.journeys/widgets/forwidgets introandadd widgets flow../gradlew compileDevDebugKotlin compileDevDebugAndroidTestKotlin detekt testDevDebugUnitTest../gradlew connectedDevDebugAndroidTest -Pandroid.testInstrumentationRunnerArguments.class=to.bitkit.ui.screens.widgets.AddWidgetsSheetContentTest.