Skip to content

refactor(chat): measure the attach card's frame once - #1060

Merged
bmc08gt merged 1 commit into
refactor/chat-attach-live-rowsfrom
refactor/chat-attach-card-frame
Oct 14, 2026
Merged

bmc08gt merged 1 commit into
refactor/chat-attach-live-rowsfrom
refactor/chat-attach-card-frame

Conversation

@bmc08gt

@bmc08gt bmc08gt commented Oct 14, 2026

Copy link
Copy Markdown
Collaborator

The bar and the overlay measured the attach card's frame two different ways. The bar used UIApplication.shared.currentKeyWindow's bounds, with a row-based fallback when there was no key window, and took the top of its touch band from the card's reported layout. The overlay used its own container's size. The two could disagree, and the band's top was only right while the app's window was key. A band top that's too low leaves the card drawn but the area above the bar dead to touches.

  • AttachCard records the bounds of the screen's own window when it's measured or opened, and exposes frame in window coordinates.
  • The bar, the overlay and the touch band all read that one frame.
  • ConversationBarModel.cardTop, the fallback AttachSurfaceLayout.barCardRect and the overlay's size state are removed.

No behaviour change intended while the app's window is key.

Stacked on #1059. #1053 still sets model.cardTop, which this removes, so whichever merges second has a one-line conflict: log attachCard.frame.minY instead.

The bar placed the card from `UIApplication.shared.currentKeyWindow`'s
bounds, with a row-based fallback when there was no key window, and took
the top of its touch band from the card's reported layout. The overlay
placed the same card from its own container's size. Two measurements of
one rect could disagree, and the band top only stayed right while the
app's window was key.

`AttachCard` now records the bounds of the screen's own window when it is
measured or opened, and exposes `frame` in window coordinates. The bar,
the overlay and the band all read it, so `ConversationBarModel.cardTop`,
the fallback `AttachSurfaceLayout.barCardRect` and the overlay's size
state go.
@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 e82aa8a 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