test(web): align active pinning expectations

This commit is contained in:
2026-08-20 08:55:22 +08:00
parent 632ec26dfb
commit 19daba6f54
3 changed files with 5 additions and 14 deletions
@@ -569,7 +569,7 @@ describe('SessionList collapse behavior', () => {
expect(screen.queryByTitle('Idle')).toBeNull()
})
it('keeps quiet active sessions in the Active section when pin-in-progress is on', () => {
it('keeps quiet active sessions in their directory when pin-in-progress is on', () => {
localStorage.setItem('hapi-pin-in-progress-sessions', 'true')
const sessions = [
makeSession({
@@ -598,17 +598,9 @@ describe('SessionList collapse behavior', () => {
expect(screen.getByTitle('In progress')).toBeInTheDocument()
expect(screen.getByText(/Running \(1\)/)).toBeInTheDocument()
expect(screen.getByText(/pending \(1\)/)).toBeInTheDocument()
// Quiet active sessions float into their own Active section (finished
// executing, still connected) instead of falling into directory groups.
expect(screen.getByTitle('Active sessions')).toBeInTheDocument()
expect(screen.getByText(/Active \(1\)/)).toBeInTheDocument()
expect(screen.getByRole('button', { name: /Quiet task/ })).toBeInTheDocument()
// The directory header survives as an action-only header (copy-path /
// new-session-in-directory) even though every row floated.
expect(screen.getByTitle('/work/hapi')).toBeInTheDocument()
expect(screen.getByTitle('/work/hapi').nextElementSibling).toBeNull()
expect(screen.getByTitle('/work/other')).toBeInTheDocument()
expect(screen.getByTitle('/work/other').nextElementSibling).toBeNull()
})
it('keeps new-session-in-directory actions for projects whose rows all floated', () => {
@@ -636,10 +628,8 @@ describe('SessionList collapse behavior', () => {
/>
)
expect(screen.getByTitle('Active sessions')).toBeInTheDocument()
// The project header survives as an action-only header.
const header = screen.getByTitle('/work/hapi')
expect(header.nextElementSibling).toBeNull()
expect(header.nextElementSibling).not.toBeNull()
fireEvent.click(screen.getByRole('button', { name: 'New session in this directory' }))
expect(onNewSessionInDirectory).toHaveBeenCalledWith({
@@ -739,6 +729,7 @@ describe('SessionList collapse behavior', () => {
it('toggles the Active section independently of In progress', () => {
localStorage.setItem('hapi-pin-in-progress-sessions', 'true')
localStorage.setItem('hapi-pin-active-sessions', 'true')
const sessions = [
makeSession({
id: 'session-running',
+1 -1
View File
@@ -839,7 +839,7 @@ export default {
'settings.display.activeSessionsOnly': 'Active sessions only',
'settings.display.activeSessionsOnly.desc': 'Hide inactive sessions in the sidebar. The session you have open stays visible.',
'settings.display.pinInProgressSessions': 'Pin in-progress sessions',
'settings.display.pinInProgressSessions.desc': 'Move unpinned connected sessions into sections above project folders: running and pending work first, then quiet active sessions (finished executing, still connected). Global pins remain above them. Off keeps everything in directory groups.',
'settings.display.pinInProgressSessions.desc': 'Move unpinned working and pending sessions into sections above project folders. Quiet active sessions stay in their project folders unless Pin active sessions is enabled.',
'settings.display.pinActiveSessions': 'Pin active sessions',
'settings.display.pinActiveSessions.desc': 'Move all connected sessions to the top, including sessions that are currently idle.',
'settings.display.sessionListStatus': 'Session list status hints',
+1 -1
View File
@@ -838,7 +838,7 @@ export default {
'settings.display.activeSessionsOnly': '仅显示活跃会话',
'settings.display.activeSessionsOnly.desc': '在侧边栏隐藏非活跃会话;当前打开的会话仍会保留显示。',
'settings.display.pinInProgressSessions': '置顶进行中会话',
'settings.display.pinInProgressSessions.desc': '将未置顶的已连接会话移到项目文件夹上方的分区:先运行中和待处理,再是安静的活跃会话(已执行完但仍在连接)。全局置顶仍在其上。关闭后全部保留在目录分组中。',
'settings.display.pinInProgressSessions.desc': '将未置顶的运行中和待处理会话移到项目目录上方。空闲的活跃会话留在项目目录中,除非开启「置顶活跃会话」。',
'settings.display.pinActiveSessions': '置顶活跃会话',
'settings.display.pinActiveSessions.desc': '将所有仍连接的会话移到顶部,包括当前空闲的活跃会话。',
'settings.display.sessionListStatus': '会话列表状态提示',