Move and rename DashboardInputEvent->InputEvent

This commit is contained in:
James Babcock committed 2026-08-30 13:02:44 -07:00
1 parent 3e8be93833
commit 80d688dd4e
51 files changed
+299 -361

No files matched your search

+6 -11
View File
@@ -15,15 +15,10 @@ import {
fireTimerNotification,
scheduleTimerNotification,
} from "../../native/timer-notifications";
import type { DashboardInputEvent } from "../../ui/layers";
import { defaultWindowMenuItems, WindowMenu } from "../../ui/window-menu";
import type { WorkerAppMessage, WorkerAppReply } from "../../ui/shell/worker-window";
import type { ToolResult, ToolSpec } from "../../assistant/tool-registry";
import {
GESTURE_CLICK,
GESTURE_DOUBLE_CLICK,
GESTURE_SCROLL,
} from "../../ui/gestures";
import { GESTURE_CLICK, GESTURE_DOUBLE_CLICK, GESTURE_SCROLL, type InputEvent } from "../../ui/gestures";
import { clamp } from "../../util/numeric-util";
declare const global: any;
@@ -165,7 +160,7 @@ global.onmessage = (event: { data: WorkerAppMessage }) => {
// Marks the main-thread -> worker hop, which is otherwise an
// unexplained gap inside the shell's handle-input span.
frameTimings.logFrame(message.frameId, `input received in ${message.windowId} worker`);
handleInput(window, message.event as DashboardInputEvent, message.frameId);
handleInput(window, message.event as InputEvent, message.frameId);
break;
}
case "render": {
@@ -302,7 +297,7 @@ function windowMenu(window: TimerWindow): WindowMenu {
return window.menu;
}
function handleInput(window: TimerWindow, event: DashboardInputEvent, frameId: number): void {
function handleInput(window: TimerWindow, event: InputEvent, frameId: number): void {
// An open window menu owns all input (it closes itself via pop).
if (window.menu?.isOpen()) {
window.menu
@@ -338,7 +333,7 @@ function handleInput(window: TimerWindow, event: DashboardInputEvent, frameId: n
}
}
function handleStopwatchInput(window: TimerWindow, event: DashboardInputEvent, frameId: number): void {
function handleStopwatchInput(window: TimerWindow, event: InputEvent, frameId: number): void {
if (event.type === "scroll-up" || event.type === "scroll-down") {
const delta = event.type === "scroll-down" ? 1 : -1;
window.stopwatchAction = clamp(window.stopwatchAction + delta, 0, 2);
@@ -368,7 +363,7 @@ function handleStopwatchInput(window: TimerWindow, event: DashboardInputEvent, f
renderAndSubmit(window, frameId);
}
function handleTimersInput(window: TimerWindow, event: DashboardInputEvent, frameId: number): void {
function handleTimersInput(window: TimerWindow, event: InputEvent, frameId: number): void {
syncExpiredTimers();
const itemCount = timers.length + 2; // Stopwatch navigation + New timer + timers.
if (event.type === "scroll-up" || event.type === "scroll-down") {
@@ -395,7 +390,7 @@ function handleTimersInput(window: TimerWindow, event: DashboardInputEvent, fram
renderAndSubmit(window, frameId);
}
function handleEditorInput(window: TimerWindow, event: DashboardInputEvent, frameId: number): void {
function handleEditorInput(window: TimerWindow, event: InputEvent, frameId: number): void {
if (event.type === "scroll-up" || event.type === "scroll-down") {
const delta = event.type === "scroll-up" ? 1 : -1;
if (window.editorField === 0) {