Skip to content

feat(ui): open plugin tabs at short slug URLs such as /reports - #143183

Merged
steipete merged 6 commits into
mainfrom
steipete/team-reports-url-f9f107
Sep 9, 2026
Merged

steipete merged 6 commits into
mainfrom
steipete/team-reports-url-f9f107

Conversation

@steipete

@steipete steipete commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Resolves a problem where opening a plugin-provided sidebar tab in the Control UI landed on an opaque address such as /plugin?plugin=team-reports&id=team-reports. The Team Reports tab on a team Gateway is the visible case: the sidebar entry could not be given a short, shareable path like /reports, because every plugin tab is hosted by the single generic /plugin page and carries its identity in the query string, and because the plugin's own HTTP report site already owned /reports ahead of the Control UI.

Why This Change Was Made

Plugin tab descriptors gain an optional slug. A tab that advertises slug: "reports" is mounted by the Control UI at <controlUiBasePath>/reports, the sidebar links there, pageHref/openPage emit it, and the generic /plugin?plugin=…&id=… form is replaced once in browser history while preserving p.* parameters and the fragment. The slug changes only the Control UI address: it registers no HTTP route and touches no authentication or frame-grant behavior. The Gateway validates the grammar and reserved Gateway-owned names at registration (first registration wins for duplicates) and drops a slug from the hello when any plugin HTTP route would shadow the mounted path; the Control UI additionally ignores slugs that collide with native routes, so a plugin can never claim a built-in page. A cold deep link to a slug path waits for the Gateway hello instead of bouncing to chat. Team Reports declares the slug and moves its HTML/Markdown/JSON site's default basePath to /plugins/team-reports, following the existing /plugins/<pluginId> convention. Static routes and plugin slug helpers share the existing path module, avoiding import cycles and keeping startup JavaScript within the existing size budget.

Non-goals: native placement: "route:<pluginId>" semantics, Workboard/Logbook, and syncing in-frame navigation into the outer URL are unchanged.

User Impact

  • Clicking Reports in the sidebar opens /reports (prefixed by any configured Control UI base path) inside the Control UI shell, and that address is bookmarkable and shareable.
  • Existing /plugin?plugin=team-reports&id=team-reports links keep working and are replaced with /reports.
  • Plugin authors can give any tab a short address with one descriptor field; the SDK and URL docs describe the grammar, reserved names, and fallback rules.
  • Release note: the Team Reports HTTP site default moves from /reports/… to /plugins/team-reports/… (index, latest/, day|week|month/<key>/, report.md, data.json, people/, index.json, status). Operators who pinned basePath: "/reports" keep that site but the sidebar then falls back to the generic tab URL, as documented.

