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

Đang mở
#393 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@mrevanzak đang làm issue này rồi.

Từ ngày 24/11/2026.

  • #394 của @mrevanzak — đang mở

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
40/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
json, react-native, swift, typescript
Lĩnh vực
build-system, tooling

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
TypeScript
Star
865
Fork
50
Merge trung bình
2 ngày 22 giờ
Pull request đã merge (30 ngày)
18

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của callstackincubator/voltra

Tất cả issue của callstackincubator/voltra

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.