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
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,11 @@ describe('ChatCheckpointMarkerComponent', () => {
(fx.nativeElement.querySelector('[data-action="fork"]') as HTMLButtonElement).click();
expect(fx.componentInstance.forked).toEqual(['cp-1']);
});

it('positions the host as a containing block so the hover pill anchors to the dot', () => {
const fx = TestBed.createComponent(HostComponent);
fx.detectChanges();
const host = fx.nativeElement.querySelector('chat-checkpoint-marker') as HTMLElement;
expect(getComputedStyle(host).position).toBe('relative');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { CHAT_HOST_TOKENS } from '../../styles/chat-tokens';
width: 14px;
height: 100%;
flex: 0 0 14px;
position: relative;
}
.chat-checkpoint-marker__dot {
width: 10px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import { TestBed } from '@angular/core/testing';
import { describe, expect, it } from 'vitest';
import { ChatConfirmDialogComponent } from './chat-confirm-dialog.component';
import { CHAT_CONFIRM_DIALOG_STYLES } from '../../styles/chat-confirm-dialog.styles';

function render(opts: {
open?: boolean;
Expand Down Expand Up @@ -89,6 +90,19 @@ describe('ChatConfirmDialogComponent', () => {
expect(confirm.classList.contains('chat-confirm-dialog__confirm--destructive')).toBe(true);
});

it('destructive confirm button uses the new --ngaf-chat-destructive token, not --ngaf-chat-error-text', () => {
// Regression guard: error-text is light pink (#fca5a5) in dark mode, which gave
// white-text-on-pink unreadable contrast. The destructive button must use a
// dedicated token that resolves to a saturated red on both themes.
expect(CHAT_CONFIRM_DIALOG_STYLES).toContain('.chat-confirm-dialog__confirm--destructive');
const destructiveBlock = CHAT_CONFIRM_DIALOG_STYLES
.split('.chat-confirm-dialog__confirm--destructive')
.slice(1)
.join('.chat-confirm-dialog__confirm--destructive');
expect(destructiveBlock).toContain('var(--ngaf-chat-destructive)');
expect(destructiveBlock).not.toContain('var(--ngaf-chat-error-text)');
});

it('confirm button has labelled text from confirmLabel input', () => {
const fixture = render({ confirmLabel: 'Yes do it' });
const confirm = fixture.nativeElement.querySelector('.chat-confirm-dialog__confirm');
Expand Down
6 changes: 5 additions & 1 deletion libs/chat/src/lib/styles/chat-confirm-dialog.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,12 @@ export const CHAT_CONFIRM_DIALOG_STYLES = `
border-color: transparent;
}
.chat-confirm-dialog__confirm--destructive {
background: var(--ngaf-chat-error-text);
background: var(--ngaf-chat-destructive);
color: #fff;
border-color: transparent;
}
.chat-confirm-dialog__confirm--destructive:hover {
filter: brightness(1.1);
}
.chat-confirm-dialog__cancel:focus-visible,
.chat-confirm-dialog__confirm:focus-visible {
Expand Down
8 changes: 4 additions & 4 deletions libs/chat/src/lib/styles/chat-sidenav.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,10 @@ export const CHAT_SIDENAV_STYLES = `
}
.chat-sidenav__threads-heading {
padding: 8px 12px 4px;
font-size: var(--ngaf-chat-font-size-xs);
font-size: 11px;
color: var(--ngaf-chat-text-muted);
text-transform: uppercase;
letter-spacing: 0.05em;
letter-spacing: 0.4px;
}
:host([data-mode="collapsed"]) .chat-sidenav__threads-heading {
display: none;
Expand All @@ -178,9 +178,9 @@ export const CHAT_SIDENAV_STYLES = `
background: transparent;
color: var(--ngaf-chat-text-muted);
font: inherit;
font-size: var(--ngaf-chat-font-size-xs);
font-size: 11px;
text-transform: uppercase;
letter-spacing: 0.05em;
letter-spacing: 0.4px;
text-align: left;
cursor: pointer;
}
Expand Down
2 changes: 2 additions & 0 deletions libs/chat/src/lib/styles/chat-tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const LIGHT_TOKENS = `
--ngaf-chat-error-bg: #fef2f2;
--ngaf-chat-error-border: #fecaca;
--ngaf-chat-error-text: #dc2626;
--ngaf-chat-destructive: #dc2626;
--ngaf-chat-warning-bg: #fffbeb;
--ngaf-chat-warning-text: #b45309;
--ngaf-chat-success: #16a34a;
Expand All @@ -35,6 +36,7 @@ const DARK_TOKENS = `
--ngaf-chat-error-bg: rgb(45, 21, 21);
--ngaf-chat-error-border: #dc2626;
--ngaf-chat-error-text: #fca5a5;
--ngaf-chat-destructive: #ef4444;
--ngaf-chat-warning-bg: rgb(45, 35, 21);
--ngaf-chat-warning-text: #fbbf24;
--ngaf-chat-success: #4ade80;
Expand Down
3 changes: 3 additions & 0 deletions libs/chat/src/lib/styles/chat.css
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
--ngaf-chat-error-bg: #fef2f2;
--ngaf-chat-error-border: #fecaca;
--ngaf-chat-error-text: #dc2626;
--ngaf-chat-destructive: #dc2626;
--ngaf-chat-warning-bg: #fffbeb;
--ngaf-chat-warning-text: #b45309;
--ngaf-chat-success: #16a34a;
Expand Down Expand Up @@ -157,6 +158,7 @@
--ngaf-chat-error-bg: rgb(45, 21, 21);
--ngaf-chat-error-border: #dc2626;
--ngaf-chat-error-text: #fca5a5;
--ngaf-chat-destructive: #ef4444;
--ngaf-chat-warning-bg: rgb(45, 35, 21);
--ngaf-chat-warning-text: #fbbf24;
--ngaf-chat-success: #4ade80;
Expand All @@ -176,6 +178,7 @@
--ngaf-chat-error-bg: rgb(45, 21, 21);
--ngaf-chat-error-border: #dc2626;
--ngaf-chat-error-text: #fca5a5;
--ngaf-chat-destructive: #ef4444;
--ngaf-chat-warning-bg: rgb(45, 35, 21);
--ngaf-chat-warning-text: #fbbf24;
--ngaf-chat-success: #4ade80;
Expand Down
Loading