Skip to content

Commit 0009331

Browse files
Ripwordsclaude
andcommitted
fix(dashboard): correct horizontal bar axis + donut segment slivers
- Top-projects BarChart is orientation=horizontal, so the category (project name) lives on the Y axis. The index→label formatter was bound to x-formatter, leaving the value axis and a lone category label swapped. Move it to y-formatter; the X axis auto-renders the numeric value. - Unovis draws a fixed light stroke between donut segments that does not follow the theme, so it showed as white slivers on the dark dashboard. Repaint via a scoped :deep() rule using the --ui-bg token (theme-safe), scoped to the donut card so area/bar paths are untouched. Both verified visually in a dark + bg-default reproduction of the reported scenario. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 5752139 commit 0009331

1 file changed

Lines changed: 16 additions & 3 deletions

File tree

apps/dashboard/app/pages/admin/index.vue

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@ const topProjects = computed(() =>
6767
)
6868
const hasTopProjects = computed(() => topProjects.value.some((p) => p.open > 0))
6969
const topProjectsCategories = { open: { name: "Open reports", color: C.open } }
70-
const topProjectsXFormatter = (tick: number): string => topProjects.value[tick]?.project ?? ""
70+
// Horizontal bars put the category on the Y axis, so the index→label
71+
// formatter must be the Y formatter (the X axis is the numeric value).
72+
const topProjectsYFormatter = (tick: number): string => topProjects.value[tick]?.project ?? ""
7173
7274
const EVENT_LABEL: Record<string, string> = {
7375
status_changed: "changed status",
@@ -197,7 +199,7 @@ function describeEvent(e: AdminOverviewDTO["recentEvents"][number]): string {
197199
<div class="px-5 py-4 border-b border-default">
198200
<h2 class="text-sm font-semibold text-default tracking-tight">Status distribution</h2>
199201
</div>
200-
<div class="p-5 flex justify-center">
202+
<div class="p-5 flex justify-center donut-segments">
201203
<DonutChart
202204
v-if="hasStatus"
203205
:data="statusData"
@@ -224,7 +226,7 @@ function describeEvent(e: AdminOverviewDTO["recentEvents"][number]): string {
224226
:categories="topProjectsCategories"
225227
:y-axis="['open']"
226228
:orientation="Orientation.Horizontal"
227-
:x-formatter="topProjectsXFormatter"
229+
:y-formatter="topProjectsYFormatter"
228230
/>
229231
<div v-else class="text-sm text-muted py-10 text-center">No open reports yet.</div>
230232
</div>
@@ -339,3 +341,14 @@ function describeEvent(e: AdminOverviewDTO["recentEvents"][number]): string {
339341
/>
340342
</div>
341343
</template>
344+
345+
<style scoped>
346+
/* Unovis draws a fixed light stroke between donut segments that doesn't
347+
follow the theme, so on the dark dashboard it shows as white slivers.
348+
Repaint it with the card background token (theme-safe in light + dark).
349+
Scoped to the donut card only so the area/bar chart paths are untouched. */
350+
.donut-segments :deep(svg path) {
351+
stroke: var(--ui-bg);
352+
stroke-width: 1.5px;
353+
}
354+
</style>

0 commit comments

Comments
 (0)