feat: weather widget v61 + OS widget#927
Conversation
|
|
||
| @Composable | ||
| internal fun WeatherConfigContent( | ||
| modifier: Modifier = Modifier, |
There was a problem hiding this comment.
modifier: Modifier = Modifier is placed before required parameters in WeatherConfigContent (here) and also in the private WeatherOptionRow composable (L120–L126).\n\nPer CLAUDE.md: "ALWAYS declare modifier: Modifier = Modifier, as the FIRST optional parameter in composable declarations."\n\nIn Kotlin, optional (default-value) parameters must follow required ones, so modifier (optional) placed before state, onSelectOption, onReset, onSave, onCancel (all required) violates this ordering. Existing analogous composables in the codebase — BlocksConfigContent, HeadlinesConfigContent — avoid this by omitting modifier entirely, and WeatherFeeValueText in WeatherStyles.kt correctly places modifier after its required params. modifier should be moved to after all required parameters in both functions.
|
|
||
| @Composable | ||
| fun WeatherEditScreen( | ||
| modifier: Modifier = Modifier, |
There was a problem hiding this comment.
modifier: Modifier = Modifier is placed before required parameters in three composables in this file:\n- WeatherEditScreen (L41–L47) — before weatherViewModel, onBack, navigatePreview\n- WeatherEditContent (L62–L70) — before onBack, weather, onSelectOption, onClickReset, onClickPreview, weatherPreferences\n- WeatherEditOptionRow (L172–L179) — before label, value, isSelected, onClick, testTagPrefix\n\nPer CLAUDE.md: "ALWAYS declare modifier: Modifier = Modifier, as the FIRST optional parameter in composable declarations." In Kotlin, optional parameters must come after required parameters. modifier should be moved to after all required parameters in each of these three functions.
|
|
||
| @Composable | ||
| fun WeatherPreviewScreen( | ||
| modifier: Modifier = Modifier, |
There was a problem hiding this comment.
modifier: Modifier = Modifier is placed before required parameters in two composables in this file:\n- WeatherPreviewScreen (L37–L43) — before weatherViewModel, onClose, onBack, navigateEditWidget\n- WeatherPreviewContent (L71–L80) — before onBack, onClickEdit, onClickDelete, onClickSave, isWeatherWidgetEnabled, weatherPreferences, weatherModel\n\nPer CLAUDE.md: "ALWAYS declare modifier: Modifier = Modifier, as the FIRST optional parameter in composable declarations." In Kotlin, optional parameters must come after required parameters. modifier should be moved to after all required parameters in both functions.
FIGMA
WeatherCard,WeatherEditScreen, andWeatherPreviewScreento the v61 designshowTitle/showDescription/showCurrentFee/showNextBlockFeetoggles with a singleselectedOption(current fee in fiat, current fee in sats, or next block inclusion)AppWidgetConfigActivity/ preferences store / refresh workerWeatherConfigContentfor the OS widget config flow with the new option listDescription
WeatherGlanceWidgetusesSizeMode.Responsivewith the sharedCOMPACT_WIDGET_SIZE/WIDE_WIDGET_SIZEthresholds. Wide layout puts the title, description, and selected fee block on the left with the weather emoji at 72sp on the right; Compact stacks the emoji on top with a short condition title and the fee block below. The selected fee value uses the condition color (green / yellow / red) fromFeeCondition.In-app,
WeatherCardis split into wide / compact variants andWeatherPreviewScreenmirrors Headlines / Blocks / Facts (top-bar, description, divider,WidgetSizeCarousel, Save / Delete).WeatherEditScreenis rebuilt around the new single-option model and removes the title / description / show-toggles UI. The sharedAppWidgetConfigActivityplumbing now supportsAppWidgetType.WEATHERviaWeatherConfigContentand the newHomeWeatherPreferencesprojection onAppWidgetEntry.MigrationServicemaps the legacyshowMedian/showNextBlockFeeflags onto the newWeatherDataOptionenum (CURRENT_FEE_FIAT/CURRENT_FEE_SATS/NEXT_BLOCK_INCLUSION), defaulting toCURRENT_FEE_FIAT. Legacy on-disk JSON is safe (ignoreUnknownKeys = true).Manifest and
appwidget_info_weather.xmlregister the provider with the shared default placement and resize bounds, and string resources gain*__short_titlevariants pluswidgets__widget__display.Preview
os-widget.webm
in-app-widget.webm
QA Notes
System widget
FeeCondition(green / yellow / red).CURRENT_FEE_FIAT).appwidget_data.json.In-app widget
Show Title/Show Description/Show Sourcetoggles). Switching between options updates the live card.WeatherCardon Home reflects v61 and the chosen option.{"showStatus": true, "showText": false, "showMedian": true, "showNextBlockFee": false}on disk — app launches without serialization errors and the widget defaults to current-fee-fiat (or next-block-inclusion if the legacy flag was set).