github / github/app

Setting to disable automatic session focus switching when an agent needs attention

未关闭
#1,042 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
Requests and ideas
主要语言
没有语言数据
星标
2.1k
派生
153
PR 合并指标
30 天内没有已合并 PR

描述

### Feature summary

Add a setting to disable automatic session focus switching, so the app never pulls a background session into the foreground when it "needs attention" (ready for input, finished, etc.).

### What problem are you trying to solve?

I usually have many sessions running in parallel. While I'm reading or actively typing in one session, the app frequently snaps the UI over to a different session the moment one of the background agents needs attention (e.g. a tool call requires input, a plan needs approval, or a session finishes). This is disruptive: it interrupts my typing, makes me lose my place, and pulls me away from the session I deliberately chose to focus on.

I don't need the app to route me automatically, because the sidebar already shows per-session status icons (needs a question answered, done, etc.). I can see at a glance which sessions need me and switch to them on my own terms.

### Proposed solution

A persistent preference (app settings, e.g. under **General**) to control automatic focus switching. Something like:

- **Auto-switch to sessions that need attention** — On / Off (default On to preserve current behavior).

When set to Off:
- The foreground session never changes unless I click it myself.
- Sessions that need attention or complete are still indicated via their existing sidebar status icons (and ideally an optional unread/attention badge), but they do not steal focus.

Granularity would be a bonus (e.g. separate toggles for "switch when a session needs input" vs. "switch when a session completes"), but a single on/off toggle would solve the core problem.

### Workflow impact

This affects anyone orchestrating multiple parallel agent sessions — arguably the core use case of the app. For power users running many sessions at once, automatic focus stealing actively fights the "control center" workflow: I'm trying to drive one session while others run in the background, and the UI keeps yanking me elsewhere. An opt-out would let people who prefer to navigate manually (via the status icons) stay in control, while leaving the current auto-switch behavior as the default for those who want it.

### Additional context

Related existing issues:

- #968 — bug report: "Session switches while typing if tool call in non-foreground session requires input." That issue is the narrower typing-interruption symptom; this request is the broader, user-facing **preference toggle** to opt out of auto-switching entirely (not only while typing).
- #192 — request for attention badges, which pairs well with this: badges/icons instead of focus stealing.
- #522 — request for a keyboard shortcut to jump to the next unread session, i.e. manual, user-initiated switching.

Together these point at the same theme: let users rely on status indicators and switch sessions manually, rather than having focus moved for them.

贡献指南

打开贡献指南

调研方向

未指定任何文件、测试或入口点。首先定位应用的常规设置,以及现有的会话自动焦点切换行为。跟踪触发切换的注意力事件,然后验证禁用该偏好设置后当前会话仍保持焦点,同时现有的侧边栏状态指示器仍可用。

由索引模型根据 Issue 内容生成。

评估

领域
desktop
Issue 类型
功能
难度
4/5
预计耗时
3-5 天
活跃度
冷清
描述清晰度
基本清楚
新手友好度
48/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。