Skip to content
Merged
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
38 changes: 38 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:

concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
cache: npm

- name: Install dependencies
run: npm ci

- name: Run unit tests
run: npm test

- name: Check app script syntax
run: node --check src/app/main.js

- name: Verify static entrypoint
run: test -f index.html && grep -q 'type="module" src="src/app/main.js"' index.html
61 changes: 61 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: CD

on:
push:
branches: [main]
workflow_dispatch:

permissions:
contents: write

concurrency:
group: pages-production
cancel-in-progress: false

jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
cache: npm

- name: Install dependencies
run: npm ci

- name: Run unit tests
run: npm test

- name: Check app script syntax
run: node --check src/app/main.js

deploy:
name: Deploy to GitHub Pages
needs: test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Prepare static site
run: |
mkdir -p _site
cp index.html _site/
cp -r src _site/
touch _site/.nojekyll

- name: Deploy to gh-pages
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: _site
branch: gh-pages
clean: false
clean-exclude: pr-preview/
force: false
commit-message: Deploy production site from ${{ github.sha }}
56 changes: 56 additions & 0 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: PR Preview

on:
pull_request:
types:
- opened
- reopened
- synchronize
- closed

permissions:
contents: write
pull-requests: write

concurrency:
group: preview-${{ github.event.pull_request.number }}
cancel-in-progress: true

jobs:
preview:
name: Deploy PR preview
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
if: github.event.action != 'closed'
uses: actions/setup-node@v4
with:
node-version: "22"
cache: npm

- name: Install dependencies
if: github.event.action != 'closed'
run: npm ci

- name: Run unit tests
if: github.event.action != 'closed'
run: npm test

- name: Prepare static site
if: github.event.action != 'closed'
run: |
mkdir -p _site
cp index.html _site/
cp -r src _site/
touch _site/.nojekyll

- name: Deploy preview
uses: rossjrw/pr-preview-action@v1
with:
source-dir: ./_site
preview-branch: gh-pages
qr-code: true
wait-for-pages-deployment: false
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules/
coverage/
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Changelog

## Testing infrastructure (2026-06-15)

### Added
- Extracted pure logic into `src/data/constants.js` and `src/lib/*` modules (domain, tree, dates, capture).
- Moved the app script to `src/app/main.js` and wired `index.html` as an ES module entry point.
- Vitest unit tests under `tests/` for domain inference, task tree math, gantt dates, and capture parsing.
- `package.json` with `npm test` / `npm run test:watch`.
- GitHub Actions workflow (`.github/workflows/ci.yml`) to run tests on push and PR.
- GitHub Actions CD workflow (`.github/workflows/deploy.yml`) to deploy the static app to GitHub Pages after tests pass on `main`.

### Public repo / Pages (2026-06-15)

### Changed
- Restored GitHub Pages PR previews (`pr-preview/pr-<n>/`) and automatic production deploy on `main`.
- Removed private-repo artifact-only preview and `ENABLE_GITHUB_PAGES` gate.

### Setup
- Pages source: **Deploy from branch → gh-pages → / (root)**
- Actions: **Read and write permissions**

- The prototype was a single 1700+ line inline script with no automated checks.
- Pulling testable logic into modules gives a stable base for refactors and new features without changing UI behavior.
- ES modules keep the zero-build-step workflow (open `index.html` or serve statically) while enabling Node-based unit tests.
75 changes: 75 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,76 @@
# Task Management Tool

TaskBoard prototype: a single-page task planner with gantt timeline, balance-scale dashboard, voice capture, and transcript extraction.

AI-perc:47%

## Run locally

Open `index.html` in a browser, or serve the repo root:

```bash
npx --yes serve .
```

## Development

Install dependencies and run tests:

```bash
npm install
npm test
```

Watch mode:

```bash
npm run test:watch
```

## Project layout

| Path | Purpose |
|------|---------|
| `index.html` | UI markup and styles |
| `src/app/main.js` | Application logic (DOM, rendering, interactions) |
| `src/data/constants.js` | Team roster, clients, sizes, colors |
| `src/lib/` | Testable pure functions (domain, tree, dates, capture) |
| `tests/` | Vitest unit tests |

## Before opening a PR

1. Run `npm run ci` and confirm all checks pass.
2. Smoke-check the UI in a browser (filter, gantt, task detail sheet).
3. Update `CHANGELOG.md` if you change behavior.

## CI/CD

| Workflow | Trigger | What it does |
|----------|---------|--------------|
| [CI](.github/workflows/ci.yml) | PR + push to `main` | `npm test`, syntax check, entrypoint verification |
| [PR Preview](.github/workflows/preview.yml) | Pull requests | Tests, deploys preview to Pages, comments URL on the PR |
| [CD](.github/workflows/deploy.yml) | Push to `main` | Tests, deploys production site to `gh-pages` |

### One-time setup (after making the repo public)

1. **Settings → Pages → Build and deployment → Source:** `Deploy from a branch`
2. **Branch:** `gh-pages` / `/ (root)`
3. **Settings → Actions → General → Workflow permissions:** `Read and write permissions`

### See the UI on a pull request

After checks pass, a bot comment on the PR includes a link like:

`https://summon-rnd.github.io/task-manager/pr-preview/pr-<number>/`

### Production URL (after merge to `main`)

`https://summon-rnd.github.io/task-manager/`

### Local preview

```bash
gh pr checkout <PR_NUMBER>
npm install
npx --yes serve .
```
Loading
Loading