Evidence

  • Landed after rebasing onto main at c0a318d7800b81bc3e258148816414dfab46ffad (including fix(models): avoid provider loading during cold session resets #143254); exact-head CI 34384740962, attempt 2 passed after the tooling watchdog shard rerun. Startup-size consolidation measured 352,203 B gzip against the unchanged 352,235 B cap.

  • node scripts/run-vitest.mjs run src/plugins/registry.control-ui.test.ts src/gateway/control-ui-plugin-tabs.test.ts src/gateway/control-ui-routing.test.ts extensions/team-reports/index.test.ts extensions/team-reports/src/config.test.ts ui/src/app-route-paths.test.ts ui/src/app-navigation.test.ts ui/src/pages/plugin/tab-slugs.test.ts ui/src/components/app-sidebar.test.ts ui/src/plugins/control-ui-host.test.ts ui/src/app/app-host.test.ts ui/src/app/app-host.deleted-session.test.ts — 12 files, 740 tests passed. New cases cover slug grammar/reserved/duplicate rejection, hello projection with HTTP-route shadowing, native-route collision fallback, sidebar hrefs, host pageHref, canonicalization, and the Team Reports default path.

  • Initial mocked-Gateway Playwright e2e ui/src/e2e/plugin-tab-slugs.e2e.test.ts (4 tests): sidebar entry href is /reports; clicking mounts openclaw-plugin-page for the tab with the sidebar still visible; a cold /reports load stays on /reports while the hello is held and mounts the tab once it arrives, never visiting /chat; an unknown slug recovers to chat only after the hello; a generic tab URL is replaced with /reports keeping ?p.range=week#details and the history length.

  • pnpm check:changed passed except the extensions lint declaration lane, which fails in this nested worktree for the documented environmental reason ("Declaration input escapes checkout"); CI is authoritative for that lane. pnpm check:madge-import-cycles and pnpm check:import-cycles report 0 cycles; pnpm check:assertion-safety OK; knip unused-exports clean.

  • Initial pnpm ui:check-performance: startup JS 347,563 B gzip / 8 requests against the 352,235 B / 18 request limits; no budget or baseline changed.

  • Independent Codex autoreview of the branch at P1: scoped-clean.

  • Rebased onto faef46e142f08159bf29dfe5b6bbbc81141614a4; preserved both commits and moved the slug documentation to docs/plugins/sdk-overview/host-hooks.md after the native-route placement paragraph. On rebased head 40e94cdf8b3bdfd4928d553310f4af836096d91c, the requested focused suite passed (11 files, 660 tests), all 4 plugin-tab browser E2E tests passed, both import-cycle guards found zero cycles, assertion safety and diff whitespace checks passed, and fresh P1 autoreview was scoped-clean. A fresh production UI build measured startup JavaScript at 348,141 B gzip / 8 requests (limits 352,235 B / 18), and startup CSS at 45,565 B gzip / 1 request. No performance budget changed.

  • Review fix 686996b623725e540b5fa4de3b84d53bd3f9c983 preserves an explicitly declared root mount for cold /reports/ links. The new bootstrap unit case and trailing-slash E2E case failed before the fix; afterward, all 5 plugin-tab E2E cases and 292 tests across 10 focused files passed, including Team Reports config/registration/HTTP behavior. Changed-file checks passed, fresh P2 autoreview was scoped-clean, and a fresh UI build measured 348,130 B startup JS gzip / 8 requests and 45,565 B startup CSS gzip / 1 request. Config tests verify omitted basePath uses the new default and pinned /reports remains; these are boundary checks, not an installed-release upgrade campaign.

CI follow-up 8f98254420b15d154b895d310516ef2810a84727 supplies the required Gateway object in the existing Workboard routing fixture. The CI failure reproduced locally (7 failures); after the fixture repair, all 64 Workboard/route-path tests passed, changed-file checks passed, and P2 autoreview was scoped-clean. Runtime code and test assertions are unchanged by this follow-up.

  • Final bootstrap correction f0da4038a7f0fa2ccfc9fdf06abc4dcaf55e6770 limits explicit-root preservation to cold single-segment plugin-slug candidates, retaining existing inferred route namespaces with root-mounted resources. The two new namespace unit cases failed before this correction; afterward all 193 tests across five files passed (including all 41 unchanged bootstrap tests), all five plugin-tab browser E2E tests passed, changed-file checks passed, both cycle guards reported zero cycles, and P2 autoreview was scoped-clean. Final startup JavaScript is 348,150 B gzip / 8 requests; startup CSS is 45,565 B / 1 request, within unchanged budgets.

  • Startup-budget repair consolidates the route catalog and slug helpers into ui/src/app-route-paths.ts, removing the two new leaf modules and reusing the existing path builder. All 628 focused tests across 11 files, all five plugin-tab browser E2E cases, and both zero-cycle guards passed. The official base-comparison check measures 352,203 B startup JavaScript gzip / 8 requests against the unchanged 352,235 B / 18-request limit. P2 autoreview found no actionable issues.

@clawsweeper

clawsweeper Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui gateway Gateway runtime plugin: team-reports size: XL maintainer Maintainer-authored PR labels Sep 9, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 9, 2026
@clawsweeper

clawsweeper Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 9, 2026, 1:50 PM ET / 17:50 UTC (Revision 6).

ClawSweeper review

What this changes

Adds short URLs for plugin tabs in the Control UI and moves Team Reports’ default HTTP site to /plugins/team-reports.

Merge readiness

⛔ Blocked before merge - 1 item remains

Keep open: current main does not provide the requested capability, and the prior bootstrap findings are addressed. No new blocking defect was found; the discussion explicitly accepts the documented compatibility tradeoff.

Priority: P2
Reviewed head: f3b2b11645e5cb6fc6f9c66f99e110ae95bbd1e3

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A coherent implementation with focused regression coverage and no blocking finding; the accepted URL transition remains visible as compatibility risk.
Proof confidence 🌊 off-meta tidepool Not applicable: The maintainer-authored PR is exempt from the external-contributor proof gate. Its reported browser tests exercise the real UI routing and plugin page against a mocked Gateway; they do not establish live authentication or installed-release upgrade behavior.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The maintainer-authored PR is exempt from the external-contributor proof gate. Its reported browser tests exercise the real UI routing and plugin page against a mocked Gateway; they do not establish live authentication or installed-release upgrade behavior.
Evidence reviewed 8 items Current main still uses generic plugin URLs: The fetched main revision reads plugin identity from query parameters and describes one static route for all plugin tabs; the descriptor has placement but no slug.
Slug routing preserves the existing page owner: The introduced helpers reject native-route collisions, resolve mounted single-segment slugs, retain generic fallback URLs, and canonicalize generic links while preserving p.* parameters and fragments.
HTTP and authorization boundaries remain separate: Gateway projection removes only a shadowed slug using the existing HTTP route matcher. Scope filtering, same-plugin frame-path ownership, and frame-grant authorization remain in their existing owners.
Findings None None.
Security None None.

How this fits together

The Gateway advertises available plugin tabs to the Control UI after connection. The browser maps their addresses to the existing plugin page, which loads content through the existing authenticated plugin route.

flowchart LR
  A[Plugin tab descriptor] --> B[Registration validation]
  B --> C[Gateway collision checks]
  C --> D[Connection handshake]
  D --> E[Browser route selection]
  F[Sidebar or bookmarked URL] --> E
  E --> G[Existing plugin page]
  G --> H[Authenticated report content]
Loading

Before merge

  • Resolve merge risk (P1) - Existing report/export clients using the old default /reports URLs can stop working after upgrade unless operators update URLs or explicitly pin basePath; this transition is accepted in the discussion, but no installed-release upgrade campaign is supplied.
Agent review details

Security

None.

PR surface

Source +264, Tests +537, Docs +31, Generated 0, Other -1. Total +831 across 40 files.

View PR surface stats
Area Files Added Removed Net
Source 18 309 45 +264
Tests 16 566 29 +537
Docs 4 103 72 +31
Config 0 0 0 0
Generated 1 2 2 0
Other 1 0 1 -1
Total 40 980 149 +831

Review metrics

Metric Value Why it matters
Public contract changes 1 optional descriptor field; 1 existing HTTP default changed The additive slug field preserves generic tabs, while the Team Reports default affects existing external links.
Implementation and coverage growth Production TypeScript net +264; tests and test support net +537 Production growth implements validation, handshake projection, and browser routing, with coverage for collisions and cold-link recovery.

Merge-risk options

Maintainer options:

  1. Retain the accepted URL transition (recommended)
    Keep the documented default-path change and explicit /reports pinning option, accepting that old default-path clients need updated URLs.

Technical review

Best possible solution:

Retain the approved separation between short Control UI addresses and authenticated report endpoints, with generic tab fallback and explicit path pinning documented for upgrades.

Do we have a high-confidence way to reproduce the issue?

Not applicable as a feature request: current main demonstrably uses generic query-based plugin addresses. The earlier cold-link defect has a source-backed repair and reported passing regression coverage.

Is this the best way to solve the issue?

Yes: the optional descriptor field extends the existing plugin page and routing machinery without adding a competing HTTP or authentication path; the default-path tradeoff is explicitly accepted.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against fc3bb9f5e3a9.

Labels

Label justifications:

  • P2: This is a bounded plugin-navigation improvement with an explicitly documented operator compatibility impact.
  • merge-risk: 🚨 compatibility: The released Team Reports HTTP default changes, so existing default-path report and export links require operator action.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The maintainer-authored PR is exempt from the external-contributor proof gate. Its reported browser tests exercise the real UI routing and plugin page against a mocked Gateway; they do not establish live authentication or installed-release upgrade behavior.

Evidence

What I checked:

  • Current main still uses generic plugin URLs: The fetched main revision reads plugin identity from query parameters and describes one static route for all plugin tabs; the descriptor has placement but no slug. (ui/src/pages/plugin/route.ts:12, fc3bb9f5e3a9)
  • Slug routing preserves the existing page owner: The introduced helpers reject native-route collisions, resolve mounted single-segment slugs, retain generic fallback URLs, and canonicalize generic links while preserving p.* parameters and fragments. (ui/src/app-route-paths.ts:115, f3b2b11645e5)
  • HTTP and authorization boundaries remain separate: Gateway projection removes only a shadowed slug using the existing HTTP route matcher. Scope filtering, same-plugin frame-path ownership, and frame-grant authorization remain in their existing owners. (src/gateway/control-ui-plugin-tabs.ts:142, f3b2b11645e5)
  • Prior bootstrap repair is present: The current bootstrap preserves an explicitly declared root for single-segment slug candidates while retaining inferred namespaces. The browser suite covers both /reports and /reports/, delayed hello, unknown-slug recovery, and history-preserving canonicalization. (ui/src/app/browser.ts:30, f3b2b11645e5)
  • Configuration compatibility coverage: The configuration test preserves explicitly pinned /reports, checks the new omitted-value default, and verifies manifest/parser parity. The supplied body reports five passing browser cases and 628 focused tests; these were inspected as reported validation, not rerun. (extensions/team-reports/src/config.test.ts:59, f3b2b11645e5)
  • Released default and accepted transition: The v2026.9.3 source defaults to /reports. The comment at feat(ui): open plugin tabs at short slug URLs such as /reports #143183 (comment) explicitly accepts changing old default-path report/export links without legacy redirects, preserves pinned paths, and distinguishes boundary tests from an installed-release upgrade campaign. (extensions/team-reports/src/config.ts:67, 1391f7cd2d40)

Likely related people:

  • Peter Steinberger: Raw commit d3101b5 adds extensions/team-reports/src/config.ts:62 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: d3101b5229b9; files: extensions/team-reports/src/config.ts)
  • Vincent Koc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (5 earlier review cycles)
  • reviewed 2026-09-09T14:45:21.969Z sha f19222b1cd7a92e60299503900ea62925c25110d :: blocked before merge. :: [P2] Preserve the root route base for cold trailing-slash slug links
  • reviewed 2026-09-09T15:04:43.464Z sha 40e94cd :: blocked before merge. :: [P2] Include the verified cold-link bootstrap fix in the PR head
  • reviewed 2026-09-09T15:14:40.564Z sha 8f98254 :: blocked before merge. :: none
  • reviewed 2026-09-09T15:27:31.240Z sha f0da403 :: blocked before merge. :: none
  • reviewed 2026-09-09T17:27:49.532Z sha 7979baf :: blocked before merge. :: none

