Tools & Dev Environment3 min read

My hub had no way to draw a card without a number

I added two cards to the personal hub that collects my projects' status on one screen. One read a metrics endpoint behind an admin key. The other only needed a link and a note, and my card renderer had no branch for that case.

#dashboard#observability#python#env-vars#metrics
A dashboard card that only renders with a number on the left, next to a card holding only a note on the right
A renderer built around numbers had no place for a source that only had a note.

Two sources missing from the hub

I use a small Python hub (hub.py) to see the status of my projects on one screen. Each card has a source, and a render function turns that source into what shows up on screen.

On 2026-08-05 I added two cards to it. One is a metrics card for a fortune-telling style app, and it reads that app's /admin/metrics endpoint. The other tracks inbound traffic to this devlog by pointing at a dev-inflow.html page served locally on port :8899.

The whole change was 11 added lines in hub.py. Besides the two cards, those 11 lines include one more thing: a note_only branch in render_card.

Does every card on your dashboard need a number before it can render, or can a note that says "go look here" count as a card too?

Why it needed a branch

The branch's name tells you what the renderer assumed before. If I had to add a branch called note_only, the renderer had been written as if every card carried a value. A source with no number I could pull directly, one that only needed a note and a link, couldn't take the shape of a card in that renderer.

This trap is common. When you start a dashboard you wire up the sources that produce numbers first, so the renderer settles into assuming a number. Then a source without one comes along and you get two options: force it in with a fake or empty value, or leave it off the hub. Either way the hub ends up showing a narrower picture than the one you actually wanted.

The key stays out of the code

The metrics card had one more condition. It reads an admin endpoint, so it needs a key. In this commit the key isn't written into the code. It's read from the SAJUDUO_ADMIN_KEY environment variable. The hub code lives in the repo, and the key lives only in the runtime environment.

What would you do? Change the renderer so it accepts number-less cards, or keep number-less sources off the hub?

What I picked

I changed the renderer. I added a note_only branch to render_card so a card with only a note and no value renders as a normal card. Then I put the metrics card and the inflow card on the hub. Adding the sources and widening the card shapes the renderer accepts happened in the same commit.

Self-check

  • Does your dashboard's render function treat a card without a value as a normal path, or does it throw or render a blank?
  • Is there a source you want to watch but kept off your hub because it has no number to pull directly?
  • For cards that read admin endpoints, does the key live only in an environment variable and not in the code?

The honest part

This post rests on one 11-line commit. The commit doesn't say which of the two cards renders as note_only, what numbers the metrics card actually shows, or what I learned after the cards went up. So I can't write about "what I saw once the cards were there." Here's what I can say: a renderer built around numbers quietly pushes number-less sources off the screen, and fixing that didn't take much work.

Related