Files
orca/config/patches/@radix-ui__react-collapsible@1.1.20.patch
Brennan Benson ece3008ad5 Pause hidden chats to speed up switching (#42710)
* refactor: give chat tabs ownership of composer editors

* Retain pasted-text file paths with composer undo history

* Keep composer selection ownership with its editor

* perf: suspend hidden structured chat effects with Activity

* fix: keep pending chat actions independent of view replay

* Preserve hidden chat handoff and pending host actions

* Keep autocomplete ref writes in their owning hook

* Preserve disclosure geometry and pending images across chat reveals

* Use the native Blob implementation for image lifetime coverage

* Retain sent messages while hidden chats await history

* Wait for the held send request before hiding its test pane

* Preserve pending host reconnect state across chat switches

* Reset retained outage state after a hidden host recovery

* Observe retained chat outage transitions through shared host subscriptions

* Start outage observation for initially hidden chats

* Keep chat feedback timers alive across hidden views

* Settle the retained rail while its view ref is disconnected

* Track the rail node lit by the latest wake

* Preserve the lit rail when hidden input has no view node
2026-11-16 02:35:23 -08:00

61 lines
2.3 KiB
Diff

diff --git a/dist/index.mjs b/dist/index.mjs
--- a/dist/index.mjs
+++ b/dist/index.mjs
@@ -97,13 +97,24 @@
const isOpen = context.open || isPresent;
const isMountAnimationPreventedRef = React.useRef(isOpen);
const originalStylesRef = React.useRef(void 0);
- React.useEffect(() => {
+ useLayoutEffect(() => {
+ const node = ref.current;
const rAF = requestAnimationFrame(() => isMountAnimationPreventedRef.current = false);
- return () => cancelAnimationFrame(rAF);
+ return () => {
+ cancelAnimationFrame(rAF);
+ isMountAnimationPreventedRef.current = true;
+ if (node?.getAttribute("data-state") === "open") {
+ node.style.transitionDuration = "0s";
+ node.style.animationName = "none";
+ }
+ };
}, []);
useLayoutEffect(() => {
const node = ref.current;
if (node) {
+ if (originalStylesRef.current && !context.open) {
+ isMountAnimationPreventedRef.current = false;
+ }
originalStylesRef.current = originalStylesRef.current || {
transitionDuration: node.style.transitionDuration,
animationName: node.style.animationName
diff --git a/dist/index.js b/dist/index.js
--- a/dist/index.js
+++ b/dist/index.js
@@ -137,13 +137,24 @@
const isOpen = context.open || isPresent;
const isMountAnimationPreventedRef = React.useRef(isOpen);
const originalStylesRef = React.useRef(void 0);
- React.useEffect(() => {
+ (0, import_react_use_layout_effect.useLayoutEffect)(() => {
+ const node = ref.current;
const rAF = requestAnimationFrame(() => isMountAnimationPreventedRef.current = false);
- return () => cancelAnimationFrame(rAF);
+ return () => {
+ cancelAnimationFrame(rAF);
+ isMountAnimationPreventedRef.current = true;
+ if (node?.getAttribute("data-state") === "open") {
+ node.style.transitionDuration = "0s";
+ node.style.animationName = "none";
+ }
+ };
}, []);
(0, import_react_use_layout_effect.useLayoutEffect)(() => {
const node = ref.current;
if (node) {
+ if (originalStylesRef.current && !context.open) {
+ isMountAnimationPreventedRef.current = false;
+ }
originalStylesRef.current = originalStylesRef.current || {
transitionDuration: node.style.transitionDuration,
animationName: node.style.animationName