@steipete
steipete force-pushed the steipete/team-reports-url-f9f107 branch from f19222b to 40e94cd Compare September 9, 2026 14:52
@steipete
steipete marked this pull request as ready for review September 9, 2026 14:52
@steipete

steipete commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor Author

Addressed the cold trailing-slash finding at the bootstrap owner: resolveControlUiPaths now preserves an explicitly declared empty root mount for cold single-segment plugin-slug candidates while retaining the existing inferred route namespaces that use root-mounted resources. The new unit case failed before the fix with ["/reports", ""] instead of ["", ""]; the added /reports/ browser case also failed before the fix. After the fix, all five plugin-tab E2E cases pass, along with 292 tests across ten files covering bootstrap, routes, shell recovery, Gateway tab projection, and Team Reports config/registration/HTTP behavior. Fresh P2 autoreview found no actionable issues.

The Team Reports HTTP default move is intentional and maintainer-approved. Configurations that omit basePath now use /plugins/team-reports; explicit /reports configurations retain that HTTP route and use the generic Control UI tab URL when the root-mounted slug is shadowed. This includes the deliberate change to old default-path HTTP/export links; no legacy redirect is claimed. The PR body and operator docs record this release impact. extensions/team-reports/src/config.test.ts proves both omitted and pinned-path parsing plus manifest parity; extensions/team-reports/src/http.test.ts exercises the explicitly pinned /reports handlers. These are configuration/HTTP boundary tests, not a live installed-release upgrade campaign.

