Keep Edit Widget choices when an app moves an existing configurable widget to Voltra

Aperta
#393 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@mrevanzak ci sta già lavorando.

Dal 24/11/2026.

  • #394 di @mrevanzak — aperta

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
40/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
json, react-native, swift, typescript

Direzione di ricerca

Start in the config plugin's app.json schema and prebuild validation, then follow the codegen that emits the VoltraWidget_<id>_Intent and VoltraWidget_<id>_<param>_Choice Swift types. Read #391 for the dynamicOptions parameter handling and #392, which this proposal is a patch on top of. Done means intentName and entityName are accepted, default to today's names, invalid Swift identifiers are rejected at prebuild, and two widgets sharing a name generate one intent type.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

An app that moves a configurable widget from hand-written WidgetKit code to Voltra resets every placed widget's Edit Widget choices on update. iOS saves a placed widget's configuration under the Swift type names of its WidgetConfigurationIntent and of the AppEntity values in it. Voltra generates its own names (VoltraWidget_<id>_Intent, VoltraWidget_<id>_<param>_Choice), so the saved configuration no longer matches and each widget falls back to its default. Ours had a masjid picker, so after updating, people who picked a masjid other than their first would see the wrong one until they picked it again.

Proposal: let app.json name those types.

"appIntent": {
  "intentName": "SelectMasjidConfigurationAppIntent",
  "parameters": [
    { "name": "masjid", "title": "Masjid", "dynamicOptions": true, "entityName": "FollowedMasjid" }
  ]
}
  • appIntent.intentName names the generated WidgetConfigurationIntent.
  • entityName on a dynamicOptions parameter (#391) names the generated AppEntity, and its query becomes <entityName>Query.
  • Widgets can share an intent, as ours did: two widgets with the same name use one type, generated once.

Both default to today's names, and prebuild rejects a value that isn't a Swift identifier.

We run this as a patch on top of #392. On a simulator, a widget placed and configured with our old hand-written build kept its choice after installing the Voltra build over it. The old entity's id was an Int and the generated one is a String, and the extension's module name changed too; neither stopped the configuration from carrying over.

Lingua principale
TypeScript
Stelle
865
Fork
50
Merge medio
2g 22h
PR unite (30g)
18

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di callstackincubator/voltra

Tutte le issue di callstackincubator/voltra

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.