generated from mathias/template-go-web
feat(atlas): UX sprint — progressive disclosure (Plain default + transitions)
Makes the atlas self-explanatory. Every stage/node gains a plain-language layer (plain_title + plain "what happens" + jargon-free node text); the previous technical copy demotes to a subtitle + on-demand detail. A Plain⇄Technical toggle (default Plain, persisted) flips the whole atlas. Biggest win: every transition arrow is now LABELLED with "what must be true to advance" (the gated- flow story that was invisible), gate hops (human @04, CI @06) styled distinctly. Spine repositioned into a uniform header band so labels never collide with copy. Copy grounded in a fresh-eyes UX review (docs/UX-REVIEW.md, reviewer≠implementer). Data model: plain_title/plain/trans_label/trans on Stage, plain on Node — guarded by a test (every stage has plain_title + a transition). Live overlays unchanged. Verified: build/vet/lint(0)/test green; Plain render screenshot-checked. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -41,6 +41,29 @@ func TestBuild_OverlaysCIStageNodesFromWorkflow(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestDefault_HasPlainLayerAndTransitions(t *testing.T) {
|
||||
a, err := atlas.Build(atlas.DataJSON, []byte("jobs:\n guard:\n a: 1\n"))
|
||||
if err != nil {
|
||||
t.Fatalf("Build embedded atlas: %v", err)
|
||||
}
|
||||
for _, s := range a.Stages {
|
||||
if s.PlainTitle == "" {
|
||||
t.Fatalf("stage %s missing plain_title", s.No)
|
||||
}
|
||||
if s.TransLabel == "" {
|
||||
t.Fatalf("stage %s missing trans_label", s.No)
|
||||
}
|
||||
if s.Generate == "ci-jobs" {
|
||||
continue // nodes are generated live, no authored plain
|
||||
}
|
||||
for _, n := range s.Nodes {
|
||||
if n.Plain == "" {
|
||||
t.Fatalf("stage %s node %q missing plain", s.No, n.Title)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestBuild_ErrorsOnBadAtlasJSON(t *testing.T) {
|
||||
if _, err := atlas.Build([]byte("{not json"), []byte("jobs:\n x:\n a: 1\n")); err == nil {
|
||||
t.Fatal("expected error on bad atlas JSON, got nil")
|
||||
|
||||
Reference in New Issue
Block a user