The optional-field fallback is covered by Gateway projection, sidebar, and plugin-host tests: existing descriptors without a slug keep the generic URL, collisions remove only the advertised slug while retaining the tab/frame path, and native routes retain precedence. No auth or frame-grant policy changed.

The docs conflict is resolved by preserving main's overview and placing the slug paragraphs after native-route placement in docs/plugins/sdk-overview/host-hooks.md. Both original commits remain in the rebased branch.

CI follow-up 8f98254420b15d154b895d310516ef2810a84727 supplies the required Gateway object in the existing Workboard routing fixture. The CI failure reproduced locally (7 failures); after the fixture repair, all 64 Workboard/route-path tests passed, changed-file checks passed, and P2 autoreview was scoped-clean. Runtime code and test assertions are unchanged by this follow-up.

CI also exposed that the first bootstrap fix was too broad for existing inferred route namespaces. The correction preserves /__openclaw__/new and /portable/new with root-mounted resources while keeping cold /reports/ working. All 193 tests across five files passed, including all 41 bootstrap tests with existing assertions unchanged; all five plugin-tab browser E2E cases passed. Both import-cycle guards still report zero cycles. A fresh production build measures 348,150 B startup JavaScript gzip across eight requests, below the unchanged budget.

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 9, 2026
Validate optional tab slugs and project them into hello unless a plugin HTTP
route shadows the mounted URL. Resolve slugs through the existing plugin host,
wait for hello on cold links, and canonicalize generic links while preserving
page parameters and fragments. Native routes retain their ownership.

