Skip to content

fix(dashboard): show an error state instead of a confident zero - #918

Merged
rubenvdlinde merged 1 commit into
developmentfrom
fix/kpi-tiles-show-errors
Aug 27, 2026
Merged

fix(dashboard): show an error state instead of a confident zero#918
rubenvdlinde merged 1 commit into
developmentfrom
fix/kpi-tiles-show-errors

Conversation

@rubenvdlinde

Copy link
Copy Markdown
Contributor

The four KPI tiles already caught their fetch failures into this.error — the shared dashboardRefreshMixin has declared error: null alongside loading all along. Nothing ever rendered it.

A failed load therefore left count at 0 and the tile showed "0 decisions", "0 votes", "0 meetings" — indistinguishable from a genuinely empty collection. Zero is a number a reader believes, which makes it worse than showing nothing.

One line per tile. CnStatsBlock's error prop (nextcloud-vue 2.19.0) renders a dash and "Unavailable", tints the tile, and takes precedence over count, loading and emptyLabel — a stale count during a failure is exactly what must not survive.

Checked rather than assumed:

  • error is reactive here. It lives in the mixin's data(), not the SFCs, so grep 'error:' *KpiWidget.vue finds nothing and the binding looks broken. It isn't — all four assign this.error in their catch.
  • The prop exists in the version this app resolves: package.json ranges ^2.19.0, node_modules holds 2.19.0, and that copy contains hasError(). Without that check this would have been an inert attribute — Vue drops an unknown prop silently, the page renders, the feature does nothing, and CI stays green.

eslint, prettier and the webpack build pass.

The four KPI tiles already caught their fetch failures and stored them in
`this.error` — the shared `dashboardRefreshMixin` has declared `error: null`
alongside `loading` all along. Nothing ever rendered it.

So a failed load left `count` at 0 and the tile displayed "0 decisions", "0
votes", "0 meetings" — indistinguishable from a genuinely empty collection.
Zero is a number a reader believes, which makes it worse than showing nothing:
a dashboard with a dead backend looked like a dashboard reporting calm.

One line per tile. `CnStatsBlock`'s `error` prop (nextcloud-vue 2.19.0) renders
a dash and "Unavailable" in place of the number, tints the tile, and takes
precedence over `count`, `loading` and `emptyLabel` — a stale count during a
failure is exactly what must not survive.

Checked rather than assumed:

- `error` is reactive here. It is declared in the mixin's `data()`, not in the
  SFCs, so `grep 'error:' *KpiWidget.vue` finds nothing and the binding looks
  broken. It is not — all four assign `this.error` in their `catch`.
- The prop EXISTS in the version this app resolves. `package.json` ranges
  `^2.19.0`, `node_modules` holds 2.19.0, and that copy contains `hasError()`.
  Without that check this would have been an inert HTML attribute: Vue drops an
  unknown prop silently, the page renders, the feature does nothing, and CI
  stays green.

eslint, prettier and the webpack build all pass.
@github-actions

Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/decidiq @ 44d74ce

Check PHP Vue Security License Tests
lint
phpcs
phpmd
psalm
phpstan
phpmetrics
eslint
stylelint
build
check-manifest
check-nav-ceiling
test-l10n
format
check-l10n-js
check-schema-l10n
composer ✅ 104/104
npm ✅ 557/557
app:check-code ⏭️
info.xml
REUSE
PHPUnit
Newman
Playwright
Hydra gates

Quality workflow — 2026-08-27 06:36 UTC

Download the full PDF report from the workflow artifacts.

@rubenvdlinde
rubenvdlinde merged commit 6f5452b into development Aug 27, 2026
87 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants