fix(ui): provider-aware context rail branding for GitLab

This commit is contained in:
2026-08-16 16:24:40 +00:00
parent 06a5dd63bb
commit 7bf07f0dd9
17 changed files with 87 additions and 16 deletions
@@ -59,6 +59,17 @@ describe('getVisibleContextRailSurfaces', () => {
expect(getVisibleContextRailSurfaces(baseOptions).some((s) => s.id === 'browser')).toBe(true);
});
test('hides the pr surface for other git providers but keeps it for github/gitlab', () => {
expect(getVisibleContextRailSurfaces({ ...baseOptions, gitProvider: 'other' }).some((s) => s.id === 'pr')).toBe(false);
expect(getVisibleContextRailSurfaces({ ...baseOptions, gitProvider: 'gitlab' }).some((s) => s.id === 'pr')).toBe(true);
expect(getVisibleContextRailSurfaces({ ...baseOptions, gitProvider: 'github' }).some((s) => s.id === 'pr')).toBe(true);
});
test('keeps the pr surface while the git provider is unknown', () => {
expect(getVisibleContextRailSurfaces({ ...baseOptions, gitProvider: null }).some((s) => s.id === 'pr')).toBe(true);
expect(getVisibleContextRailSurfaces(baseOptions).some((s) => s.id === 'pr')).toBe(true);
});
test('respects the persisted user rail order', () => {
const surfaces = getVisibleContextRailSurfaces({ ...baseOptions, railOrder: ['git', 'context'] });
expect(surfaces.slice(0, 2).map((surface) => surface.id)).toEqual(['git', 'context']);