Skip to content

Commit 5a2be8d

Browse files
corvid-agentclaude
andauthored
fix: spec list scrolling and default category sort order (#10)
The spec list wasn't scrollable because the Angular host element wasn't participating in the sidebar's flex layout. Added :host styles and min-height: 0 so overflow can take effect. Also added a keyvalue comparator to pin the 'default' category to the top of the list. Co-authored-by: Claude Opus 4 <noreply@anthropic.com>
1 parent 2f95439 commit 5a2be8d

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

src/app/components/spec-list/spec-list.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
</div>
66

77
<div class="suite-scroll-area">
8-
@for (entry of store.suites() | keyvalue; track entry.key) {
8+
@for (entry of store.suites() | keyvalue:suiteOrder; track entry.key) {
99
<div class="suite-group">
1010
<button
1111
class="suite-header"

src/app/components/spec-list/spec-list.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
1+
:host {
2+
display: flex;
3+
flex-direction: column;
4+
flex: 1;
5+
min-height: 0;
6+
}
7+
18
.spec-list {
29
display: flex;
310
flex-direction: column;
411
flex: 1;
12+
min-height: 0;
513
overflow: hidden;
614
padding: 12px;
715
}

src/app/components/spec-list/spec-list.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,13 @@ export class SpecListComponent {
8080
return this.collapsedSuites().has(suiteName);
8181
}
8282

83+
/** Comparator for keyvalue pipe: 'default' first, then alphabetical */
84+
suiteOrder = (a: { key: string }, b: { key: string }): number => {
85+
if (a.key === 'default') return -1;
86+
if (b.key === 'default') return 1;
87+
return a.key.localeCompare(b.key);
88+
};
89+
8390
/** Extract a one-line preview from the spec body */
8491
getPreview(spec: Spec): string {
8592
if (!spec.body) return 'No description';

0 commit comments

Comments
 (0)