fix(browser_ui): /rpc shortcut, base href, group by _ #12

Merged
salmaelsoly merged 1 commit from development_apidocs_fix into development 2026-04-26 13:12:33 +00:00
Member

Fixes #11.

Three template-only fixes in hero_browser_ui:

  • API Docs tab + navbar OpenRPC button — fetch/link from {{ base_path }}/openrpc.json (which lands on ui.sock, no such route, 404 with empty body) to {{ base_path }}/rpc/openrpc.json, using hero_router's /<svc>/ui/rpc[/...] sibling shortcut.
  • <base href="{{ base_path }}/"> in <head> — fixes the connection-status fetch("health") and fetch("rpc") calls that broke after hero_router 308-redirects /<svc>/ui//<svc>/ui (no trailing slash) and the document URL drops the last segment for relative-URL resolution. The page was issuing GET /hero_browser/health instead of /hero_browser/ui/health.
  • API Docs grouping — split method names on . or _ instead of only .. Methods without a dot (most of hero_browser: browser_*, page_*, element_*, …) no longer all bucket into one literal group called _server; they group as browser, page, element, js, viewport, network, console, cookies, dialog, accessibility, key, file, rpc.
crates/hero_browser_ui/templates/base.html  | 3 ++-
crates/hero_browser_ui/templates/index.html | 6 +++---
2 files changed, 5 insertions(+), 4 deletions(-)

No Rust changes, no new dependencies. Verified via curl through hero_router and by re-rendering the page from the running service after hero_proc service restart. Details and verification matrix in #11 (comment).

Fixes #11. Three template-only fixes in `hero_browser_ui`: - **API Docs tab + navbar OpenRPC button** — fetch/link from `{{ base_path }}/openrpc.json` (which lands on `ui.sock`, no such route, 404 with empty body) to `{{ base_path }}/rpc/openrpc.json`, using hero_router's `/<svc>/ui/rpc[/...]` sibling shortcut. - **`<base href="{{ base_path }}/">` in `<head>`** — fixes the connection-status `fetch("health")` and `fetch("rpc")` calls that broke after hero_router 308-redirects `/<svc>/ui/` → `/<svc>/ui` (no trailing slash) and the document URL drops the last segment for relative-URL resolution. The page was issuing `GET /hero_browser/health` instead of `/hero_browser/ui/health`. - **API Docs grouping** — split method names on `.` *or* `_` instead of only `.`. Methods without a dot (most of hero_browser: `browser_*`, `page_*`, `element_*`, …) no longer all bucket into one literal group called `_server`; they group as `browser`, `page`, `element`, `js`, `viewport`, `network`, `console`, `cookies`, `dialog`, `accessibility`, `key`, `file`, `rpc`. ``` crates/hero_browser_ui/templates/base.html | 3 ++- crates/hero_browser_ui/templates/index.html | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) ``` No Rust changes, no new dependencies. Verified via curl through hero_router and by re-rendering the page from the running service after `hero_proc service restart`. Details and verification matrix in https://forge.ourworld.tf/lhumina_code/hero_browser/issues/11#issuecomment-24256.
fix(browser_ui): use /rpc shortcut + base href + group by _
All checks were successful
Test / test (pull_request) Successful in 1m39s
Build and Test / build (pull_request) Successful in 4m8s
113046f2eb
salmaelsoly merged commit d57cd02a78 into development 2026-04-26 13:12:33 +00:00
salmaelsoly deleted branch development_apidocs_fix 2026-04-26 13:12:38 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_browser!12
No description provided.