Skip to content

feat(chats): drive the chat list from ChatsModel and add a Puppet host - #1246

Draft
bmc08gt wants to merge 4 commits into
mainfrom
feat/puppet-chats-host
Draft

bmc08gt wants to merge 4 commits into
mainfrom
feat/puppet-chats-host

Conversation

@bmc08gt

@bmc08gt bmc08gt commented Nov 10, 2026

Copy link
Copy Markdown
Collaborator

TipConversationsScreen ran its own filter, chip and selection rules, so nothing outside a simulator could check them. This moves those rules into ChatsModel in FlipcashCore. It also adds a headless Puppet host that replays the shared Chats behavior files with swift test on the Mac. The orchestrator's puppet CLI can drive the same host as a process.

  • ChatsModel holds the filter, chip reveal and select mode over ChatListProjection. ChatListFilter moves to FlipcashCore with it. The app keeps the chip titles and empty-state messages.
  • The screen reads the model. Opening a chat, the archived list or a new chat goes through ChatsDestination, and the screen maps each case to the existing router push. ChatSelection wraps ChatListSelectionMode, so the tab bar's select actions follow the same rules as the host.
  • ChatsPuppet library and chats-puppet-host executable in FlipcashCoreVectors. The host reads one JSON request per line (ls, do, launch, reset), keeps a stack of pushed screens and offers Back above the root. ChatsBehaviorTests replays Fixtures/behaviors/chats/ through the same handle() the CLI calls.
  • CI: the new targets rename the package's Xcode scheme from FlipcashCoreVectors-Package to FlipcashCoreVectors, so vectors.yml now builds the new name.

The behavior files are synced copies. The canonical files, the protocol and the runner are in code-payments/flipcash-client-orchestrator#127, and the Android host is in code-payments/code-android-app#1974.

AppRouter.Destination stays in the app for now. Moving it into FlipcashCore means moving its 65 cases plus the NavigationPath and withdraw and buy flows that depend on it, so that move will be its own PR.

ChatsModel holds the Chats tab's filter, chip reveal and select mode over
ChatListProjection, so the shared behavior files can run against it with
swift test on the Mac. ChatListFilter moves to FlipcashCore with it; the app
keeps the chip titles and empty messages. The screen doesn't use the model
yet.

ChatsBehaviorTests replays the synced copy in Fixtures/behaviors/chats/.
ChatsPuppetHost moves out of ChatsBehaviorTests into a ChatsPuppet library
in FlipcashCoreVectors, so the test and a new chats-puppet-host executable
answer the same requests. The executable reads one JSON request per line on
stdin (ls, do, reset) for the orchestrator's puppet CLI, in the same shape
as the Android host.

Built with swift build --product chats-puppet-host, it runs on the Mac with
no simulator; the four Chats behavior files take 0.07 s through the CLI.
Adding the ChatsPuppet library and host targets renames the package's
Xcode scheme from FlipcashCoreVectors-Package to FlipcashCoreVectors, so
the vectors job's xcodebuild test call would fail to find its scheme.

SelectionStarted's input schema now lists the optional chatId, matching
what perform accepts and what the Android host reports.
TipConversationsScreen ran its filter, chip and selection rules itself,
so the Puppet host tested a copy the app never used. The screen now
reads ChatsModel's state and sends it actions:

- Opening a chat, the archived list and a new chat go through
  ChatsDestination; the screen maps each to the existing router
  push.
- ChatSelection wraps ChatListSelectionMode from FlipcashCore, so the
  tab bar's select actions and the host share one set of rules.
- The Puppet host answers launch, keeps a stack of pushed screens and
  lends Back above the root. ChatsBehaviorTests replays files through
  the host's handle(), the same path the CLI uses.

navigation.json is the synced copy from the orchestrator.
@bmc08gt bmc08gt self-assigned this Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant