chore(core): remove unused `EventCtx.transition_out` field
What changed, and why it matters
This commit removes an unused internal field called transition_out from the user-interface event-handling code in the Trezor firmware. It also deletes the helper functions that set and read that field, and updates the two places that used to call those helpers. There is no change to how the device behaves; it is purely a cleanup of dead code.
No security action required. Treat as routine code-cleanup.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch deletes the EventCtx.transition_out Option
Changed components
core/embed/rust/src/ui/component/base.rscore/embed/rust/src/ui/flow/swipe.rscore/embed/rust/src/ui/layout_delizia/component/swipe_up_screen.rsInspect captured patch +2 / −14
diff --git a/core/embed/rust/src/ui/component/base.rs b/core/embed/rust/src/ui/component/base.rs
index b0503f72..102d0ac6 100644
--- a/core/embed/rust/src/ui/component/base.rs
+++ b/core/embed/rust/src/ui/component/base.rs
@@ -478,7 +478,6 @@ pub struct EventCtx {
root_repaint_requested: bool,
swipe_disable_req: bool,
swipe_enable_req: bool,
- transition_out: Option<AttachType>,
}
impl EventCtx {
@@ -502,7 +501,6 @@ impl EventCtx {
root_repaint_requested: false,
swipe_disable_req: false,
swipe_enable_req: false,
- transition_out: None,
}
}
@@ -607,14 +605,6 @@ impl EventCtx {
fatal_error!("Timer queue is full");
}
}
-
- pub fn set_transition_out(&mut self, attach_type: AttachType) {
- self.transition_out = Some(attach_type);
- }
-
- pub fn get_transition_out(&self) -> Option<AttachType> {
- self.transition_out
- }
}
/// Component::Msg for component parts of a swipe flow. Converting results of
diff --git a/core/embed/rust/src/ui/flow/swipe.rs b/core/embed/rust/src/ui/flow/swipe.rs
index 91e99034..8593bb75 100644
--- a/core/embed/rust/src/ui/flow/swipe.rs
+++ b/core/embed/rust/src/ui/flow/swipe.rs
@@ -272,7 +272,6 @@ impl SwipeFlow {
Some(LayoutState::Attached(ctx.button_request()))
}
Decision::Return(msg) => {
- ctx.set_transition_out(return_transition);
self.swipe.reset();
self.allow_swipe = true;
self.returned_value = Some(msg.try_into());
diff --git a/core/embed/rust/src/ui/layout_delizia/component/swipe_up_screen.rs b/core/embed/rust/src/ui/layout_delizia/component/swipe_up_screen.rs
index 0005fb17..853a76cb 100644
--- a/core/embed/rust/src/ui/layout_delizia/component/swipe_up_screen.rs
+++ b/core/embed/rust/src/ui/layout_delizia/component/swipe_up_screen.rs
@@ -1,5 +1,5 @@
use crate::ui::{
- component::{base::AttachType, Component, Event, EventCtx, SwipeDetect},
+ component::{Component, Event, EventCtx, SwipeDetect},
event::SwipeEvent,
flow::Swipable,
geometry::Rect,
@@ -49,8 +49,7 @@ impl<T: Swipable + Component> Component for SwipeUpScreen<T> {
.swipe
.event(ctx, event, self.content.get_swipe_config())
{
- Some(SwipeEvent::End(dir)) => {
- ctx.set_transition_out(AttachType::Swipe(dir));
+ Some(SwipeEvent::End(_dir)) => {
return Some(SwipeUpScreenMsg::Swiped);
}
Some(e) => Event::Swipe(e),
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.