Skip to content

Commit 6c5856c

Browse files
committed
chore: add ADR
1 parent 77ef97e commit 6c5856c

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

OVERLAY_CLOSING_PORTAL_NOTES.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Overlay Closing Portal Notes
2+
3+
Status: `WIP / parked for now`
4+
Date: `2026-03-04`
5+
6+
## Goal
7+
8+
During message overlay close animations, keep selected UI (for example message input, header) visually above the animating message by teleporting those views into overlay-hosted slots.
9+
10+
## What We Agreed
11+
12+
1. The overall idea is valid and should be kept.
13+
2. Current implementation is too unstable/perf-heavy on Android and is parked for now.
14+
3. The long-term direction is:
15+
- keep less state in JS,
16+
- keep more geometry/animation state on the UI thread (Reanimated shared values),
17+
- keep JS coordination minimal.
18+
19+
## Current Constraints
20+
21+
1. Avoid frequent `measureInWindow` calls during close animation on Android (perf issues).
22+
2. If measuring is needed, prefer one-time measurement with explicit invalidation points.
23+
3. `onLayout` local coordinates (`x/y`) are not sufficient for absolute overlay placement.
24+
4. Safe-area handling differs on Android and must be normalized consistently with overlay coordinate space.
25+
26+
## Known Problems Encountered
27+
28+
1. Registration/render timing issues when portals/hosts switch during close.
29+
2. Coordinate-space mismatch (`onLayout` local coords vs absolute screen placement).
30+
3. Android jank when repeatedly measuring/updating layout in JS during animation.
31+
32+
## Implementation Direction (Next Iteration)
33+
34+
1. Keep JS as registration/metadata layer only.
35+
2. Move live layout + transition math to UI thread shared values.
36+
3. Use stable, persistent portal hosts where possible; avoid mount/unmount races at close time.
37+
4. Add a lightweight debug mode to visualize slot rectangles and host resolution.
38+
39+
## Explicitly Parked
40+
41+
The current Android behavior for generalized closing portal teleports is not production-ready and is intentionally not being shipped as-is.
42+
43+
## Session Handoff
44+
45+
When resuming, reference this file and continue from the “Implementation Direction (Next Iteration)” section.

0 commit comments

Comments
 (0)