feat(webui): add adaptive pointer interactions

Introduce a CSS-driven adaptive cursor that morphs for controls, text editing, dragging, resizing, busy states, and other native pointer semantics on desktop devices.

Add a themed context menu for editing, selections, links, images, and page navigation while preserving explicit native-menu escape paths. Store a default-on interaction preference through the normalized appearance model and cover its migration and opt-out behavior.
This commit is contained in:
DrSmoothl committed 2026-07-18 23:38:43 +08:00
1 parent c15625dbd8
commit d40c803ed9
9 files changed
+1339 -1

No files matched your search

+4
View File
@@ -100,6 +100,8 @@ export interface UiAppearance {
reduceMotion: boolean;
/** Hard-disable all UI animations (stronger than reduceMotion). */
disableMotion: boolean;
/** Use SnowLuma's adaptive cursor and custom context menu. */
customPointerSystem: boolean;
highContrast: boolean;
sidebarPinned: boolean;
timeFormat: TimeFormat;
@@ -226,6 +228,7 @@ const DEFAULT_APPEARANCE: UiAppearance = {
density: 'cozy',
reduceMotion: false,
disableMotion: false,
customPointerSystem: true,
highContrast: false,
sidebarPinned: false,
timeFormat: '24h',
@@ -520,6 +523,7 @@ export function normalizeAppearance(value: unknown, imageState: ServerImageState
density: oneOf<Density>(v.density, ['cozy', 'compact'], DEFAULT_APPEARANCE.density),
reduceMotion: boolOr(v.reduceMotion, DEFAULT_APPEARANCE.reduceMotion),
disableMotion: boolOr(v.disableMotion, DEFAULT_APPEARANCE.disableMotion),
customPointerSystem: boolOr(v.customPointerSystem, DEFAULT_APPEARANCE.customPointerSystem),
highContrast: boolOr(v.highContrast, DEFAULT_APPEARANCE.highContrast),
sidebarPinned: boolOr(v.sidebarPinned, DEFAULT_APPEARANCE.sidebarPinned),
timeFormat: oneOf<TimeFormat>(v.timeFormat, ['12h', '24h'], DEFAULT_APPEARANCE.timeFormat),