Skip to content

Commit ee088aa

Browse files
authored
Polish pass 2: sidenav radius + More prompts match featured chip (#414)
* feat(chat): match sidenav New chat + New project radius to 8px * feat(demo): match More prompts dropdown styling to featured chip * chore(release): bump publishable libs to 0.0.38
1 parent bed1945 commit ee088aa

15 files changed

Lines changed: 65 additions & 12 deletions

File tree

examples/chat/angular/src/app/modes/welcome-suggestions.component.spec.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,28 @@ describe('WelcomeSuggestionsComponent', () => {
5151
chipBtn.click();
5252
expect(captured).toBe(FEATURED_SUGGESTIONS[0].value);
5353
});
54+
55+
it('overrides the More prompts trigger to match the featured chip styling', () => {
56+
// The component's styles block must include ::ng-deep overrides for the
57+
// chat-select trigger so it visually matches chat-welcome-suggestion.
58+
// We assert by inspecting the component's stringified styles via the
59+
// DOM: the trigger should compute to chip-equivalent padding/border.
60+
const trigger = fx.nativeElement.querySelector(
61+
'.welcome-suggestions__row chat-select .chat-select__trigger',
62+
) as HTMLElement;
63+
expect(trigger).toBeTruthy();
64+
const cs = getComputedStyle(trigger);
65+
// 10px 16px padding (chip)
66+
expect(cs.paddingTop).toBe('10px');
67+
expect(cs.paddingBottom).toBe('10px');
68+
expect(cs.paddingLeft).toBe('16px');
69+
expect(cs.paddingRight).toBe('16px');
70+
// 1px border (chip has a border; default trigger has none).
71+
// JSDOM 29 does not cascade border-width from <style> tags so we assert
72+
// the source instead of getComputedStyle — the CSS must declare a border.
73+
const componentStyles = (fx.componentInstance.constructor as { ɵcmp?: { styles?: string[] } }).ɵcmp?.styles?.join(' ') ?? '';
74+
expect(componentStyles).toMatch(/border:\s*1px\s+solid/);
75+
// pill radius (chip)
76+
expect(cs.borderRadius).toBe('9999px');
77+
});
5478
});

examples/chat/angular/src/app/modes/welcome-suggestions.component.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,23 @@ import { FEATURED_SUGGESTIONS, MORE_SUGGESTIONS } from './welcome-suggestions';
5858
overflow: hidden;
5959
text-overflow: ellipsis;
6060
}
61+
/* Make the "More prompts" dropdown match the featured chip visually.
62+
Scoped to .welcome-suggestions__row so the model picker (also
63+
chat-select, elsewhere) is untouched. */
64+
.welcome-suggestions__row ::ng-deep chat-select .chat-select__trigger {
65+
height: auto;
66+
padding: 10px 16px;
67+
background: var(--ngaf-chat-surface);
68+
color: var(--ngaf-chat-text);
69+
border: 1px solid var(--ngaf-chat-separator);
70+
border-radius: 9999px;
71+
font-size: var(--ngaf-chat-font-size-sm);
72+
}
73+
.welcome-suggestions__row ::ng-deep chat-select .chat-select__trigger:hover:not(:disabled) {
74+
background: var(--ngaf-chat-surface-alt);
75+
border-color: var(--ngaf-chat-text-muted);
76+
color: var(--ngaf-chat-text);
77+
}
6178
`,
6279
],
6380
})

libs/a2ui/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@ngaf/a2ui",
3-
"version": "0.0.37",
3+
"version": "0.0.38",
44
"license": "MIT",
55
"repository": {
66
"type": "git",

libs/ag-ui/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@ngaf/ag-ui",
3-
"version": "0.0.37",
3+
"version": "0.0.38",
44
"peerDependencies": {
55
"@ngaf/chat": "*",
66
"@ngaf/licensing": "*",

libs/chat/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@ngaf/chat",
3-
"version": "0.0.37",
3+
"version": "0.0.38",
44
"exports": {
55
".": {
66
"types": "./index.d.ts",

libs/chat/src/lib/compositions/chat-sidenav/chat-sidenav.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,6 @@ describe('ChatSidenavComponent — New chat primary CTA', () => {
334334
const styles = (ChatSidenavComponent as unknown as { ɵcmp: { styles: string[] } }).ɵcmp.styles.join('\n');
335335
// Monochrome CTA: late-cascade block uses text/bg for contrast.
336336
expect(styles).toMatch(/\.chat-sidenav__action\.chat-sidenav__action--new[^{]*\{[^}]*background:\s*var\(--ngaf-chat-text/);
337-
expect(styles).toMatch(/\.chat-sidenav__action--new[^{]*\{[^}]*border-radius:\s*9999px/);
337+
expect(styles).toMatch(/\.chat-sidenav__action--new[^{]*\{[^}]*border-radius:\s*8px/);
338338
});
339339
});

libs/chat/src/lib/primitives/chat-project-list/chat-project-list.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ describe('ChatProjectListComponent — New project secondary pill', () => {
156156
it('renders the new-project button with borderless surface-alt pill styling', () => {
157157
const styles = (ChatProjectListComponent as unknown as { ɵcmp: { styles: string[] } }).ɵcmp.styles.join('\n');
158158
expect(styles).toMatch(/\.chat-project-list__new[^{]*\{[^}]*background:\s*var\(--ngaf-chat-surface-alt/);
159-
expect(styles).toMatch(/\.chat-project-list__new[^{]*\{[^}]*border-radius:\s*9999px/);
159+
expect(styles).toMatch(/\.chat-project-list__new[^{]*\{[^}]*border-radius:\s*8px/);
160160
expect(styles).toMatch(/\.chat-project-list__new[^{]*\{[^}]*border:\s*0/);
161161
});
162162
});

libs/chat/src/lib/styles/chat-project-list.styles.spec.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,10 @@ describe('CHAT_PROJECT_LIST_STYLES — New project button', () => {
3434
/\.chat-project-list__new:hover\s*\{[^}]*background:\s*color-mix\(in srgb,\s*var\(--ngaf-chat-text\)\s*8%,\s*var\(--ngaf-chat-surface-alt\)\)\s*;/,
3535
);
3636
});
37+
38+
it('uses 8px border-radius (consistent with thread items)', () => {
39+
expect(normalized).toMatch(
40+
/\.chat-project-list__new\s*\{[^}]*border-radius:\s*8px\s*;/,
41+
);
42+
});
3743
});

libs/chat/src/lib/styles/chat-project-list.styles.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export const CHAT_PROJECT_LIST_STYLES = `
7979
color: var(--ngaf-chat-text);
8080
border: 0;
8181
padding: 10px 16px;
82-
border-radius: 9999px;
82+
border-radius: 8px;
8383
font-size: 12px;
8484
display: flex;
8585
align-items: center;

libs/chat/src/lib/styles/chat-sidenav.styles.spec.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,10 @@ describe('CHAT_SIDENAV_STYLES — New chat button', () => {
3434
/\.chat-sidenav__action--new:focus-visible\s*\{[^}]*outline:\s*2px\s+solid\s+var\(--ngaf-chat-primary\)\s*;/,
3535
);
3636
});
37+
38+
it('uses 8px border-radius (consistent with Search button + thread items)', () => {
39+
expect(normalized).toMatch(
40+
/\.chat-sidenav__action\.chat-sidenav__action--new\s*\{[^}]*border-radius:\s*8px\s*;/,
41+
);
42+
});
3743
});

0 commit comments

Comments
 (0)