Skip to content

Fix documentation navigation and resumable link behavior - #128

Open
nakasyou wants to merge 14 commits into
mainfrom
fix/docs-navigation
Open

nakasyou wants to merge 14 commits into
mainfrom
fix/docs-navigation

Conversation

@nakasyou

@nakasyou nakasyou commented Sep 5, 2026 •

Copy link
Copy Markdown
Member

The documentation could change its URL without updating its body, retain stale table-of-contents entries, and stop updating interactive controls after navigation. The Playground also shipped an empty WebAssembly compiler.

Changes:

  • Restore client-created library renderers, scheduled updates, and mount-only startup callbacks.
  • Serialize startup navigation with resume restoration.
  • Preserve compiled useSignal state across reactivation while keeping internal list-row signals independent.
  • Track compiled expression effects, retain effects for replacement DOM, and refresh changed child bindings.
  • Preserve explicit watch dependency semantics and HMR state resets.
  • Handle fragment and query-only navigation correctly; preserve browser-native modified/external/download/targeted links.
  • Use native TOC anchors and replace the /docs redirect history entry.
  • Build and validate the Playground WASM artifact during website deployment.
  • Add permanent navigation, startup, shared-layout, atom/local-state, and motion regressions; retain existing tests.
  • Run Chromium E2E in CI and force test-server shutdown after a grace period.

Includes #126's startup/scroll commits with their original history.

Verification:

  • Bun 1.3.10 and Vite+ 0.1.4 installed; frozen dependency installation succeeded.
  • Framework: 612 tests passed. E2E runner unit tests: 7 passed.
  • vp fmt, vp lint (four pre-existing warnings), and all 20 typecheck tasks passed.
  • Latest Quality CI passed, including all 16 coverage tasks; website build/WASM validation and CodeQL passed.
  • Public preview on 1c5f77b: /docs redirects with a rendered Overview body; Overview -> Quick Start updates every TOC item, browser back restores both body and TOC, search -> Routing closes the dialog and renders Routing. Playground retains its editor after successful compilation and allows generated-file selection.
  • Prior production-output audit: 17 HTML pages and 565 internal links, no missing destinations/anchors.
  • Regression evidence includes failing unit assertions for missing mount callbacks, unscheduled library updates, replaced local signals, stale attributes, lost bindings after rerender, stale child props, and reused list rows; these now pass.
  • CI E2E on 1c5f77b executed all 57 tests: 56 passed and the existing Markdown/frontmatter HMR test passed on retry (reported as 1 flaky). The process then remained alive after tests; c7d8f85 adds bounded server shutdown. Final E2E job is running.

Limitations:

  • Local bun run test stops in the macOS SwiftUI example: swift ENOENT; macOS JavaScriptCore is required.
  • Local bun run test:e2e cannot launch Chromium because CDN downloads timed out. Browser E2E runs in GitHub Actions instead. No tests were disabled or assertions weakened.
  • Earlier test-only E2E runs stopped at prior failures due to the suite's serial mode; not every new E2E assertion has independent failing-before evidence.

Preview: https://pr-128-eclipsa.xiarenda61.workers.dev
Production is unchanged; this PR is not merged.

Copilot AI lite review requested due to automatic review settings September 5, 2026 06:17
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 5, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-05T06:20:35.997413Z 79d3a53 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

github-actions Bot commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

Website preview: https://pr-128-eclipsa.xiarenda61.workers.dev

