client: drive App through felis-owned seams so its state machines are testable without winit #234
No reviewers
Labels
No labels
Area/ci
Area/cli
Area/client
Area/client-core
Area/daemon
Area/deps
Area/docs
Area/grid
Area/manual
Area/nix
Area/protocol
Area/pty
Area/render
Area/shaping
Area/skills
Area/transport
Area/vt
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Performance
Kind/Security
Kind/Testing
perf-regression-accepted
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Blocked
Status
Need More Info
Status
Upstream
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
felis-terminal/felis!234
Loading…
Reference in a new issue
No description provided.
Delete branch "client/app-host-seam"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #233.
The window-level state machines in
felis-client(session switching, parked pushes, the exit ladder, the confirmation bar) could only be reached through a live winit event loop, so the 100-odd tests intests.rscovered pure helpers only. This confines winit to a thin adapter and drivesAppfrom tests through felis-owned types. winit stays on 0.30.Commits
Build and drive
Appwithout a winit event loop. Background tasks post throughEventSinkinstead ofEventLoopProxy.user_eventbecomesApp::on_app_event, which records a window close inexit_requestedfor the adapter to forward. The window is built byApp::new.Route window effects through
WindowHost. Every effect on an existing window (title, cursor, attention, IME area, fullscreen, decorations, backdrop, …) goes through one trait, which the winit window implements.Appholds the window and the renderer separately, so a test can install a recording window without a GPU.Hand
Appits input as felis types.window_eventtranslates input intoWindowInput(KeyPressafter Option composition,WheelDelta,ImeInput, …), andApp::on_window_inputhandles it. A bare modifier is its ownPressedKey::Modifier, because the wireKey::Otherwould mix it up with dead keys, which the confirmation bar must still treat as an answer. Window events that act on the renderer (resize, scale factor, redraw, occlusion) stay in the adapter.App-level tests for the rules these seams expose:
YsendsEach test in commit 4 fails under a hand mutation of the code it pins.
docs/reference/testing.mdnow mentions these window-less unit tests next to the frontend smoke.Verification
just check: green exceptdeny, which fails on a yankedclipboard-win.Cargo.lockis unchanged by this PR, somainshould hit the same failure.just smoke-headless: passes.Not included
650e05f33536c55eaf0e36c55eaf0ec4fca227d2