Skip to content
Open
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
1 change: 1 addition & 0 deletions cspell.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ words:
- strs
- stubbed
- swaggerui
- tabular-nums
- TCGC
- TEAMPROJECTID
- terlson
Expand Down
32 changes: 32 additions & 0 deletions packages/spec-dashboard/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,37 @@
# Spector Dashboard

## Coverage overview groups

Use `groupEmitters` to combine emitters into named overview cards:

```tsx
<Dashboard
coverageSummaries={coverageSummaries}
showOverview
groupEmitters={[
{
name: "C#",
emitters: ["@azure-typespec/http-client-csharp", "@azure-typespec/http-client-csharp-mgmt"],
},
]}
emitterDisplayNames={{
"@azure-typespec/http-client-csharp": "C# (Data plane)",
"@azure-typespec/http-client-csharp-mgmt": "C# (Management plane)",
}}
/>
```

Each card shows the union of its emitters' coverage, with individual percentages underneath.
A scenario counts once per table and is covered if any member reports `pass`, `not-applicable`,
or `not-supported`. Two emitters each covering 50 of 100 scenarios, with 25 shared successes,
produce **75%** combined coverage. Counts follow the selected tier and use each table's reports;
equally named scenarios in different tables/spec sets remain separate.

Groups and emitter rows follow the configured order; ungrouped emitters keep separate cards
afterward. `emitterDisplayNames` controls row and table labels without affecting grouping.
These options are also available on `DashboardFromAzureStorage`'s `options` and do not change
table columns or report loading.

## Dev

```bash
Expand Down
12 changes: 12 additions & 0 deletions packages/spec-dashboard/src/apis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ export interface TableDefinition {
emitterNames?: string[];
}

export interface EmitterGroup {
/** Overview card label. */
readonly name: string;
/** Emitter package names, in display order. */
readonly emitters: readonly string[];
}

export interface CoverageFromAzureStorageOptions {
readonly storageAccountName: string;
readonly containerName: string;
Expand All @@ -34,6 +41,11 @@ export interface CoverageFromAzureStorageOptions {
readonly showOverview?: boolean;
/** Optional friendly display names for emitters. Key is the emitter package name, value is the display name. */
readonly emitterDisplayNames?: Readonly<Record<string, string>>;
/**
* Overview groups in display order. Count each scenario once per table, covered if any member covers it.
* Does not change table columns or report loading.
*/
readonly groupEmitters?: readonly EmitterGroup[];
Comment thread
timotheeguerin marked this conversation as resolved.
}

export interface GeneratorCoverageSuiteReport extends CoverageReport {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@
gap: 16px;
}

.overview {
display: flex;
min-width: 0;
}

.card {
flex: 1;
background-color: var(--colorNeutralBackground1);
padding: 16px 16px 20px;
text-align: center;
Expand All @@ -27,6 +33,7 @@
align-items: center;
gap: 4px;
min-height: 100px;
min-width: 0;
}

.card-name {
Expand All @@ -35,4 +42,35 @@
display: flex;
align-items: center;
text-align: center;
overflow-wrap: anywhere;
}

.emitters {
align-self: stretch;
margin: 8px 0 0;
padding-top: 8px;
border-top: 1px solid var(--colorNeutralStroke2);
display: flex;
flex-direction: column;
gap: 6px;
}

.emitter-row {
display: flex;
align-items: baseline;
justify-content: space-between;
gap: 8px;
}

.emitter-name {
min-width: 0;
color: var(--colorNeutralForeground2);
text-align: left;
overflow-wrap: anywhere;
}

.emitter-percentage {
margin: 0;
flex-shrink: 0;
font-variant-numeric: tabular-nums;
}
Loading
Loading