Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions src/app/runtime.zig
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,7 @@ pub fn run() !void {
std.debug.print("Text input failed: {}\n", .{err});
};
if (anim_state.mode == .Grid) {
session_interaction_component.setAttention(anim_state.focused_session, false);
session_interaction_component.setAttention(anim_state.focused_session, false, now);
}
},
c.SDL_EVENT_TEXT_EDITING => {
Expand Down Expand Up @@ -919,7 +919,7 @@ pub fn run() !void {
try session.relaunch(working_dir.cwd_z, &loop);
session_interaction_component.resetView(session_idx);
session_interaction_component.setStatus(session_idx, .running);
session_interaction_component.setAttention(session_idx, false);
session_interaction_component.setAttention(session_idx, false, now);
session.markDirty();
grid.cancelResize();
log.info("relaunch complete idx={d} spawned={} dead={}", .{
Expand Down Expand Up @@ -1169,7 +1169,7 @@ pub fn run() !void {
// Spawn new terminal
try sessions[new_idx].ensureSpawnedWithDir(working_dir.cwd_z, &loop);
session_interaction_component.setStatus(new_idx, .running);
session_interaction_component.setAttention(new_idx, false);
session_interaction_component.setAttention(new_idx, false, now);

// Update cell dimensions for new grid
cell_width_pixels = @divFloor(render_width, @as(c_int, @intCast(grid.cols)));
Expand Down Expand Up @@ -1201,7 +1201,7 @@ pub fn run() !void {

try sessions[next_free_idx].ensureSpawnedWithDir(working_dir.cwd_z, &loop);
session_interaction_component.setStatus(next_free_idx, .running);
session_interaction_component.setAttention(next_free_idx, false);
session_interaction_component.setAttention(next_free_idx, false, now);

session_interaction_component.clearSelection(anim_state.focused_session);
session_interaction_component.clearSelection(next_free_idx);
Expand All @@ -1225,7 +1225,7 @@ pub fn run() !void {
if (anim_state.mode == .Grid) {
try sessions[idx].ensureSpawnedWithLoop(&loop);
session_interaction_component.setStatus(idx, .running);
session_interaction_component.setAttention(idx, false);
session_interaction_component.setAttention(idx, false, now);

const grid_row: c_int = @intCast(idx / grid.cols);
const grid_col: c_int = @intCast(idx % grid.cols);
Expand Down Expand Up @@ -1256,7 +1256,7 @@ pub fn run() !void {
session_interaction_component.clearSelection(anim_state.focused_session);
session_interaction_component.clearSelection(idx);
session_interaction_component.setStatus(idx, .running);
session_interaction_component.setAttention(idx, false);
session_interaction_component.setAttention(idx, false, now);
anim_state.focused_session = idx;

const buf_size = grid_nav.gridNotificationBufferSize(grid.cols, grid.rows);
Expand Down Expand Up @@ -1315,7 +1315,7 @@ pub fn run() !void {
try sessions[clicked_session].ensureSpawnedWithLoop(&loop);

session_interaction_component.setStatus(clicked_session, .running);
session_interaction_component.setAttention(clicked_session, false);
session_interaction_component.setAttention(clicked_session, false, now);

const grid_row: c_int = @intCast(clicked_session / grid.cols);
const grid_col: c_int = @intCast(clicked_session % grid.cols);
Expand Down Expand Up @@ -1344,7 +1344,7 @@ pub fn run() !void {
} else if (focused.spawned and !focused.dead and !input_keys.isModifierKey(key)) {
session_interaction_component.resetScrollIfNeeded(anim_state.focused_session);
if (anim_state.mode == .Grid) {
session_interaction_component.setAttention(anim_state.focused_session, false);
session_interaction_component.setAttention(anim_state.focused_session, false, now);
}
try input_keys.handleKeyInput(focused, key, mod);
}
Expand Down Expand Up @@ -1418,7 +1418,7 @@ pub fn run() !void {
else => false,
};
const is_focused_full = anim_state.mode == .Full and anim_state.focused_session == session_idx;
session_interaction_component.setAttention(session_idx, if (is_focused_full) false else wants_attention);
session_interaction_component.setAttention(session_idx, if (is_focused_full) false else wants_attention, now);
std.debug.print("Session {d} (slot {d}) status -> {s}\n", .{ note.session, session_idx, @tagName(note.state) });
}

Expand Down Expand Up @@ -1472,7 +1472,7 @@ pub fn run() !void {
session_interaction_component.clearSelection(anim_state.focused_session);
try sessions[idx].ensureSpawnedWithLoop(&loop);
session_interaction_component.setStatus(idx, .running);
session_interaction_component.setAttention(idx, false);
session_interaction_component.setAttention(idx, false, now);

const grid_row: c_int = @intCast(idx / grid.cols);
const grid_col: c_int = @intCast(idx % grid.cols);
Expand Down Expand Up @@ -1714,7 +1714,7 @@ pub fn run() !void {
};

session_interaction_component.setStatus(switch_action.session, .running);
session_interaction_component.setAttention(switch_action.session, false);
session_interaction_component.setAttention(switch_action.session, false, now);
ui.showToast("Switched worktree", now);
},
.CreateWorktree => |create_action| {
Expand Down Expand Up @@ -1755,7 +1755,7 @@ pub fn run() !void {
}

session_interaction_component.setStatus(create_action.session, .running);
session_interaction_component.setAttention(create_action.session, false);
session_interaction_component.setAttention(create_action.session, false, now);
ui.showToast("Creating worktree…", now);
},
.RemoveWorktree => |remove_action| {
Expand Down Expand Up @@ -1804,7 +1804,7 @@ pub fn run() !void {
};

session_interaction_component.setStatus(remove_action.session, .running);
session_interaction_component.setAttention(remove_action.session, false);
session_interaction_component.setAttention(remove_action.session, false, now);
ui.showToast("Removing worktree…", now);
},
.ChangeDirectory => |cd_action| {
Expand Down Expand Up @@ -1832,7 +1832,7 @@ pub fn run() !void {
// to avoid double-counting when cwd changes are detected

session_interaction_component.setStatus(cd_action.session, .running);
session_interaction_component.setAttention(cd_action.session, false);
session_interaction_component.setAttention(cd_action.session, false, now);

const basename = std.fs.path.basename(cd_action.path);
const toast_msg_buf = std.fmt.allocPrint(allocator, "Changed to {s}", .{basename}) catch null;
Expand Down
Loading