Skip to content

Commit f1d6b12

Browse files
committed
revert: disable session.status subscription in loading animation (avoid regressions)
1 parent b51ad74 commit f1d6b12

1 file changed

Lines changed: 12 additions & 34 deletions

File tree

lua/opencode/ui/loading_animation.lua

Lines changed: 12 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -62,27 +62,17 @@ function M._format_status_text(status)
6262
end
6363

6464
local function unsubscribe_session_status_event(manager)
65-
if manager and M._animation.status_event_manager == manager then
66-
manager:unsubscribe('session.status', M.on_session_status)
67-
M._animation.status_event_manager = nil
68-
end
65+
-- No-op: disable session.status event subscription introduced recently.
66+
-- Reverting session.status handling to avoid interfering with existing
67+
-- behavior. This keeps the loading animation logic focused on job_count
68+
-- and user_message_count as before.
69+
return
6970
end
7071

7172
local function subscribe_session_status_event(manager)
72-
if not manager then
73-
return
74-
end
75-
76-
if M._animation.status_event_manager and M._animation.status_event_manager ~= manager then
77-
unsubscribe_session_status_event(M._animation.status_event_manager)
78-
end
79-
80-
if M._animation.status_event_manager == manager then
81-
return
82-
end
83-
84-
manager:subscribe('session.status', M.on_session_status)
85-
M._animation.status_event_manager = manager
73+
-- No-op: do not subscribe to session.status events. See note in
74+
-- unsubscribe_session_status_event for rationale.
75+
return
8676
end
8777

8878
local function is_active_session_busy()
@@ -108,17 +98,10 @@ local function is_active_session_busy()
10898
end
10999

110100
function M.on_session_status(properties)
111-
if not properties or type(properties) ~= 'table' then
112-
return
113-
end
114-
115-
local active_session = state.active_session
116-
if active_session and active_session.id and properties.sessionID ~= active_session.id then
117-
return
118-
end
119-
120-
M._animation.status_data = properties.status
121-
M.render(state.windows)
101+
-- Disabled: Ignore session.status updates to keep loading animation
102+
-- behavior stable. Previously this updated status_data and triggered
103+
-- a render which caused regressions in some environments.
104+
return
122105
end
123106

124107
local function on_active_session_change(_, new_session, old_session)
@@ -272,9 +255,6 @@ function M.setup()
272255
state.store.subscribe('job_count', on_running_change)
273256
state.store.subscribe('user_message_count', on_user_message_count_change)
274257
state.store.subscribe('active_session', on_active_session_change)
275-
state.store.subscribe('event_manager', on_event_manager_change)
276-
subscribe_session_status_event(state.event_manager)
277-
278258
if is_active_session_busy() then
279259
M.start(state.windows)
280260
else
@@ -286,8 +266,6 @@ function M.teardown()
286266
state.store.unsubscribe('job_count', on_running_change)
287267
state.store.unsubscribe('user_message_count', on_user_message_count_change)
288268
state.store.unsubscribe('active_session', on_active_session_change)
289-
state.store.unsubscribe('event_manager', on_event_manager_change)
290-
unsubscribe_session_status_event(M._animation.status_event_manager)
291269
M._animation.status_data = nil
292270
end
293271

0 commit comments

Comments
 (0)