feat(ui): [6] Repo box with README tab #109

Merged
deadstyle merged 11 commits from feature/104-repo-box-readme into develop 2026-10-09 12:14:38 -05:00
Owner

Summary

Part 1 of 3 of #98. Adds box [6] Repo to a regular repo with Details tabs README · Files · Branches. README renders as markdown (same renderer as PR bodies) and scrolls; Files and Branches show "Coming soon" until #106 and #105.

Changes

  • New optional forge.ReadmeReader capability (+ ActReadme), implemented by the Gitea/Forgejo and GitHub adapters and the fake/demo forge.
  • core.Service.Readme / PeekReadme; "no README" is cached as an empty README.
  • UI: boxRepo with number = kind+1, boxes.kinds()/step() so 6 and tab stay correct when Actions is hidden; the ★ Renovate view is unchanged.
  • docs/design.md, docs/architecture.md, docs/mockup.html updated.

Decisions

  • Decided: Forgejo/Gitea has no /readme endpoint (404 on git.bobparsons.dev), so the adapter lists the repo root contents, picks the README (.md first), and fetches it. The README is found at the repo root only.
  • Decided: new capability interface rather than widening Forge (ADR 0006 pattern).
  • Decided: the cached "no README" answer is observed via PeekReadme; fetch still calls the adapter on a re-select.

Test plan

  • make build, go test -race ./..., golangci-lint run (0 issues), format check: all pass locally.
  • make check's install-script test needs shellcheck, absent on this machine; CI runs it.
  • Adapter calls verified against fixtures only, not a live GitHub.

Refs #104, #98

🤖 Generated with Claude Code

https://claude.ai/code/session_01RTN2GnGvYhWwPhsSDiWp8n

## Summary Part 1 of 3 of #98. Adds box `[6]` Repo to a regular repo with Details tabs `README · Files · Branches`. README renders as markdown (same renderer as PR bodies) and scrolls; Files and Branches show "Coming soon" until #106 and #105. ## Changes - New optional `forge.ReadmeReader` capability (+ `ActReadme`), implemented by the Gitea/Forgejo and GitHub adapters and the fake/demo forge. - `core.Service.Readme` / `PeekReadme`; "no README" is cached as an empty README. - UI: `boxRepo` with number = kind+1, `boxes.kinds()`/`step()` so `6` and `tab` stay correct when Actions is hidden; the ★ Renovate view is unchanged. - `docs/design.md`, `docs/architecture.md`, `docs/mockup.html` updated. ## Decisions - Decided: Forgejo/Gitea has no `/readme` endpoint (404 on git.bobparsons.dev), so the adapter lists the repo root contents, picks the README (`.md` first), and fetches it. The README is found at the repo root only. - Decided: new capability interface rather than widening `Forge` (ADR 0006 pattern). - Decided: the cached "no README" answer is observed via `PeekReadme`; `fetch` still calls the adapter on a re-select. ## Test plan - `make build`, `go test -race ./...`, `golangci-lint run` (0 issues), format check: all pass locally. - `make check`'s install-script test needs `shellcheck`, absent on this machine; CI runs it. - Adapter calls verified against fixtures only, not a live GitHub. Refs #104, #98 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01RTN2GnGvYhWwPhsSDiWp8n
Add domain.Readme and the optional ReadmeReader capability, gated by
ActReadme. Gitea/Forgejo has no README endpoint, so its adapter lists
the repo root and picks the best candidate; GitHub uses GET /readme.
The forgetest fake and demo data gain a README to match.

Refs #104

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RTN2GnGvYhWwPhsSDiWp8n
A not-found README is cached as an empty domain.Readme, because
fetch only stores successful results and an uncached miss would
refetch on every selection.

Refs #104

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RTN2GnGvYhWwPhsSDiWp8n
A regular repo shows a Repo box numbered 6, reachable with 1-6 or tab.
Its README tab renders the markdown at pane width; Files and Branches
say "Coming soon". Box numbers are boxKind+1, and the visible boxes come
from kinds(), so slots 3 and 4 stay reserved for Renovate and Releases.
Action keys are disabled on the Repo item.

Refs #104

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RTN2GnGvYhWwPhsSDiWp8n
Update design.md (boxes table, keymap, v1 scope), architecture.md (Readme
type, ReadmeReader, README API mapping, Forgejo root-only lookup) and the
mockup (box list, Repo box, keys) for the Repo box.

Refs #104

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RTN2GnGvYhWwPhsSDiWp8n
Criterion-derived tests for box [6] Repo and its README tab on Forgejo/Gitea and GitHub: adapter fixtures, the Fake, core caching, and ui navigation, rendering and load handling. They name seams that do not exist yet, so the packages fail to compile until the feature lands.

Refs #104

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RTN2GnGvYhWwPhsSDiWp8n
Refs #104

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RTN2GnGvYhWwPhsSDiWp8n
Refs #104

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RTN2GnGvYhWwPhsSDiWp8n
Refs #104

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RTN2GnGvYhWwPhsSDiWp8n
The Repo box row also names the repo, so the last match picked it.

Refs #104

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RTN2GnGvYhWwPhsSDiWp8n
The no-README cache is observed through PeekReadme (fetch always calls
the adapter), the Repo box row is the demo repo, the star-view check
matches the box title not the status text, and README images get a
link-fallback test.

Refs #104

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RTN2GnGvYhWwPhsSDiWp8n
chore: merge develop
All checks were successful
ci / check (pull_request) Successful in 1m11s
378b394a82
deadstyle merged commit cc22f4bf2f into develop 2026-10-09 12:14:38 -05:00
deadstyle deleted branch feature/104-repo-box-readme 2026-10-09 12:14:38 -05:00
Sign in to join this conversation.
No description provided.