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
52 changes: 52 additions & 0 deletions src/tui/bijou/__tests__/views.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -692,4 +692,56 @@ describe('renderMyStuffDrawer', () => {
expect(plain).toContain('task:TRC-010');
expect(plain).toContain('task:ACT-001');
});

describe('buildLaneTable review lane filtering', () => {
it('filters out MERGED and CLOSED submissions when falling back to snapshot.submissions', () => {
const snapshot = makeSnapshot({
submissions: [
{
id: 'submission:S1',
questId: 'task:Q1',
status: 'OPEN',
headsCount: 1,
approvalCount: 0,
submittedBy: 'agent.other',
submittedAt: 1000,
tipPatchsetId: 'patchset:P1',
},
{
id: 'submission:S2',
questId: 'task:Q2',
status: 'MERGED',
headsCount: 1,
approvalCount: 1,
submittedBy: 'agent.other',
submittedAt: 2000,
tipPatchsetId: 'patchset:P2',
},
{
id: 'submission:S3',
questId: 'task:Q3',
status: 'CLOSED',
headsCount: 1,
approvalCount: 0,
submittedBy: 'agent.other',
submittedAt: 3000,
tipPatchsetId: 'patchset:P3',
},
],
});

const table = buildLaneTable(snapshot, 'review', 20, 0, 'agent.test');

// Table should only contain S1 (OPEN), and exclude S2 (MERGED) and S3 (CLOSED).
expect(table.rows).toHaveLength(1);
const firstRow = table.rows[0];
expect(firstRow).toBeDefined();
if (firstRow) {
expect(firstRow[1]).toContain('S1');
expect(firstRow[1]).not.toContain('S2');
expect(firstRow[1]).not.toContain('S3');
}
});
});
});

1 change: 1 addition & 0 deletions src/tui/bijou/cockpit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1052,6 +1052,7 @@ export function laneItems(
return overrides.reviewLaneData
? buildReviewLaneItemsFromData(overrides.reviewLaneData)
: snapshot.submissions
.filter((submission) => submission.status !== 'MERGED' && submission.status !== 'CLOSED')
.map((submission) => buildSubmissionItem(submission, snapshot))
.sort(compareSubmissionItems);
case 'settlement':
Expand Down
Loading