Repository navigation
Conversation
#1954 gave WalletViewModel a defaulted TransactionRouter parameter. The desktop graph sets REQUIRE_OPTIONAL_BINDING, so Metro ignores the default and the graph fails with a missing binding for TransactionRouter. Bind DetailsOnly rather than Android's chat-aware router: desktop doesn't handle the wallet's OpenScreen routes yet, so a route to a DM would go nowhere.
`./gradlew :apps:desktop:reflex` runs ChatsViewModel over seeded chats and
reads one JSON request per line: `{"cmd":"ls"}` returns the screen's node
(state plus its actions and their input schemas), and
`{"cmd":"do","action":...,"input":{...}}` dispatches an action and returns
the node again. Errors come back as unknown_action, bad_input,
bad_request or fixture_violation.
- libs/reflex holds the host: node and action types, a JSON schema built
from each action's serializer, and the request loop.
- The five events the Chats screen sends are now @serializable under short
names and marked PublicAction (ui/navigation). A test checks the node
lists exactly the PublicAction events.
- The fixture fakes ChatCoordinator and builds the rest with real
constructors. Repositories are proxies that record each call to a
ledger and throw; the host turns any recorded call into
fixture_violation, since much of the app swallows the throw in
runCatching.
`./gradlew :apps:desktop:installPuppet` writes build/install/puppet-host/bin/puppet-host, which runs the host on the JDK 21 toolchain without Gradle. A session starts in about 1.5s and its stdout holds only responses; through the Gradle task, every launch paid Gradle's startup and the build script's `VersionCode` line came first. The script points at the built classpath instead of copying jars into a lib/ folder, because several modules build a jar with the same name (core-jvm.jar) and the copies would collide.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
./gradlew :apps:desktop:puppetrunsChatsViewModelover seeded chats with no network, and takes one JSON request per line on stdin:{"cmd":"ls"}returns the Chats node: a state snapshot plus its actions and each action's input schema.{"cmd":"do","action":"FilterSelected","input":{"filter":"Unread"}}dispatches the action and returns the node again.{"ok":false,"error":{"code":...}}withunknown_action(lists the valid actions),bad_input(includes the schema),bad_request, orfixture_violation../gradlew :apps:desktop:installPuppetwritesapps/desktop/build/install/puppet-host/bin/puppet-host, which runs the same host without Gradle, so stdout carries only protocol lines. A session starts in about 1.4 s. The script points at the built classes and libraries instead of copying jars, because two modules produce a jar with the same name.The host is meant to be driven by a shared
puppetCLI that holds the protocol schemas and the behavior tests both platforms run. That repo isn't published yet.Changes
libs/puppet: the host. Node and action types, a JSON schema derived from each action's serializer, and the request loop.FilterSelected,ChipsRevealed,SelectionStarted,SelectionToggled,SelectionEnded) are@Serializableunder short names and implement a newPublicActionmarker inui/navigation.ChatListFilteris@Serializable. A test checks the node lists exactly thePublicActionevents.apps/desktop/.../puppet): fakesChatCoordinatorand builds the rest of the screen's dependencies with their real constructors. Repositories are proxies that record each call to a ledger and then throw. The host reports any recorded call asfixture_violation, because much of the app swallows the throw inrunCatching.The seam is
ChatCoordinatorrather thanChatRepository: the repository is the gRPC-facing layer, and faking above it keeps the coordinator's real list logic out of the test. The fixture is hand-wired instead of a second Metro graph, sinceChatModulebindsRealChatCoordinatorwith no way to override it.Separate fix: desktop graph on
code/cashThe first commit fixes a break already on
code/cash. #1954 gaveWalletViewModela defaultedTransactionRouterparameter, and the desktop graph'sREQUIRE_OPTIONAL_BINDINGignores Kotlin defaults, so Metro reports a missing binding. Desktop now bindsTransactionRouter.DetailsOnly. It doesn't handle the wallet'sOpenScreenroutes yet, so Android's chat-aware router would have nothing to open.