Fade Astra composer stars and stabilize cursor redraws (#44879)

## What changed

- Fade Astra stars over one second after 15 seconds from the first visible frame, or quickly on composer input, drafts, voice input, and popups. Disconnected key handling also dismisses the animation.
- Preserve placeholder and draft text, including spaces. Stop scheduling animation frames when unfocused or finished, while allowing the idle deadline to elapse without terminal focus.
- Hide the terminal cursor before repainting and cache its style to avoid redundant anchor repairs. Invalidate cursor state after screen transitions, external programs, resume, and caught-panic recovery.

## Testing

Add regression tests and snapshots for fade timing, input dismissal, focus changes, text preservation, and frame scheduling. Add cursor redraw tests and a PTY test for cursor visibility and shape restoration after a caught panic. Update the reconnect test to wait until both the draft and notification are visible.

GitOrigin-RevId: 0c9aaa13e6bde820f88e3757457063680d7921a3
This commit is contained in:
Ian MacLeod authored and copyberry committed 2026-09-11 17:43:36 +00:00
1 parent 7b491281c8
commit 33bdf976cc
20 files changed
+1097 -63

No files matched your search

+13 -2
View File
@@ -167,9 +167,20 @@ async fn automatic_reconnect_restores_draft_and_routes_new_notifications() -> Re
_ => {}
}
}
// A PTY read can expose the history write before the same terminal update redraws the
// composer. Wait for both pieces in the same parsed screen before checking recovery.
let deadline = Instant::now() + Duration::from_secs(/*secs*/ 30);
while !(terminal.screen_contains("preserved-draft!")
&& terminal.screen_contains("fresh-notification-after-reconnect"))
&& Instant::now() < deadline
{
terminal.read_output(Duration::from_millis(/*millis*/ 20))?;
}
ensure!(
terminal.screen_contains("preserved-draft!"),
"draft was lost after recovery"
terminal.screen_contains("preserved-draft!")
&& terminal.screen_contains("fresh-notification-after-reconnect"),
"draft and notification did not remain visible after recovery; screen:\n{}",
terminal.screen_contents()
);
drop(terminal);
let methods = tokio::time::timeout(Duration::from_secs(/*secs*/ 5), server).await???;