Move the Demo app from ObservableObject to the Observation framework
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 45/100
- issue の種類
- リファクタリング
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- ios, macos, swift
調査の方向性
Start with APIProvidedView.init, where the stores are created, then read ChatStore and ResponsesStore and the list of stores in the issue. Migrate each ObservableObject to @Observable, update view ownership from @StateObject/@ObservedObject to @State/@Bindable, and remove ChatStore.selectedConversationPublisher. The work is done when the listed stores no longer use ObservableObject, store creation happens once, and the Demo builds and runs on iOS 17/macOS 14.
索引モデルが issue の本文から書いたものです。
説明
The Demo app's stores are ObservableObjects. A view that observes one redraws whenever any of its @Published properties changes, whatever the view shows. While a reply streams, ChatStore and ResponsesStore change dozens of times a second, so every view observing them redraws that often too, the app's root included. In one streamed Chats reply (iOS 27 simulator), ChatStore changed 381 times, and APIProvidedView, ContentView, ChatView and the conversation list each redrew 334 times.
With the Observation framework (@Observable), a view redraws only when a property it read changes. The Demo targets iOS 17 and macOS 14, where Observation is available.
The goal is to move the Demo to Observation first, and only then decide whether anything still updates too often and needs pacing. This came up in the review of #475: the conversation list redraws on every streamed change.
Types to move
- Streaming stores:
ChatStore,ResponsesStore - Other stores:
AssistantStore,FilesStore,ImageStore,MCPToolsStore,MiscStore,SpeechStore,ResponsesSettingsStore - View helper:
ChatMessagesPacer, which paces the messages handed to ExyteChat'sChatView
Notes
- Views:
@StateObjectbecomes@State, and@ObservedObjectbecomes a plain property, or@Bindablewhere the view needs bindings (ChatViewbinds$store.conversationsand$store.isSendingMessage). Views that only pass a store on, such asContentView,MiscViewandAssistantsViewwithChatStore, then no longer redraw when it changes. - Creating the stores:
APIProvidedViewcreates them in itsinit.@StateObjectevaluates its initial value once, but@Stateevaluates it on everyinitand keeps only the first, andMCPToolsStorestarts connecting in its owninit. The stores need to be created once some other way. - Combine:
ChatStore.selectedConversationPublisheris built on$selectedConversationID, which@Observabledoesn't provide. Nothing uses it, so it can go.
- 主要言語
- Swift
- スター
- 2.9k
- フォーク
- 519
- 平均マージ
- 2日 14時間
- マージ済み PR(30日)
- 8
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
MacPaw/OpenAI のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 2 日以内に返信
-
Enable batch promptsオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
MacPaw/OpenAI#73 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 2 日以内に返信
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
メンテナーはふだん 2 日以内に返信
-
Wiz-remediation
難易度 5/5 1週間以上 初心者へのやさしさ 1/100
メンテナーはふだん 2 日以内に返信
-
Check the HTTP status code for JSON responses対応中かも @mvanhorn が 16 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
MacPaw/OpenAI#469 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
似ている issue
-
needs-triage S3: minor
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
manaflow-ai/cmux#28422 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 65/100
SwiftOldDriver/iOS-Weekly#5480 ·
-
Seed a JRNYAx price before the last close so asset-detail S1.3 doesn't fail from 08:00Z to the openオープンbug tests
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
lognorman20/monaco#7231 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 5 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 7 日以内に返信