Team Reports now opens at /reports and defaults its HTTP site to
/plugins/team-reports. Explicit /reports HTTP configurations retain the generic
tab URL fallback. Document the SDK and URL contracts and regenerate the config
documentation fingerprint for the intended default change.
Break the app-route-paths <-> tab-slugs import cycle by extracting the
static route table into app-route-definitions.ts and importing it from
both sides. Drop the assertion baseline entry that moved with the table.
@steipete
steipete force-pushed the steipete/team-reports-url-f9f107 branch from f0da403 to 7979baf Compare September 9, 2026 17:21
@steipete
steipete merged commit 4733a1e into main Sep 9, 2026
321 of 324 checks passed
@steipete
steipete deleted the steipete/team-reports-url-f9f107 branch September 9, 2026 18:15
@steipete

steipete commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 10, 2026
…law#143183)

* feat(ui): mount plugin tabs on advertised route slugs

Validate optional tab slugs and project them into hello unless a plugin HTTP
route shadows the mounted URL. Resolve slugs through the existing plugin host,
wait for hello on cold links, and canonicalize generic links while preserving
page parameters and fragments. Native routes retain their ownership.

Team Reports now opens at /reports and defaults its HTTP site to
/plugins/team-reports. Explicit /reports HTTP configurations retain the generic
tab URL fallback. Document the SDK and URL contracts and regenerate the config
documentation fingerprint for the intended default change.

* refactor(ui): move route definitions to a leaf module

Break the app-route-paths <-> tab-slugs import cycle by extracting the
static route table into app-route-definitions.ts and importing it from
both sides. Drop the assertion baseline entry that moved with the table.

* fix(ui): preserve root mount for trailing-slash plugin links

* test(ui): supply gateway state to workboard route fixture

* fix(ui): retain inferred namespaces alongside plugin slug roots

* perf(ui): consolidate route paths and plugin slug helpers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui docs Improvements or additions to documentation gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. plugin: team-reports rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: L status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant