feat(webui): history routing
createWebHistory with base "/". The Go server already falls back to index.html for any unmatched path and [web] has no path-prefix option, so the dashboard is always at the root. legacy-hash-redirect.ts rewrites `#/path` links minted before this change. Verified against archie-ui rather than the Vite dev server: /tasks, /tasks/42 and /settings all serve index.html with assets resolving, and #/settings lands on /settings.
This commit is contained in:
1 parent
83c939b3df
commit
8c83449cf4
11 files changed
+28
-41
No files matched your search
@@ -89,7 +89,7 @@ was not told about.
|
||||
### Web UI (chat-render.js, chat-tools.js)
|
||||
|
||||
A dashboard_navigate tool call renders as a **clickable chip**: an anchor with
|
||||
href="#/tasks" and the label. Because the app routes on location.hash, the chip is a
|
||||
href="/tasks" and the label. The chip is a
|
||||
real link that works from any page once the chat is a global presence. The chip is
|
||||
styled as an action, not a code line, so it visibly invites a click.
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ that has since moved on.
|
||||
| R5 | Log pane filters by attempt, stage and level; absence stays distinct from an unreadable deployment | `logging.Query.Stage` + `ReadTaskLogRequest.stage = 9`; the pane keeps `disabled` and `found=false` apart |
|
||||
| R6 | Retry is reachable from the run view and produces a new attempt shown as a new run | Existing retry action, labelled as a NEW run whose confirm states the previous attempt's commits are discarded |
|
||||
| R7 | Raw JSON of the task record and its events for the selected attempt | `GET /api/tasks/{id}/debug` |
|
||||
| R8 | Deep-linkable, reload-safe per-task detail page that keeps existing URLs working | `#/tasks/{id}` route beside the existing `#/tasks?task=N` and `#/tasks?status=...` |
|
||||
| R8 | Deep-linkable, reload-safe per-task detail page that keeps existing URLs working | `/tasks/{id}` route beside the existing `/tasks?task=N` and `/tasks?status=...` |
|
||||
| R9 | Design polish: hierarchy, tokens, both themes, responsive rail, a11y, loading/empty/error states | UI lane; measured at 480px and 700px in both themes |
|
||||
| R10 | Documentation of record | This document plus `docs/architecture/observability.md` |
|
||||
| R11 | Red-first tests for every new behaviour, full gate, `task ui`, forced `go build ./...`, `go test -race` on touched packages | Per lane; the anti-cost-cutting requirement lives here |
|
||||
@@ -228,8 +228,8 @@ rendering rule, not a caveat in a comment:
|
||||
|
||||
## Route and compatibility
|
||||
|
||||
`#/tasks/{id}` is the detail route; it is deep-linkable and reload-safe.
|
||||
`#/tasks?task=N` and `#/tasks?status=...` keep working and keep their existing
|
||||
`/tasks/{id}` is the detail route; it is deep-linkable and reload-safe.
|
||||
`/tasks?task=N` and `/tasks?status=...` keep working and keep their existing
|
||||
behaviour, including the nav highlight. The debug view is why the raw view
|
||||
exists at all: the task list response is capped, so a client-side join has no
|
||||
row for an older task, and a debug view that silently hid events would be worse
|
||||
@@ -282,7 +282,7 @@ than useless.
|
||||
stating the previous attempt's commits are discarded.
|
||||
7. The log stage filter narrows to stage-bound lines and the pane states the
|
||||
coverage limit; `disabled` and `found=false` remain distinguishable.
|
||||
8. `#/tasks/{id}` survives reload, and `#/tasks?task=N` / `#/tasks?status=...`
|
||||
8. `/tasks/{id}` survives reload, and `/tasks?task=N` / `/tasks?status=...`
|
||||
are unchanged.
|
||||
9. The debug view returns the task record and its unfiltered events, each
|
||||
carrying `attempt`.
|
||||
|
||||
@@ -19,8 +19,8 @@ These are not features; they are things other processes depend on. Breaking one
|
||||
does not show up as a broken page.
|
||||
|
||||
- [ ] **Embed contract.** `ui/embed.go` embeds a committed `ui/dist`. The build
|
||||
must keep `base: "./"` and unhashed `assets/index.{js,css}`. Already set
|
||||
in `vite.config.ts`; do not let a later Vite change reintroduce hashing.
|
||||
must keep unhashed `assets/index.{js,css}`: dist/ lives in git, and
|
||||
hashed names orphan a file on every rebuild.
|
||||
- [ ] **Route registry.** `internal/gateway/dashboard_tools.go` hand-copies the
|
||||
route table and `TestDashboardPagesRegistryCoversEveryRoute` parses
|
||||
`ui/src/router/index.ts` to hold them in step. The parser needs
|
||||
@@ -33,8 +33,9 @@ does not show up as a broken page.
|
||||
(`internal/webui/api_tasks.go:376`, `authorizeTaskMutation`). GET sends
|
||||
neither. This is the single most likely thing to silently break every
|
||||
write after the port.
|
||||
- [ ] **Hash routing.** Every existing bookmark, dashboard link and
|
||||
agent-issued navigation is `#/tasks`. `createWebHashHistory`, already set.
|
||||
- [x] **History routing.** `createWebHistory`, `base: "/"`. Legacy `#/path`
|
||||
links are rewritten by `src/legacy-hash-redirect.ts`. The chat navigate
|
||||
chip should emit `/tasks`; the Go side already stores bare paths.
|
||||
- [ ] **Capability gating.** `GET /api/capabilities`
|
||||
(`internal/webui/api_capabilities.go:20`) returns a `sections` map of ten
|
||||
booleans: chat, logs, skills, curators, channels, captures, mappings,
|
||||
|
||||
Reference in new issue
Block a user