Move the Demo app from ObservableObject to the Observation framework
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 45/100
- Tipo de issue
- Refactorización
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- ios, macos, swift
- Área
- desktop-dev, mobile-dev
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Swift
- Estrellas
- 2.9k
- Forks
- 519
- Merge medio
- 2 d 14 h
- PR fusionados (30 d)
- 8
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de MacPaw/OpenAI
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 2 días
-
Enable batch promptsAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
MacPaw/OpenAI#73 · 1 comentario · 1 reacción ·
Los mantenedores suelen responder en 2 días
-
bug
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
Los mantenedores suelen responder en 2 días
-
Wiz-remediation
Dificultad 5/5 Más de una semana Aptitud para principiantes 1/100
Los mantenedores suelen responder en 2 días
-
Check the HTTP status code for JSON responsesPosiblemente ocupada @mvanhorn la tomó hace 19 días. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
MacPaw/OpenAI#469 · 1 comentario ·
Los mantenedores suelen responder en 2 días
Todos los issues de MacPaw/OpenAI
Issues similares
-
needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
manaflow-ai/cmux#32617 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
skiptools/skip-fuse-ui#166 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
runjuu/InputSourcePro#153 · 1 comentario ·
-
Requirement is wrongAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
remko/age-plugin-se#25 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
peteromallet/desloppify#942 ·