Back to Feed
article 3m read

A JSON printout sat where the dashboard framework should have been on its prototype page

A dashboard-as-code prototype drew its charts with the app's old chart code and printed the dashboard spec underneath, so editing the spec changed nothing; the real result was a version-conflict warning sitting under a row of green checkmarks.

Article DepthPractice

Flow

Four edits that show if the file is in charge

  1. 1Add an entry

    A new chart should appear

  2. 2Rename it

    The chart title should change

  3. 3Remove it

    The chart should go away

  4. 4Use an unknown kind

    The page should show an error, not a blank

On its own prototype page, the dashboard framework was missing when I went looking for it.

The page was new in the admin app's sidebar. It was meant to try out an open-source dashboard tool where each dashboard is a JSON file. That file lists where the data comes from, which charts to show and where they sit. You keep it in git and review it like code. That idea appeals to me, so I read both changes line by line.

The stub

The first version installed the tool's packages and imported its parts, but never put them on screen. It showed a dashed placeholder box and printed the JSON file below it. The JSON had no charts in it yet. For a first step, that's fine.

The version that looks finished

The second version took the tool's imports out. It pulled a week of numbers from the app's existing metrics endpoint and drew four charts with the same code the main overview page uses. The JSON got two chart entries and was printed again, under the charts. The packages stayed installed, unused.

Where the arrow is missing

The problem fits in one line: the charts and the JSON never touch. The charts come from old code. The JSON is a fixed object that nothing reads. Edit the JSON and no chart changes. It even lists half as many charts as the page draws.

So the page proves the endpoint can feed charts, which nobody doubted. It doesn't prove the tool can draw this app's data, which was the point. The page's own status list gives that away: one warning says the real tool is waiting on a React version conflict, though I haven't checked that myself. That warning is the actual result, and it sits under a row of green checkmarks. The docs added later called the whole thing proven, while their own fine print listed the same conflict.

Changing the JSON should move a chart

If you're trying out any tool that runs from a config file, check that the file is really in charge:

  • add an entry and see a new chart;
  • rename it and see the title change;
  • remove it and see the chart go;
  • give it a kind the tool doesn't know and see an error, not a blank.

The SQL in the spec

The docs also plan to put SQL inside the JSON file, with the organization ID pasted into it. These files are meant to be shared and imported, so anyone who edits one could change that ID. The server has to decide which organization a user belongs to and ignore what the file says.

Probably the next real step is a small branch that tries to mount the tool on this app's React version. Neither change attempts that, so the conflict is still a claim on a status list.

Keep reading

Pick up a connected idea or branch into a nearby one.

5 paths forward