Skip to content

refactor: rename /scopes route to /work-items + CI workflow tidy - #42

Merged
tsaqib merged 2 commits into
mainfrom
frontend-work-items-routes
May 29, 2026
Merged

tsaqib merged 2 commits into
mainfrom
frontend-work-items-routes

Conversation

@tsaqib

@tsaqib tsaqib commented May 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #40 that finishes the rename on the web side. The user-visible URLs, nav rail labels, page identifiers, and the HTTP API the page TS consumes all migrate to the work item noun together so the naming axis is one consistent term everywhere. The flag icon and its tinting convention (lifecycle + hasOpenTasks) are unchanged.

A small drive-by also renames the two top-level CI workflows under a shared E2E test prefix so they group visually in the Actions sidebar.

What changed

Frontend pages and routing

  • Page files: scopes.html → work-items.html, scope.html → work-item.html; scopes.ts → work-items.ts, scope.ts → work-item.ts. Layout block-helper args (title / page / active) updated to match.
  • Nav rail (header.html + mobile-nav.html): label Scopes → Work items; href /scopes → /work-items; data-active-key follows. Flag icon kept.
  • Detail-page back link, list-page empty state, home-page card + Latest section, /search results section, and all DOM ids that embedded "scope" (#scope-icon, #scope-title, #scope-body, #scopes-list, #latest-scopes, tpl-scope, tpl-scope-link) renamed to the work-item equivalents.
  • Page dispatcher in bundle.ts uses bracketed keys for the kebab-cased page names; vite.config.ts pages array follows.
  • Internal hrefs /scope?id=… → /work-item?id=… across home.ts, search.ts, system.ts.
  • CSS: .scope-body → .work-item-body.

HTTP API and Go server

  • /api/scopes → /api/work-items, /api/scope → /api/work-item; apiScopesPath / apiScopePath constants renamed.
  • Handlers: handleAPIScopes → handleAPIWorkItems, handleAPIScope → handleAPIWorkItem; readScopesForAPI → readWorkItemsForAPI.
  • Struct renames with collision resolution: scopeListItem → workItemListItem, scopesListResponse → workItemsListResponse, scopeRelation → workItemRelation, scopeDetail → workItemDetail. The previous workItemDetail (per-system-row inner type used by /api/systems?id=) renames to systemWorkItem to free the better name for the detail response.
  • JSON wire keys: "scopes" → "workItems" on statsResponse, workItemsListResponse, searchResponse, and systemEntry. Frontend TS types follow.

Tests and docs

  • server_test.go: clean-URL fallback now expects /work-items and /work-item; every fixture/assertion updated to body.WorkItems and "workItems": wire shape.
  • scripts/e2e_test.sh + e2e_test.ps1: curl + assert_contains paths and JSON-key substring assertions updated.
  • AGENTS.md: frontend hard rules now reference /work-item URL, #work-item-body, active="work-items", and {workItems: [...]}.
  • frontend/package-lock.json: restored from origin/main (which has the @emnapi/* peer-dep fix from PR refactor: rename stax plans to stax work-items #40) — my local npm install --include=optional re-pruned them on this platform, same pattern PR refactor: rename stax plans to stax work-items #40 hit.

CI workflow rename (drive-by)

  • .github/workflows/windows-cli.yml → test-windows.yml; name: strings updated to E2E test (Linux) and E2E test / windows (Windows). Both files keep their existing triggers and steps verbatim — only the names move.

Commits

  1. refactor(frontend): rename /scopes route to /work-items — the bulk of the change above.
  2. fix(frontend): include @emnapi/* in lock for cross-platform npm ci (lock-file restore) — folded into commit 1 via amend; surfaces as a single squashed commit on merge.
  3. chore(ci): rename test workflows to E2E test naming — the workflow drive-by.

Test plan

  • go vet ./... clean
  • go test ./... clean
  • npm run check clean (typecheck + Biome + Knip)
  • npm run build clean
  • scripts/e2e_test.sh 624/624 cases pass locally
  • CI: govulncheck / Analyze (go) / build / test / smoke / CodeQL / DCO all green
  • Manual smoke: visit /, click nav rail → lands on /work-items; open a work item → URL is /work-item?id=…; flag icon still tints (deprecated / superseded / open-tasks); back-link returns to list; /search still groups results under "Work items" + "Systems"

Aligns the web UI with the renamed artifact noun (PR #40 moved the
CLI from `stax plans` to `stax work-items`). The user-visible URLs,
nav rail labels, page identifiers, and the HTTP API the page TS
consumes all migrate together so the naming axis is one consistent
"work item" everywhere.

Frontend:
- Page files: scopes.html → work-items.html, scope.html → work-item.html;
  scopes.ts → work-items.ts, scope.ts → work-item.ts. Layout block-helper
  args (title/page/active) updated to match.
- Nav rail (header.html + mobile-nav.html): "Scopes" → "Work items";
  href /scopes → /work-items; data-active-key follows. Flag icon kept.
- Detail page back-link, list-page empty-state, home-page card +
  Latest section, /search results section, and all DOM ids that
  embedded "scope" (`#scope-icon`, `#scope-title`, `#scope-body`,
  `#scopes-list`, `#latest-scopes`, `tpl-scope`, `tpl-scope-link`)
  renamed to the work-item equivalents.
- Page dispatcher in bundle.ts uses bracketed keys for the
  kebab-cased page names; vite.config.ts pages array follows.
- Internal hrefs `/scope?id=…` → `/work-item?id=…` across home.ts,
  search.ts, system.ts.
- CSS: `.scope-body` → `.work-item-body`.

HTTP API + Go server:
- /api/scopes → /api/work-items, /api/scope → /api/work-item;
  apiScopesPath/apiScopePath constants renamed.
- Handler renames: handleAPIScopes → handleAPIWorkItems,
  handleAPIScope → handleAPIWorkItem; readScopesForAPI →
  readWorkItemsForAPI.
- Struct renames (with collision resolution): scopeListItem →
  workItemListItem, scopesListResponse → workItemsListResponse,
  scopeRelation → workItemRelation, scopeDetail → workItemDetail.
  The previous `workItemDetail` (per-system-row inner type used by
  /api/systems?id=) renames to `systemWorkItem` to free the better
  name for the detail response.
- JSON wire keys: `"scopes"` → `"workItems"` on statsResponse,
  workItemsListResponse, searchResponse, and systemEntry. Frontend
  TS types follow.

Tests / docs:
- server_test.go: clean-URL fallback expects /work-items and
  /work-item; every fixture/assertion updated to body.WorkItems
  and `"workItems":` wire shape.
- scripts/e2e_test.sh + e2e_test.ps1: curl + assert_contains paths
  and JSON-key substring assertions updated.
- AGENTS.md: frontend hard rules now reference /work-item URL,
  #work-item-body, active="work-items", and {workItems: [...]}.
- frontend/package-lock.json: regenerated with `npm install
  --include=optional` (same pre-existing @emnapi gap PR #40 hit).

Verified locally: go vet + go test clean, npm run check clean,
scripts/e2e_test.sh 624/624 cases pass.

Signed-off-by: Tanzim Saqib <[email protected]>
@tsaqib
tsaqib force-pushed the frontend-work-items-routes branch from fdf31ed to cf8d315 Compare May 29, 2026 03:48
User-driven rename of the test workflow names — the two top-level
workflows (Linux and Windows) now share an E2E test prefix for
visual grouping in the GitHub Actions sidebar.

Signed-off-by: Tanzim Saqib <[email protected]>
@tsaqib tsaqib changed the title refactor(frontend): rename /scopes route to /work-items refactor: rename /scopes route to /work-items + CI workflow tidy May 29, 2026
@tsaqib
tsaqib merged commit 85deef2 into main May 29, 2026
6 checks passed
@tsaqib
tsaqib deleted the frontend-work-items-routes branch May 29, 2026 04:08
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