mirror of
https://github.com/wu736139669/hapi.git
synced 2026-08-05 06:24:37 +00:00
feat(web): add stepwise session preview controls (#1266)
* feat(web): add stepwise session preview controls * fix(web): avoid no-op session preview collapse * fix(web): expand previews from rendered count
This commit is contained in:
@@ -6,6 +6,7 @@ import {
|
||||
filterActiveSessionsOnly,
|
||||
getSessionTimeRange,
|
||||
getNextSessionVisibleCount,
|
||||
getPreviousSessionVisibleCount,
|
||||
getSessionDedupKey,
|
||||
getWorktreeSessionLabel,
|
||||
getVisibleSessionPreview,
|
||||
@@ -428,6 +429,22 @@ describe('getNextSessionVisibleCount', () => {
|
||||
})
|
||||
})
|
||||
|
||||
describe('getPreviousSessionVisibleCount', () => {
|
||||
it('collapses one batch of step size per call', () => {
|
||||
expect(getPreviousSessionVisibleCount(20, 8)).toBe(12)
|
||||
expect(getPreviousSessionVisibleCount(12, 8)).toBe(8)
|
||||
})
|
||||
|
||||
it('never goes below the preview limit', () => {
|
||||
expect(getPreviousSessionVisibleCount(10, 8)).toBe(8)
|
||||
expect(getPreviousSessionVisibleCount(8, 8)).toBe(8)
|
||||
})
|
||||
|
||||
it('uses a minimum batch size of one', () => {
|
||||
expect(getPreviousSessionVisibleCount(5, 0)).toBe(4)
|
||||
})
|
||||
})
|
||||
|
||||
describe('expandSelectedSessionCollapseOverrides', () => {
|
||||
it('expands the collapsed project group, but preserves session preview folding', () => {
|
||||
const overrides = new Map<string, boolean>([
|
||||
|
||||
Reference in New Issue
Block a user