Skip to content

Warn on duplicate outlets at the same route level - #551

Merged
Mohamed Mansour (mohamedmansour) merged 4 commits into
mainfrom
copilot/bugfix-second-outlet-render-issue
Sep 20, 2026
Merged

Mohamed Mansour (mohamedmansour) merged 4 commits into
mainfrom
copilot/bugfix-second-outlet-render-issue

Conversation

Copilot AI commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

A routed template with multiple sibling <outlet /> directives currently renders only the first outlet; later outlets silently emit nothing. Rather than changing render semantics, this makes the single-outlet contract visible at build time.

  • Parser diagnostic

    • Added stable warning code multiple-outlets.
    • Emits a non-fatal warning when a parsed fragment contains more than one outlet at the same route level.
  • Build warning propagation

    • Preserves parser warnings through BuildResult::warnings.
    • Keeps existing theme-token warnings additive rather than replacing parser warnings.
  • Docs and contract

    • Documents that one outlet is supported per route level.
    • Points authors toward moving duplicated layout into the matched child route component.

Example warning case:

<main><outlet /></main>
<aside><outlet /></aside>

This now produces a multiple-outlets build warning instead of failing silently at render time.

Co-authored-by: mohamedmansour <68524+mohamedmansour@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix second outlet rendering issue at the same route level Warn on duplicate outlets at the same route level Sep 19, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Parser coverage and scan-efficiency issues, along with documentation updates, remain unresolved.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Medium severity · 2 Low severity

Open (3)
What changed in this PR

Adds non-fatal multiple-outlets build warnings while preserving existing rendering behavior and documents the single-outlet route contract.

Changes:

  • Adds parser diagnostics and propagates them through BuildResult::warnings.
  • Updates routing, design, and AI documentation.
  • Adds warning-related tests and guidance.
File Summary
docs/​guide/​concepts/​routing.md Documents the one-outlet-per-route-level contract; package README synchronization remains needed.
docs/​guide/​concepts/​directives/​route.md Updates outlet limitation guidance.
docs/​ai.md Updates AI authoring guidance.
DESIGN.md Records the single-outlet contract.
crates/​webui/​src/​lib.rs Propagates parser warnings; public warning-field documentation needs updating.
crates/​webui-parser/​src/​lib.rs Detects duplicate outlets, but nested route-level outlets and repeated scans require correction.
crates/​webui-parser/​src/​diagnostic.rs Defines the stable multiple-outlets warning code.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread crates/webui-parser/src/lib.rs Outdated
Comment thread crates/webui/src/lib.rs
Comment thread docs/guide/concepts/routing.md
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Comment thread crates/webui-parser/src/lib.rs
mddinbox

This comment was marked as duplicate.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

@mddinbox mddinbox left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-reviewed the latest head e9d9d5d, including the component-closure outlet count propagation and the prior authored finding. The fix now counts reachable outlets across component, conditional, and loop edges while keeping route-child levels separate; the regression coverage matches the reported failure. All current PR checks pass, including Rust analysis, build, E2E, docs, lint, and tests.

@mohamedmansour
Mohamed Mansour (mohamedmansour) merged commit 8695a62 into main Sep 20, 2026
35 checks passed
@mohamedmansour
Mohamed Mansour (mohamedmansour) deleted the copilot/bugfix-second-outlet-render-issue branch September 20, 2026 23:04
Mohamed Mansour (mohamedmansour) added a commit that referenced this pull request Sep 27, 2026
## Release

Bumps WebUI to `0.0.30` across Rust, npm, Python, and .NET package
metadata and updates desktop crate version examples. Native desktop and
Press support is distributed as opt-in, version-matched platform
packages; the former standalone `webui-press` npm command is replaced by
`webui press` without a Node command wrapper. The six new desktop
platform packages include READMEs. The native IPC fixture shares the
workspace lockfile after #568.

Previous release tag: `v0.0.29`

## Changes since `v0.0.29`

Features:

