ServerDrawer: match the quest dock card by shape, not exact color string

This commit is contained in:
Ally Founder 2026-08-11 18:29:07 -04:00
parent 153c06d2d5
commit 359ed2e0d0

View file

@ -3,9 +3,12 @@ import { registerPropsTransform } from "./createElementIntercept";
const TAG = "[ServerDrawer]";
// Confirmed live: the quest dock's outer "island" wrapper - a ReanimatedView ten levels above the
// drawer's own grid - carries this exact opaque card background via useAnimatedStyle. It's not
// anything our own code renders, so there's no component reference to intercept - matching the
// static part of its computed style is the only way to reach it.
// drawer's own grid - carries an opaque card background (borderRadius: 24) via useAnimatedStyle.
// It's not anything our own code renders, so there's no component reference to intercept - matching
// the static part of its computed style is the only way to reach it. The color itself showed up as
// two different string formats (rgba(...) vs hex) across two live reads of the same element, so
// matching on the exact color string is unreliable - borderRadius plus "has some background color
// at all" is the stable signal.
function flatten(style: any): Record<string, any> {
if (!style) return {};
if (Array.isArray(style)) return Object.assign({}, ...style.map(flatten));
@ -14,7 +17,7 @@ function flatten(style: any): Record<string, any> {
function isQuestDockCard(props: any): boolean {
const s = flatten(props?.style);
return s.backgroundColor === "rgba(10,10,14,1)" && s.borderRadius === 24;
return s.borderRadius === 24 && typeof s.backgroundColor === "string";
}
export function patchTransparentBackground(cleanups: (() => void)[]): boolean {