Skip to content

Seed tasks at startup and add dark-themed task list page - #7

Merged
aj-enns merged 1 commit into
mainfrom
aj-enns-seed-task-list
Jun 24, 2026
Merged

Seed tasks at startup and add dark-themed task list page#7
aj-enns merged 1 commit into
mainfrom
aj-enns-seed-task-list

Conversation

@aj-enns

@aj-enns aj-enns commented Jun 24, 2026

Copy link
Copy Markdown
Owner

Why

GET /tasks started empty, so the sample app's list view looked blank on a fresh boot during demos. This pre-loads a few tasks at startup and gives them a readable, modern home page.

What changed

  • Seed on startup. Added a seed(titles: string[]) method to TaskStore that creates a task per title. server.ts now constructs the store explicitly and seeds it with four tasks ("comb my hair", "brush my teeth", "pet the octocat", "plan world domination"), then injects it into createApp.
  • Dark-themed UI. Added GET / rendering a dependency-free, GitHub-style dark page (src/tasks/view.ts): each task shows a status dot, title, created time, and an Open/Done badge, plus a done counter. Titles are HTML-escaped.

Notes for reviewers

  • The default store inside createApp is intentionally left empty so the existing tests (which expect an empty store) keep passing. Seeding only happens in server.ts.
  • GET /tasks still returns raw JSON; the styled view lives at /.
  • Verified locally: npm test (8/8 passing) and npm run typecheck both clean.

Add a seed() method to TaskStore and seed four tasks in server.ts so GET /tasks returns a populated list on startup. The injectable default store in createApp stays empty so existing tests still pass.

Also add a modern dark-themed HTML page at GET / that renders the task list (status dot, title, created time, Open/Done badge, done counter); /tasks continues to serve raw JSON.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@aj-enns
aj-enns merged commit b5f75ff into main Jun 24, 2026
1 check passed
@aj-enns
aj-enns deleted the aj-enns-seed-task-list branch June 24, 2026 12:05
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