Skip to content

An open-source, self-hosted system for apps built with web technologies.

A standard Window moves visibly when one of its ends is on the screen, and is simply there between unseen views

zohayrslileh83bb9e88c77e
diff --git a/source/client/view/structure/desktop/windows/window-geometry-motion.ts b/source/client/view/structure/desktop/windows/window-geometry-motion.ts
index 5023480..000098f 100644
--- a/source/client/view/structure/desktop/windows/window-geometry-motion.ts
+++ b/source/client/view/structure/desktop/windows/window-geometry-motion.ts
@@ -13,7 +13,7 @@ interface WindowGeometryMotionOptions {
animation?: PresentationAnimation | null
transaction?: PresentationTransaction | null
immediate: boolean
- /** Moves visibly only between two places the person can see; otherwise it is simply there. */
+ /** Moves visibly only when the person can see where it starts or where it ends; otherwise it is simply there. */
seenOnly?: boolean
minimumSize?: WindowSurfaceSize
onComplete?: (revision: number) => void
@@ -118,8 +118,8 @@ export default function useWindowGeometryMotion({ position, size, animation, tra
return values.current.minimumSize ? constrainWindowGeometry(region, surface, values.current.minimumSize) : region
}
- /** Whether the person can see where the box is now and where it is going: both touch the screen. */
- function seenThroughout(region: WindowRegion) {
+ /** Whether the person can see where the box is now or where it is going: either touches the screen. */
+ function seenAtAnEnd(region: WindowRegion) {
const parent = frame.current?.parentElement
@@ -128,7 +128,7 @@ export default function useWindowGeometryMotion({ position, size, animation, tra
const surface = logicalSize(parent)
const seen = (shown: WindowRegion) => shown.x < surface.width && shown.x + shown.width > 0 && shown.y < surface.height && shown.y + shown.height > 0
- return seen(read()) && seen(region)
+ return seen(read()) || seen(region)
}
useLayoutEffect(function () {
@@ -155,9 +155,9 @@ export default function useWindowGeometryMotion({ position, size, animation, tra
? null
: resolveWindowTransaction(transaction, appearanceTransaction)
- // A motion shows where something went; from or to a place the person does not see, there
- // is nothing to show, and a path across the screen would only distract.
- if (!selected || (values.current.seenOnly && !seenThroughout(region))) {
+ // A motion shows where something went or where it came from; between two places the person
+ // does not see, there is nothing to show, and a path across the screen would only distract.
+ if (!selected || (values.current.seenOnly && !seenAtAnEnd(region))) {
set(region)
if (revision !== undefined) onComplete?.(revision)
return
diff --git a/source/client/view/structure/desktop/windows/window.tsx b/source/client/view/structure/desktop/windows/window.tsx
index 948c696..92d2711 100644
--- a/source/client/view/structure/desktop/windows/window.tsx
+++ b/source/client/view/structure/desktop/windows/window.tsx
@@ -97,8 +97,8 @@ export default function ({ title, header = true, surface, layer, icon, children,
size: presented.current.size,
animation: geometryAnimation,
immediate: reducedMotion,
- // The Desktop moves its own Windows visibly only where the person sees both ends; a raw
- // drawing moves the way its Program asked.
+ // The Desktop moves its own Windows visibly only when the person sees one end or both; a
+ // raw drawing moves the way its Program asked.
seenOnly: standard,
minimumSize: presentationMinimum,
onComplete: revision => onPresentationAnimationComplete?.("geometry", revision)