Skip to content

refactor(chat): build the attach actions once for both hosts - #1056

Merged
bmc08gt merged 1 commit into
mainfrom
refactor/chat-attach-actions
Oct 14, 2026
Merged

bmc08gt merged 1 commit into
mainfrom
refactor/chat-attach-actions

Conversation

@bmc08gt

@bmc08gt bmc08gt commented Oct 14, 2026

Copy link
Copy Markdown
Collaborator

The attach menu and card callbacks were written out three times: in ChatScreenRepresentable for the overlay over the keyboard, again as six parameters on ConversationBottomBar, and a third time when the bar repackaged those into AttachOverlayActions. The copies had already drifted: only the overlay's set onAllPhotos. The overlay also kept the value it was handed in begin, so it never saw a later render's closures.

  • AttachOverlayActions becomes AttachActions and moves to AttachSurface.swift, next to the view that draws it, since the bar is a consumer now too.
  • The representable builds one value per render. The bar takes it as a single attachActions parameter in place of the six.
  • The overlay reads the latest value through a closure each time its root renders, and sets onAllPhotos to its own hand-off, because only a card in the keyboard's window can't present the full picker. handOffToBar() is private as a result.

No behaviour change intended. All Photos still opens the full picker in place with the keyboard down, and hands the card to the bar with it up.

This and #1053 both edit attachSurface in ConversationBottomBar.swift, so whichever merges second needs a rebase.

The menu and card callbacks were written out three times: once for the
overlay over the keyboard, once as the bar's six parameters, and again
when the bar repackaged those into AttachOverlayActions. The copies had
already drifted on onAllPhotos, and the overlay kept the value it was
handed when it opened, so it never saw a later render's closures.

The representable now builds one AttachActions per render and gives it
to the bar as a single parameter. The overlay reads it through a closure
each time its root renders, and sets onAllPhotos itself, since only a
card drawn in the keyboard's window has to hand All Photos to the bar.
handOffToBar is private to the overlay as a result.
@bmc08gt bmc08gt self-assigned this Oct 14, 2026
@bmc08gt
bmc08gt added this pull request to stack #1063 October 14, 2026 19:25
@bmc08gt
bmc08gt merged commit 3e17fb2 into main Oct 14, 2026
2 of 3 checks passed
bmc08gt added a commit that referenced this pull request Oct 14, 2026
* commit '16a24ad1eb3eeac2097eac72d32150ba2c368f18':
  fix(ui): draw UIKit caption in Avenir Medium like SwiftUI (#1064)
  fix(members): host chip and member count label to match Android (#1058)
  chore(chat): log the attach lifecycle the same way in both hosts (#1062)
  refactor(chat): decide attach close events in one place (#1061)
  refactor(chat): measure the attach card's frame once (#1060)
  refactor(chat): read the attach menu rows live over the keyboard (#1059)
  refactor(chat): build the attach actions once for both hosts (#1056)
  fix(chat): render system messages in the transcript (#1054)

# Conflicts:
#	Flipcash/Core/Screens/Conversation/ChatScreenRepresentable.swift
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