Skip to content
PifeatureCLI & tooling13 files · +1100 −253

Add offline `economist demo` mode to economist-tui Go CLI

Session from economist-tui-sessions on Hugging Face by thomasmustier · MIT · condensed by Coders Talk

1h 44msession
1interventions
GOAL

Implement GitHub issue #4: add a safe, offline demo mode to the economist-tui terminal app that renders placeholder content without needing login or hitting the paywall, usable for README/docs screenshots.

  1. Prompt · +0
    Review gh issue #4, read relevant files, and agree on intent/approach before implementing
  2. Agent did · +0m
    Worked around gh auth failure using the GitHub REST API to fetch the issue, then read through cmd/, internal/browse, internal/rss, internal/fetch, internal/article, internal/ui and docs to understand the codebase before proposing a demo-mode design
  3. Break · 33m away, not counted
  4. Prompt · +34m
    Just have `economist demo` open browse with a DataSource abstraction, demo data labeled 'Leaders - demo', built to avoid debt for future section/rendering work
  5. Agent did · +37m
    Added a DataSource interface to decouple browse.go/model.go from live fetching, created internal/demo package with a static feed and demo command, bumped version, updated README/release notes, and passed go test ./...
  6. Prompt · +43m
    Discussed what real-world text could be used for demo/test fixtures without copyright risk, eventually deciding to use OCR text from a 1940 public-domain Economist issue on archive.org
  7. Agent did · +1h 8m
    Downloaded the 1940 djvu OCR text, extracted two articles ('Fair Exchange' and 'German Europe'), saved them as local fixtures with a provenance README, wired demo.go to embed and use them, and tightened demo tests
  8. Prompt · +1h 22m
    Fast-forward and build - there have been PRs merged upstream
  9. Agent did · +1h 22m
    Stashed local changes, fast-forwarded main to origin, reapplied demo work, resolved merge conflicts in browse.go/model.go/RELEASE_NOTES.md, bumped version and reran tests
  10. Intervention · +1h 26m
    Developer noticed the version bump was stale after the fast-forward pull
    Why: Upstream had moved further while I was merging, so the version number needed to reflect that, not just my own change.
  11. Agent did · +1h 26m
    Bumped version to 0.2.3, updated homebrew-tap formula and sha256, built and installed locally via make, fixed incorrect dates on the two real 1940 fixture articles, then committed/pushed both repos after resolving a second rebase conflict
  12. Outcome · +1h 44m
    economist demo shipped: new DataSource abstraction, internal/demo package with two real 1940 public-domain fixtures plus synthetic articles, version bumped to 0.2.3, homebrew-tap formula updated and pushed, all changes committed and pushed to main after resolving two rebase conflicts
VERDICT

I'd start the first prompt by naming the exact command shape I want (`economist demo`, no flags) and flagging up front that I want a clean DataSource abstraction so future section/rendering changes don't create debt — that's what I ended up asking for mid-session anyway. The correction that did the most work was pushing back on 'copyrighted' being interpreted too literally, which led us to real public-domain 1940 Economist text instead of synthetic filler, making the demo genuinely nice. Catching the stale version number after the upstream fast-forward also mattered, since it would've shipped the wrong homebrew formula otherwise.

I tried this · 0

Discussion · 0

How Builds work