Skip to content

Commit d8214d6

Browse files
bloveclaude
andauthored
fix(chat): post-merge sidenav polish — semantic <nav> + rename palette output (#256)
- chat-sidenav: replace <aside role="navigation"> with semantic <nav> (adds tabindex="-1" so Esc keydown still binds without tripping the interactive-supports-focus lint rule). - chat-history-search-palette: rename close output to closed, dropping the @angular-eslint/no-output-native suppression. Past-tense matches the convention of state outputs (opened/closed). - examples-chat-angular: switch the consumer binding to (closed). Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent a12c060 commit d8214d6

5 files changed

Lines changed: 11 additions & 12 deletions

File tree

apps/website/content/docs/chat/api/api-docs.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2369,7 +2369,7 @@
23692369
"optional": false
23702370
},
23712371
{
2372-
"name": "close",
2372+
"name": "closed",
23732373
"type": "OutputEmitterRef<void>",
23742374
"description": "",
23752375
"optional": false

examples/chat/angular/src/app/shell/demo-shell.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
[(query)]="searchQuery"
4141
[results]="searchResults()"
4242
(threadSelected)="onSearchSelect($event)"
43-
(close)="paletteOpen.set(false)"
43+
(closed)="paletteOpen.set(false)"
4444
/>
4545

4646
<chat-debug

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ export type ChatSidenavMode = 'expanded' | 'collapsed' | 'drawer';
3535
(click)="openChange.emit(false)"
3636
></button>
3737
}
38-
<aside
38+
<nav
3939
class="chat-sidenav"
40-
role="navigation"
4140
aria-label="Sidebar navigation"
41+
tabindex="-1"
4242
(keydown.escape)="onEscape()"
4343
>
4444
<div class="chat-sidenav__header">
@@ -96,7 +96,7 @@ export type ChatSidenavMode = 'expanded' | 'collapsed' | 'drawer';
9696
<div class="chat-sidenav__account">
9797
<ng-content select="[sidenavAccount]" />
9898
</div>
99-
</aside>
99+
</nav>
100100
`,
101101
})
102102
export class ChatSidenavComponent {

libs/chat/src/lib/primitives/chat-history-search-palette/chat-history-search-palette.component.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ describe('ChatHistorySearchPaletteComponent', () => {
114114
it('Esc emits close', () => {
115115
const fixture = render();
116116
let emits = 0;
117-
fixture.componentInstance.close.subscribe(() => emits++);
117+
fixture.componentInstance.closed.subscribe(() => emits++);
118118
const input = fixture.nativeElement.querySelector('input') as HTMLInputElement;
119119
input.dispatchEvent(new KeyboardEvent('keydown', { key: 'Escape', bubbles: true }));
120120
expect(emits).toBe(1);
@@ -123,7 +123,7 @@ describe('ChatHistorySearchPaletteComponent', () => {
123123
it('Scrim click emits close', () => {
124124
const fixture = render();
125125
let emits = 0;
126-
fixture.componentInstance.close.subscribe(() => emits++);
126+
fixture.componentInstance.closed.subscribe(() => emits++);
127127
const scrim = fixture.nativeElement.querySelector('.chat-history-search-palette__scrim') as HTMLButtonElement;
128128
scrim.click();
129129
expect(emits).toBe(1);

libs/chat/src/lib/primitives/chat-history-search-palette/chat-history-search-palette.component.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ let paletteInstanceCounter = 0;
3434
type="button"
3535
class="chat-history-search-palette__scrim"
3636
aria-label="Close search"
37-
(click)="close.emit()"
37+
(click)="closed.emit()"
3838
></button>
3939
<div
4040
class="chat-history-search-palette"
@@ -64,7 +64,7 @@ let paletteInstanceCounter = 0;
6464
type="button"
6565
class="chat-history-search-palette__close"
6666
aria-label="Close"
67-
(click)="close.emit()"
67+
(click)="closed.emit()"
6868
>
6969
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
7070
<line x1="18" y1="6" x2="6" y2="18"/>
@@ -116,8 +116,7 @@ export class ChatHistorySearchPaletteComponent {
116116
readonly placeholder = input<string>('Search conversations');
117117

118118
readonly threadSelected = output<string>();
119-
// eslint-disable-next-line @angular-eslint/no-output-native
120-
readonly close = output<void>();
119+
readonly closed = output<void>();
121120

122121
protected readonly activeIndex = signal<number>(0);
123122
protected readonly listId = `chat-history-search-palette__results-${++paletteInstanceCounter}`;
@@ -155,7 +154,7 @@ export class ChatHistorySearchPaletteComponent {
155154
protected onInputKeydown(e: KeyboardEvent): void {
156155
if (e.key === 'Escape') {
157156
e.preventDefault();
158-
this.close.emit();
157+
this.closed.emit();
159158
return;
160159
}
161160
if (e.key === 'ArrowDown') {

0 commit comments

Comments
 (0)