Commit: eb2e6ec

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 79d3a5346d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

}
return Object.values(payload.components ?? {}).some((component) => !!component.external)
return Object.values(payload.components ?? {}).some(
(component) => !!component.external || (component.mountCount ?? 0) > 0,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Activate components that declare mount callbacks

Triggering the full runtime when mountCount is nonzero does not actually run these callbacks. The startup path in resume-full.ts restores only external components and components eligible for restoreResumedLocalSignalEffects; therefore an SSR component with onMount() but no signals or external renderer remains inactive and its mount callback is never scheduled. Add a restoration pass for components with a positive mount count.

AGENTS.md reference: packages/eclipsa/core/AGENTS.md:L13-L17

Useful? React with 👍 / 👎.

Comment on lines +9703 to +9708
const clientRenderer =
!container.symbols.has(activateSymbol) && !container.imports.has(activateSymbol)
? component.clientRenderer
: null
const module: RuntimeSymbolModule = clientRenderer
? { default: (_scope, props) => clientRenderer(props) }

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Allow client renderers through scheduled dirty flushes

This fallback is not reached for normal reactive updates: when a client-created library component without a symbol URL reads a signal, notifySignalWrite marks it dirty, but scheduleDirtyFlush refuses to run because canFlushDirtyComponents still requires every dirty component to have an import or symbol URL. The new test masks this by invoking flushDirtyComponents directly, while in the application the component remains dirty and its UI stays stale; the scheduling eligibility check must also accept clientRenderer.

Useful? React with 👍 / 👎.

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.

🟡 Changes recommended

The new “client renderer fallback” for missing symbol URLs may still be blocked by dirty-flush gating that requires imports/symbols entries, potentially preventing reactive rerenders for client-created library components.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR fixes several documentation-site navigation and runtime resume edge cases in Eclipsa, focusing on preserving native link behavior, correctly handling same-page fragment/query navigations, and ensuring resumable components can reactivate even when a compiler-generated symbol URL is unavailable (e.g., client-created library components like motion).

Changes:

  • Add mount-callback serialization tracking (mountCount) and a mountCursor to drive “needs full resume” decisions and avoid missing-onMount behavior during startup resume.
  • Fix router navigation for same-path hash/search changes (handle fragments without route-data fetch; rerender when only ?search changes; reset scroll appropriately).
  • Improve initial-resume click handling to preserve native browser behavior for modified/middle/external/download/target/prevented/malformed links, and switch docs TOC fragment links to native hash anchors; add regression tests (unit + e2e).
File summaries
File Description
packages/eclipsa/core/runtime/types.ts Adds mount/client-renderer tracking fields to runtime state and frame types for resume/reactivation support.
packages/eclipsa/core/runtime.ts Implements mount tracking, client-renderer fallback activation for missing symbol URLs, and improved fragment/query navigation + scroll behavior.
packages/eclipsa/core/runtime.test.ts Adds unit regressions for client-created component reactivation, fragment navigation without data fetch, and search-only rerendering.
packages/eclipsa/core/resume-loader.ts Adjusts first-interaction promotion logic to preserve native click behaviors and uses mount serialization to decide full resume.
packages/eclipsa/core/resume-loader.test.ts Adds tests for mount-serialized full-resume requirement and native click preservation cases.
e2e/test/example.dev.test.ts Adds e2e regressions for scroll reset on Link nav and onMount behavior on direct loads.
e2e/app/hash-nav/+page.tsx Extends hash-nav example page to cover deep-scroll → route navigation behavior.
docs/app/docs/+page.tsx Uses replace navigation for /docs redirect and provides a visible fallback link.
docs/app/docs/[...slug]/+layout.tsx Switches docs TOC “On this page” links to native hash anchors (no router interception).
Review details
  • Files reviewed: 10/10 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines 6072 to 6075
component.props = props
component.rawProps = rawProps ?? null
component.clientRenderer = mode === 'client' ? componentFn : null
component.projectionSlots = meta.projectionSlots ?? null
@codecov-commenter

codecov-commenter commented Sep 5, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 43.26241% with 80 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
packages/eclipsa/core/runtime.ts 37.09% 78 Missing ⚠️
packages/eclipsa/core/runtime/reactive.ts 88.23% 1 Missing and 1 partial ⚠️
Files with missing lines Coverage Δ
packages/eclipsa/core/runtime/reactive.ts 52.77% <88.23%> (-6.02%) ⬇️
packages/eclipsa/core/runtime.ts 21.39% <37.09%> (-0.26%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

3 participants