- WebUI Press ships native npm artifacts for macOS, Windows, and Linux
and runs through the opt-in `webui press` command (Add native npm
distribution for WebUI Press #555 by @copilot-swe-agent, fix: distribute
native desktop and Press sidecars #570 by @mohamedmansour).
- A lean Rust desktop SDK adds system webviews, app scaffolding, and
typed application IPC (feat: add lean Rust desktop SDK with typed IPC
#367 by @mohamedmansour).
- Opt-in native desktop npm packages make `webui desktop` available
without adding desktop webview dependencies to the base installation
(fix: distribute native desktop and Press sidecars #570 by
@mohamedmansour).
- Windows desktop apps gain native App SDK caption controls (feat: add
native Windows App SDK caption controls #560 by @mohamedmansour).
- Desktop apps can be configured without package metadata (feat:
configure desktop apps without package metadata #569 by
@mohamedmansour).

Fixes:

- Duplicate outlets at one route level produce an actionable build
warning instead of silently dropping later outlets (Warn on duplicate
outlets at the same route level #551 by @copilot-swe-agent).
- Press builds keep temporary inputs and outputs on the same filesystem
volume (fix: keep Press builds on one filesystem volume #552 by
@mohamedmansour).
- Streaming terminal markup stays inside the HTML body (fix: keep
streaming terminal inside body #558 by @mohamedmansour).
- The WebUI reference loader selects the correct source or
installed-package reference for the target project (fix: select WebUI
reference by target project #559 by @mohamedmansour).
- The Contact Book desktop icon displays correctly and header
double-click behavior is restored (fix: show Contact Book desktop icon
and restore header double-click #562 by @mohamedmansour).
- Linux desktop IPC preserves navigation and shutdown reasons when
retiring native requests (fix: preserve Linux IPC retirement reasons
before cancellation #566 by @mohamedmansour).
- Reactive callbacks wait until components are ready (fix: defer
reactive callbacks until components are ready #564 by @mohamedmansour).
- Windows desktop state reads tolerate transient file-open contention
while retaining atomic state replacement (fix: handle Windows state
contention and synchronize IPC tests #571 by @mohamedmansour).

Docs:

- Routing, project-specific reference installation, and interactivity
guidance were updated (Warn on duplicate outlets at the same route level
#551 by @copilot-swe-agent, fix: select WebUI reference by target
project #559 by @mohamedmansour, fix: defer reactive callbacks until
components are ready #564 by @mohamedmansour).
- Press installation and desktop SDK, caption control, icon,
configuration, and opt-in native sidecar documentation were expanded
(Add native npm distribution for WebUI Press #555 by @copilot-swe-agent,
feat: add lean Rust desktop SDK with typed IPC #367 by @mohamedmansour,
feat: add native Windows App SDK caption controls #560 by
@mohamedmansour, fix: show Contact Book desktop icon and restore header
double-click #562 by @mohamedmansour, feat: configure desktop apps
without package metadata #569 by @mohamedmansour, fix: distribute native
desktop and Press sidecars #570 by @mohamedmansour).
- Architecture and subsystem references were clarified, with the todo
tutorial kept aligned (chore: keep DESIGN.md architectural and preserve
internal contracts #563 by @mohamedmansour).

Maintenance:

- The WebUI Press npm package moved into the shared `packages/`
workspace (chore: move webui-press npm package #556 by @mohamedmansour).
- Desktop acceptance and native IPC test orchestration moved to Rust
xtask and the workspace Cargo lockfile (chore: migrate desktop
acceptance tests to Rust xtask #568 by @mohamedmansour).
- Desktop IPC capacity assertions now wait for the admitted handshake
worker to release its permit (test(desktop): wait for handshake capacity
before checking retired work #572 by @mohamedmansour).
- GitHub Actions dependencies were updated (chore(deps): bump the
github-actions group with 2 updates #565 by Dependabot).

## Validation

- `cargo xtask desktop-acceptance` and the full `cargo xtask check`
passed on the merged 0.0.30 tree.
- `cargo xtask publish-stage --target aarch64-apple-darwin
--native-only` staged core, Press, and desktop binaries. Seven local
0.0.30 tarballs were packed and installed offline in a fresh npm
consumer; installed binaries matched the staged release artifacts by
SHA-256.
- Installed `webui build` and `inspect` succeeded; `webui serve`
returned HTTP 200. Installed `webui press build` rendered a one-page
full site after installing its expected `esbuild`, TypeScript, and
framework peers. Installed `webui desktop init`, `build`, `package`, and
`run` succeeded. Both `desktop run` and the packaged macOS `.app` loaded
an image and executed page JavaScript that sent the expected heading to
a local probe. Core and desktop builds also passed with Node absent from
`PATH`.
- `pnpm --dir docs build` passed after refreshing the staged workspace
CLI. `cargo xtask native-ipc --timeout 60` passed source and packaged
macOS native IPC, including two BFCache restores in each mode, plus the
no-IPC fixture.
- PR Checks run 36299856666 finished green: Build (Linux) passed
unchanged on a targeted rerun after an intermittent packaged
history-navigation assertion; Build (macOS) passed on a targeted rerun
after GitHub reported its first hosted runner lost communication; Build
(Windows) and all six native npm platform jobs passed. All 41 current PR
checks are green. The deterministic acceptance-fixture correction for
the Linux race is separately green in #573 but is not yet part of this
release branch. Local npm smoke covers macOS arm64, not the full release
matrix.

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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.

[Bug]: Second <outlet /> at the same route level silently renders nothing

4 participants