Skip to content

Add a plain theme for a quick read - #280

Merged
coryodaniel merged 6 commits into
dashboardfrom
dashboard-plain
Nov 30, 2026
Merged

coryodaniel merged 6 commits into
dashboardfrom
dashboard-plain

Conversation

@coryodaniel

@coryodaniel coryodaniel commented Nov 28, 2026 •

Copy link
Copy Markdown
Member

Stacked on #279.

A fourth theme, plain, for the quickest read: environments listed by project, one line each, and nothing moving.

  • Each line shows the environment's health dot (⟳ while it deploys, 🔭 when out of view, ◌ without access), its name, and only the facts that apply: alarms firing, deploys in flight, failed instances, how many instances are up, upgrades, a banner, and cost when c is on.
  • Projects get a colored header. When a column fills, the next project starts a new column, and environments you can't see sit at the end under "More".
  • The selection, blast-radius colors, the side panel, and the arrow keys work as they do on the map. There are no stars, sparks, or rings.
  • --theme plain, or v to cycle to it.

🤖 Generated with Claude Code

…ving

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coryodaniel

Copy link
Copy Markdown
Member Author

@claude please review.

@claude

claude Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

Claude finished @coryodaniel's task in 1m 35s —— View job


Review of #280: plain theme

go test ./internal/commands/dashboard/ passes. I did not run make check or make docs. The change is small and fits the existing theme plumbing. I found one functional gap and a few smaller points.

1. e (SVG export) doesn't handle plain.
internal/commands/dashboard/export.go:33-40 switches on ThemeMetro and ThemeRadar and falls through to x.constellation(). On the plain theme, e would draw a constellation using the plain list's positions. That is a column of dots with star-style decoration, which is probably not what anyone wants. Either add a ThemePlain case that draws the list in SVG, or make the export skip or refuse plain, and update the docs sentence about e either way. Right now docs/helpdocs/dashboard.md says only "metro and radar draw the blast radius in their links."

2. Environments past the bottom of the last column are unreachable.
plainCells (plain.go:43-60) only starts a new column when col < cols-1. In the last column, or on a narrow terminal with one column, rows keep growing past h. PlainLayout still gives those environments positions, so the arrow keys can select something that is off-screen with no scrolling. A big org on an 80×24 terminal will hit this. Some options are to scroll to keep the selection in view, to collapse overflow into a "+N more" line, or at least to clamp. This needs a decision, even if the answer is "document it."

3. "Nothing moving" is not quite true.
plainLine uses spinner[(s.Frame/3)%len(spinner)] for deploying environments, which animates. That matches the PR body ("a spinner while it deploys") but contradicts the "nothing moving" wording in the title and docs. animatedPos() (views.go:63) may also tween positions when you switch theme. Consider a static glyph for deploys, or loosen the wording.

4. Test gaps (diagrams_test.go).

  • The braille check uses r > 0x2800, which skips U+2800 itself. Use >=.
  • The down assertion only checks that the selection is not care-dev. It doesn't show that it moved to the expected next line. Asserting the actual ID would catch ordering regressions.
  • Nothing covers the multi-column wrap, the "Beyond your access" group, Unloaded or Restricted rows, or truncation at a narrow width. These are the riskiest paths in plain.go, and a table-driven test on PlainLayout/plainCells would be cheap. Per CLAUDE.md, a plain_test.go is fine since plain.go is a new source file.

5. Minor.

  • plainRows and plainCells are recomputed in renderPlain on every frame, and the column math is duplicated between plainCells and renderPlain. A small plainGeometry(w) helper would remove the duplication and avoid drift.
  • Sorting projects by ProjectName+a can mis-order names where one is a prefix of another (e.g. "Care" and "Care2"). Compare name first and then ID separately. The same applies to a.Name+a.ID for environments.
  • plainFacts shows "0/0 up" for an environment with no instances. Consider omitting it.
  • plain.go has a doc comment on exported items only, which is fine. I have no CLAUDE.md comment concerns.

Summary: Item 1 is the one I'd fix before merge. Item 2 is worth a decision. The rest are polish.

@coryodaniel

Copy link
Copy Markdown
Member Author

Fixed in a8d7575:

  • 1: e on the plain theme exports the list itself: project headers, a dot, the name and the facts for each line, with no links or backdrop. TestPlainExport covers it, and the helpdoc says plain exports its list.
  • 2: environments that don't fit are left out of the layout, so the arrow keys can't select something off screen. A "+N more · / finds any environment" line takes their place. TestPlainLayout covers fitting, spilling into a column, and running out of room.
  • 3: a deploying environment shows a static ⟳, so nothing moves.
  • 4: the braille check uses >=, down is asserted to land on platform-dev, and the plain tests moved to plain_test.go.
  • 5: projects and environments sort by name, then ID. Rows with no instances show no "0/0 up". The column math lives in one plainSheet.

