fix(ui-gpui): re-enable start_blinking (was disabled for testing)

This commit is contained in:
Hibryda 2026-03-19 22:50:16 +01:00
parent 3859317477
commit 640e2bd494
2 changed files with 2 additions and 11 deletions

View file

@ -19,21 +19,15 @@ impl BlinkState {
pub fn start_from_context<V: 'static>(entity: &Entity<Self>, cx: &mut Context<V>) {
let weak = entity.downgrade();
eprintln!("[BlinkState] Starting blink timer");
cx.spawn(async move |_parent: WeakEntity<V>, cx: &mut AsyncApp| {
eprintln!("[BlinkState] Spawn executing — entering blink loop");
loop {
cx.background_executor().timer(Duration::from_millis(500)).await;
let ok = weak.update(cx, |state, cx| {
state.visible = !state.visible;
state.epoch += 1;
eprintln!("[BlinkState] Toggled visible={}", state.visible);
cx.notify();
});
if ok.is_err() {
eprintln!("[BlinkState] Entity dropped, stopping blink");
break;
}
if ok.is_err() { break; }
}
}).detach();
}

View file

@ -102,7 +102,7 @@ impl ProjectBox {
/// Initialize sub-views. Must be called after the ProjectBox entity is created.
pub fn init_subviews(&mut self, cx: &mut Context<Self>) {
eprintln!("[ProjectBox] init_subviews for {}", self.project.name);
// Initialize sub-views after entity registration
// Shared blink state — separate entity, ProjectBox reads it in render.
// cx.notify() on BlinkState only dirties views that .read() it (ProjectBox),
@ -132,9 +132,6 @@ impl ProjectBox {
impl Render for ProjectBox {
fn render(&mut self, _window: &mut Window, cx: &mut Context<Self>) -> impl IntoElement {
eprintln!("[ProjectBox::render] {} blink_visible={:?}",
self.project.name,
self.blink_state.as_ref().map(|bs| bs.read(cx).visible));
let accent = accent_color(self.project.accent_index);
let active_tab = self.project.active_tab;