Skip to content

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

Release System 0.1.38

zohayrslileh728e2f37801c
diff --git a/package.json b/package.json
index 82c3a51..9111e64 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"name": "phreshos",
"displayName": "PhreshOS",
- "version": "0.1.37",
+ "version": "0.1.38",
"description": "The PhreshOS server, desktop, and authoritative system runtime.",
"type": "module",
"private": true,
diff --git a/scripts/contracts/gateway.ts b/scripts/contracts/gateway.ts
index 6595a2d..1a9ce56 100644
--- a/scripts/contracts/gateway.ts
+++ b/scripts/contracts/gateway.ts
@@ -1,12 +1,13 @@
import assert from "node:assert/strict"
import { mkdtemp, rm } from "node:fs/promises"
import { connect } from "node:net"
-import { join, resolve } from "node:path"
+import { resolve } from "node:path"
+import gatewayAddress from "@server/view/gateway/address"
import gateway from "@server/view/gateway/gateway"
import type Application from "@server/core/application"
const directory = await mkdtemp(resolve(".verify-gateway-"))
-const path = join(directory, "gateway.sock")
+const path = gatewayAddress(directory)
const application = {
systemControl: {
async execute(request: unknown) { return { received: request } }
diff --git a/source/client/view/appearance/motion.ts b/source/client/view/appearance/motion.ts
index 0b49c2e..5261408 100644
--- a/source/client/view/appearance/motion.ts
+++ b/source/client/view/appearance/motion.ts
@@ -14,6 +14,19 @@ const curves: Record<Exclude<Easing, readonly number[]>, readonly [number, numbe
const registered = new Map<string, gsap.EaseFunction>()
+/** Shared interaction timings in the same millisecond unit as public transactions. */
+export const motionDurations = Object.freeze({
+ control: 100,
+ minimize: 110,
+ close: 160,
+ snap: 180,
+ feedback: 200,
+ morph: 220,
+ presence: 240,
+ restore: 240,
+ geometry: 300
+})
+
/** Preserves public CSS timing curves while GSAP owns their interpolation. */
export function motionEase(value: Easing | undefined, fallback: Easing = "ease-out") {
diff --git a/source/client/view/appearance/surface-presence.ts b/source/client/view/appearance/surface-presence.ts
index cb13ef0..505875b 100644
--- a/source/client/view/appearance/surface-presence.ts
+++ b/source/client/view/appearance/surface-presence.ts
@@ -1,8 +1,8 @@
-import gsap from "./motion"
+import gsap, { motionDuration, motionDurations } from "./motion"
const entered = { scale: 1, y: 0 }
-const entering = { scale: 0.92, y: 14 }
+const entering = { scale: 0.96, y: 8 }
/** Establish the first frame before a surface becomes visible. */
export function prepareSurfaceEntrance(surface: HTMLElement | null, reducedMotion: boolean) {
@@ -28,7 +28,12 @@ export function enterSurface(surface: HTMLElement | null, reducedMotion: boolean
return null
}
- return gsap.to(surface, { ...entered, duration: 0.24, ease: "back.out(1.6)" })
+ return gsap.to(surface, {
+ ...entered,
+ duration: motionDuration(motionDurations.presence),
+ ease: "power3.out",
+ overwrite: "auto"
+ })
}
/** Stop presence motion and leave the surface ready for its next entrance. */
diff --git a/source/client/view/structure/authentication/credentials-form.tsx b/source/client/view/structure/authentication/credentials-form.tsx
index 3ff5f80..4436b70 100644
--- a/source/client/view/structure/authentication/credentials-form.tsx
+++ b/source/client/view/structure/authentication/credentials-form.tsx
@@ -51,7 +51,7 @@ export default function CredentialsForm({ title, description, submitLabel, passw
style={{ borderRadius: outerRadius }}
- className="relative isolate m-auto grid w-[min(24rem,calc(100%-2rem))] grid-rows-[auto_minmax(0,1fr)] overflow-hidden text-slate-800 shadow-window-active"
+ className="relative isolate m-auto grid w-[min(24rem,calc(100%-2rem))] grid-rows-[auto_minmax(0,1fr)] text-slate-800 shadow-window-active"
onSubmit={submit}
diff --git a/source/client/view/structure/desktop/desktop.tsx b/source/client/view/structure/desktop/desktop.tsx
index 1abf3ad..5d56db6 100644
--- a/source/client/view/structure/desktop/desktop.tsx
+++ b/source/client/view/structure/desktop/desktop.tsx
@@ -175,7 +175,7 @@ export default function Workspace() {
dialogs={<SystemDialogs />}
- className="z-4 overflow-hidden"
+ className="z-4"
>
diff --git a/source/client/view/structure/desktop/taskbar/taskbar-surface.tsx b/source/client/view/structure/desktop/taskbar/taskbar-surface.tsx
index 000e603..cf3c36f 100644
--- a/source/client/view/structure/desktop/taskbar/taskbar-surface.tsx
+++ b/source/client/view/structure/desktop/taskbar/taskbar-surface.tsx
@@ -2,13 +2,13 @@ import { ReactNode } from "react"
import { Surface, useAppearance, useResolveTheme, useScale } from "@phreshos/react-ui"
/** The window-material shell shared by surfaces opened from the taskbar. */
-export const taskbarSurfaceClassName = "m-0 isolate overflow-hidden border-0 bg-transparent p-0 shadow-window-active outline-none"
+export const taskbarSurfaceClassName = "m-0 isolate border-0 bg-transparent p-0 shadow-window-active outline-none"
export default function TaskbarSurface({ label, labelId, children }: TaskbarSurfaceProps) {
const contentRadius = useScale(useResolveTheme(useAppearance().radius)).medium
- return <Surface className="grid min-h-0 max-h-[inherit] grid-rows-[auto_minmax(0,1fr)] overflow-hidden rounded-[inherit]">
+ return <Surface className="grid min-h-0 max-h-[inherit] grid-rows-[auto_minmax(0,1fr)] rounded-[inherit]">
<h2 id={labelId} className="relative grid h-10 items-center px-3.5 text-window-title font-medium select-none">{label}</h2>
diff --git a/source/client/view/structure/desktop/taskbar/taskbar.tsx b/source/client/view/structure/desktop/taskbar/taskbar.tsx
index 034ada9..4356811 100644
--- a/source/client/view/structure/desktop/taskbar/taskbar.tsx
+++ b/source/client/view/structure/desktop/taskbar/taskbar.tsx
@@ -12,7 +12,7 @@ export default function Taskbar({ leading, trailing, dialogs, className, style,
return <Surface
- className={`relative isolate h-taskbar overflow-hidden shadow-taskbar [anchor-name:--desktop-taskbar] ${className ?? ""}`}
+ className={`relative isolate h-taskbar shadow-taskbar [anchor-name:--desktop-taskbar] ${className ?? ""}`}
style={{ ...style, borderRadius: radius }}
diff --git a/source/client/view/structure/desktop/windows/snap-preview.tsx b/source/client/view/structure/desktop/windows/snap-preview.tsx
index e5f8e31..3ebd894 100644
--- a/source/client/view/structure/desktop/windows/snap-preview.tsx
+++ b/source/client/view/structure/desktop/windows/snap-preview.tsx
@@ -1,5 +1,5 @@
import { type CSSProperties, useLayoutEffect, useRef, useState } from "react"
-import gsap, { motionEase } from "../../../appearance/motion"
+import gsap, { motionDuration, motionDurations, motionEase } from "../../../appearance/motion"
import { resolveWindowGeometry, resolveWindowValue, windowPaintInsets, type WindowSurfaceSize } from "../../../components/window-manager/window-geometry"
import { windowPaintInset } from "../geometry"
import { type Position, type Size } from "@phreshos/core"
@@ -54,7 +54,7 @@ export default function SnapPreview({ shown, visible, bare, paintSurfaceSize, ra
width: target.width,
height: target.height,
opacity: visible ? 1 : 0,
- duration: 0.18,
+ duration: motionDuration(motionDurations.snap),
ease: motionEase([0.33, 1, 0.68, 1]),
overwrite: "auto",
onComplete: () => setRendered(shown)
diff --git a/source/client/view/structure/desktop/windows/window-header.tsx b/source/client/view/structure/desktop/windows/window-header.tsx
index aee2344..cd0438b 100644
--- a/source/client/view/structure/desktop/windows/window-header.tsx
+++ b/source/client/view/structure/desktop/windows/window-header.tsx
@@ -1,5 +1,5 @@
import { ComponentProps, PointerEvent as ReactPointerEvent, ReactNode, useLayoutEffect, useRef, useState } from "react"
-import gsap, { motionEase } from "../../../appearance/motion"
+import gsap, { motionDuration, motionDurations, motionEase } from "../../../appearance/motion"
/** The visible chrome above an ordinary window's content. */
export default function WindowHeader({ title, icon, active, whole, reducedMotion, stopping, onGrab, onMinimize, onMaximize, onClose }: WindowHeaderProps) {
@@ -32,7 +32,11 @@ export default function WindowHeader({ title, icon, active, whole, reducedMotion
}
const timeline = gsap.timeline({
- defaults: { duration: 0.2, ease: motionEase("ease-out"), overwrite: "auto" },
+ defaults: {
+ duration: motionDuration(motionDurations.feedback),
+ ease: motionEase("ease-out"),
+ overwrite: "auto"
+ },
onComplete: () => setRenderedActive(active)
})
@@ -138,7 +142,12 @@ function Control({ label, danger = false, focusOnPointerDown = true, reducedMoti
if (reducedMotion) gsap.set(button, values)
- else gsap.to(button, { ...values, duration: 0.1, ease: motionEase("ease-out"), overwrite: "auto" })
+ else gsap.to(button, {
+ ...values,
+ duration: motionDuration(motionDurations.control),
+ ease: motionEase("ease-out"),
+ overwrite: "auto"
+ })
}
return <button
diff --git a/source/client/view/structure/desktop/windows/window-surface.tsx b/source/client/view/structure/desktop/windows/window-surface.tsx
index 43470bc..74b538c 100644
--- a/source/client/view/structure/desktop/windows/window-surface.tsx
+++ b/source/client/view/structure/desktop/windows/window-surface.tsx
@@ -2,9 +2,7 @@ import { useReducedMotion } from "@libs/react-motion"
import { Surface } from "@phreshos/react-ui"
import { useLayoutEffect, useRef } from "react"
import { type LocalSurfaceState } from "../../../components/desktop-host/local-window"
-import gsap, { motionDuration, motionEase } from "../../../appearance/motion"
-
-const systemDuration = 240
+import gsap, { motionDuration, motionDurations, motionEase } from "../../../appearance/motion"
const paintSelector = "[data-surface-backdrop], [data-surface-border], [data-surface-material]"
@@ -46,7 +44,7 @@ export default function WindowSurface({ state, onComplete }: WindowSurfaceProps)
const transaction = transition?.transaction
- const duration = transaction?.duration ?? systemDuration
+ const duration = transaction?.duration ?? motionDurations.presence
gsap.killTweensOf(layers)
diff --git a/source/client/view/structure/desktop/windows/window.tsx b/source/client/view/structure/desktop/windows/window.tsx
index 62593a2..cf70ccf 100644
--- a/source/client/view/structure/desktop/windows/window.tsx
+++ b/source/client/view/structure/desktop/windows/window.tsx
@@ -8,7 +8,7 @@ import WindowHeader from "./window-header"
import WindowSurface from "./window-surface"
import { type LocalAnimation, type LocalSurfaceState } from "../../../components/desktop-host/local-window"
import { type LocalGeometryReader } from "../../../components/window-manager/local-windows"
-import gsap, { motionDuration, motionEase } from "../../../appearance/motion"
+import gsap, { motionDuration, motionDurations, motionEase } from "../../../appearance/motion"
import SnapPreview, { type SnapTarget } from "./snap-preview"
import { windowPaintInset } from "../geometry"
@@ -127,7 +127,7 @@ export default function ({ title, icon, children, onClose, onClosed, onMinimize,
}
const target = resolveWindowGeometry(position, size, parentBounds)
const transaction = geometryAnimation?.transaction
- const duration = transaction?.duration ?? 300
+ const duration = transaction?.duration ?? motionDurations.geometry
gsap.killTweensOf(element)
@@ -146,22 +146,36 @@ export default function ({ title, icon, children, onClose, onClosed, onMinimize,
return
}
- const animation = gsap.fromTo(element, {
- left: current.x,
- top: current.y,
- width: current.width,
- height: current.height,
- transform: "none"
- }, {
+ // Lay out the authoritative target once, then animate only the visual
+ // difference. Reflowing an iframe-sized box on every animation frame
+ // causes the small hitch this transition is meant to hide.
+ gsap.set(element, {
left: target.x,
top: target.y,
width: target.width,
height: target.height,
- transform: "none",
+ transformOrigin: "0 0"
+ })
+
+ const animation = gsap.fromTo(element, {
+ x: current.x - target.x,
+ y: current.y - target.y,
+ scaleX: current.width / target.width,
+ scaleY: current.height / target.height
+ }, {
+ x: 0,
+ y: 0,
+ scaleX: 1,
+ scaleY: 1,
duration: motionDuration(duration),
- ease: transaction ? motionEase(transaction.easing) : motionEase([0.65, 0, 0.35, 1]),
+ ease: transaction ? motionEase(transaction.easing) : motionEase([0.33, 1, 0.68, 1]),
+ force3D: true,
overwrite: "auto",
- onComplete: complete
+ onComplete: function () {
+
+ gsap.set(element, { transform: "none", transformOrigin: "" })
+ complete()
+ }
})
return function () {
@@ -199,7 +213,7 @@ export default function ({ title, icon, children, onClose, onClosed, onMinimize,
top: gesture.origin.y,
width: gesture.current.width,
height: gesture.current.height,
- duration: 0.22,
+ duration: motionDuration(motionDurations.morph),
ease: motionEase([0.33, 1, 0.68, 1]),
overwrite: "auto"
})
@@ -229,7 +243,7 @@ export default function ({ title, icon, children, onClose, onClosed, onMinimize,
const animation = gsap.to(element, {
boxShadow: target,
- duration: 0.2,
+ duration: motionDuration(motionDurations.feedback),
ease: motionEase("ease-out"),
overwrite: "auto",
onComplete: () => setRenderedActive(active)
@@ -366,9 +380,9 @@ export default function ({ title, icon, children, onClose, onClosed, onMinimize,
const animation = minimized
- ? gsap.to(surfaceElement.current, { scale: 0.86, y: 28, duration: 0.11, ease: "power3.in", onComplete: () => gsap.set(surfaceElement.current, { visibility: "hidden" }) })
+ ? gsap.to(surfaceElement.current, { scale: 0.86, y: 28, duration: motionDuration(motionDurations.minimize), ease: "power3.in", overwrite: "auto", onComplete: () => gsap.set(surfaceElement.current, { visibility: "hidden" }) })
- : gsap.to(surfaceElement.current, { scale: 1, y: 0, duration: 0.24, ease: "power3.out" })
+ : gsap.to(surfaceElement.current, { scale: 1, y: 0, duration: motionDuration(motionDurations.restore), ease: "power3.out", overwrite: "auto" })
return () => { animation.kill() }
@@ -392,7 +406,14 @@ export default function ({ title, icon, children, onClose, onClosed, onMinimize,
return
}
- const animation = gsap.to(surfaceElement.current, { scale: 0.86, y: 12, duration: 0.16, ease: "power2.in", onComplete: completeClosure })
+ const animation = gsap.to(surfaceElement.current, {
+ scale: 0.86,
+ y: 12,
+ duration: motionDuration(motionDurations.close),
+ ease: "power2.in",
+ overwrite: "auto",
+ onComplete: completeClosure
+ })
return () => { animation.kill() }
@@ -727,7 +748,7 @@ export default function ({ title, icon, children, onClose, onClosed, onMinimize,
Bare, there is no difference: the frame fills the box, so
the window is exactly as large as it asked to be and its
boundaries are the ones its own content draws. */}
- <div data-window-container ref={surfaceElement} style={bare ? undefined : { ...paintedInsets, borderRadius: outerRadius, color: foreground }} className={`absolute isolate grid ${bare ? "inset-0 grid-rows-1" : `overflow-hidden grid-rows-[auto_minmax(0,1fr)] ${surface}`}`}>
+ <div data-window-container ref={surfaceElement} style={bare ? undefined : { ...paintedInsets, borderRadius: outerRadius, color: foreground }} className={`absolute isolate grid ${bare ? "inset-0 grid-rows-1" : `grid-rows-[auto_minmax(0,1fr)] ${surface}`}`}>
{/* Material is paint, not the interaction container. Keeping
it as a sibling behind the window contents prevents plain