Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ Each keeps its own approval rules, models and spend limit.
`home` answers what needs you, what is unread, what is running and what it
cost, for all of them at once. A digit answers a question from its row.

<img src="assets/readme/screens/home.webp" alt="Home in two columns: needs you, unread, where you were, running and scheduled on the left; projects, spend and since you left on the right" width="100%">
<img src="assets/readme/screens/home.webp" alt="Home in two columns: needs you, unread, where you were and running on the left; projects, spend and since you left on the right (the current Home adds standing)" width="100%">

## Talk, and it becomes tasks

Expand Down
45 changes: 45 additions & 0 deletions cmd/codeaf/readme_home_alt_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package main

import (
"os"
"path/filepath"
"regexp"
"strings"
"testing"
)

func TestReadmeHomeImageAltHasNoRetiredPanels(t *testing.T) {
readmePath := filepath.Join("..", "..", "README.md")
data, err := os.ReadFile(readmePath)
if err != nil {
t.Fatalf("read README.md: %v", err)
}

re := regexp.MustCompile(`<img\s+[^>]*src="assets/readme/screens/home\.webp"[^>]*alt="([^"]*)"`)
match := re.FindSubmatch(data)
if len(match) < 2 {
t.Fatal("README.md is missing alt text for assets/readme/screens/home.webp")
}
alt := strings.ToLower(string(match[1]))

for _, retired := range []string{"scheduled"} {
if strings.Contains(alt, retired) {
t.Errorf("Home screenshot alt text still names retired panel %q: %q", retired, alt)
}
}

for _, required := range []string{
"needs you",
"unread",
"where you were",
"running",
"projects",
"spend",
"since you left",
"standing",
} {
if !strings.Contains(alt, required) {
t.Errorf("Home screenshot alt text omits expected panel %q: %q", required, alt)
}
}
}
8 changes: 8 additions & 0 deletions docs/changes/unreleased/3015-readme-home-alt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
kind: fixed
title: Update README Home screenshot alt text to remove retired scheduled panel
pr: 3015
surface: [docs]
invalidates:
- "Was true: the Home screenshot alt text in README.md named the retired scheduled panel on the left column. Is true now: the alt text names only the visible panels (needs you, unread, where you were, running, projects, spend, since you left) and notes standing for the current Home, enforced by a unit check."
---