@claude please review.

@claude

claude Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

Claude finished @coryodaniel's task in 1m 46s —— View job


Review of a8d7575

go test ./internal/commands/dashboard/ passes and make docs leaves no diff. I did not run make check, so lint is unchecked. I read plain.go, plain_test.go, and the export, scene and docs changes. All five items from the earlier review are addressed, and I found nothing that should block the merge.

Earlier items

  • 1. Export: x.plain draws the list with no backdrop or links. TestPlainExport checks the XML is valid, the headers and facts are present, and there is no <path. The helpdoc and the generated doc agree.
  • 2. Overflow: newPlainSheet leaves out environments that don't fit, so the arrow keys can't select something off screen. The "+N more · / finds any environment" line takes their place. TestPlainLayout covers fitting, spilling into a second column, and running out of room.
  • 3. Static deploy glyph: ⟳ is drawn with no frame lookup, so nothing animates. Render also returns before unfold and the stars, so the theme switch doesn't tween positions.
  • 4. Tests: the braille check uses >=, down is asserted to land on platform-dev, and the tests moved to plain_test.go.
  • 5. Cleanup: sorting is name then ID, "0/0 up" is gone, and the column math lives in one plainSheet.

Minor points, none blocking

  • SVG fact column drifts. x.plain starts the fact column at 6 + nameW*2 dots, while plainLine in the terminal starts it at 2*(4+nameW), 2 dots further right. Nothing breaks, but the two outputs don't quite line up.
  • SVG facts aren't clipped. Unlike the terminal's plainLine, which breaks when a fact would pass the column edge, the SVG draws every fact. On a narrow export, a long fact line can run into the next column.
  • moreAt is overwritten per project. The loop in newPlainSheet reassigns moreAt on every project, so the "+N more" line lands under the last project's column, not necessarily the column where the overflow began. That's harmless when the overflow is in the last column. If a single project is taller than a non-last column, the line shows in a different column from the cut.
  • Test gaps. TestPlainLayout never exercises "Beyond your access" (the empty-ProjectID ordering in plainRows), Unloaded or Restricted rows, or the truncation at a narrow width. A table case or two in plain_test.go would cover them.

Overall this is good to merge, with the above as optional polish.

coryodaniel and others added 3 commits November 28, 2026 00:40
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…column

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coryodaniel

Copy link
Copy Markdown
Member Author

Fixed in 03deeb0:

  • moreAt is set where the overflow begins, not on every project.
  • SVG facts start in the same column as in the terminal, and stop at the column's edge.
  • TestPlainTheme checks the "More" group and its restricted environment.

@claude please review.

@claude

claude Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

Claude finished @coryodaniel's task in 1m 33s —— View job


Review of 03deeb0

go test ./internal/commands/dashboard/ passes and go vet is clean. I did not run make check or make docs, so lint and the docs diff are unchecked. I found nothing blocking.

Earlier items

  • moreAt: it is set once, where the overflow begins (plain.go, newPlainSheet). It is guarded by sheet.more == 0 and sits at x+2, on the row where the first omitted environment would have gone. If the overflow is in a non-last column, later projects wrap to the next column and moreAt stays at the cut. That is the right behavior.
  • SVG fact column and clipping: x.plainLine now uses 2*(4+nameW) dots, the same as the terminal's x+3+nameW+1 cells. The edge is 2*(at[0]+colW-2), the same as the terminal's x+w. It breaks before a fact passes the edge. The two outputs now match.
  • Test coverage: TestPlainTheme now checks the "More" header and secret-prod.

Optional nits

  • Remaining test gap: I only found "More" and secret-prod asserted in TestPlainTheme. Narrow-width truncation of facts, in the terminal and in the SVG, is still uncovered. One case with a small w would pin the edge clipping.
  • SVG measurement: advance estimates width as 0.62*fs per cell. It is an approximation, and wide glyphs such as 🔭 or ⚑ may render differently. That is acceptable for an export, but a fact could still run slightly past the edge.

This is good to merge.

Base automatically changed from dashboard-polish to dashboard November 30, 2026 06:12
@coryodaniel
coryodaniel merged commit 6914487 into dashboard Nov 30, 2026
2 checks passed
@coryodaniel
coryodaniel deleted the dashboard-plain branch November 30, 2026 06:13
@coryodaniel

Copy link
Copy Markdown
Member Author

Folded into #272.

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.

1 participant