Skip to content

e-stepper: the layout survives a Run - #170

Merged
martin-henz merged 2 commits into
mainfrom
estepper-layout-module
Oct 11, 2026
Merged

martin-henz merged 2 commits into
mainfrom
estepper-layout-module

Conversation

@martin-henz

@martin-henz martin-henz commented Oct 11, 2026 •

Copy link
Copy Markdown
Member

#169 kept the layout in the host plugin, but the host terminates the conduit and creates a new plugin on every Run, and calls the bundle's factory again (wrap.mjs wraps the whole bundle in one), so Run still reset the panes to side by side and the divider to its default. The layout object is now kept on globalThis (Symbol.for key), which outlives both.

It is kept for the page only: a reload starts from the defaults. Not verified in the running frontend.

🤖 Generated with Claude Code

…a new plugin

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 00d6826

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@martin-henz

Copy link
Copy Markdown
Member Author

@codex review

@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: 3b620713ef

ℹ️ 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".

* The user's arrangement of the panes. Module-level, not per plugin: the host terminates the
* conduit and makes a new plugin on every Run, and the divider is to stay where the user put it.
*/
const layout: PaneLayout = {};

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 Keep the layout outside the generated plugin factory

When Run replaces the plugin, the host invokes the external module's default factory again. wrap.mjs embeds the entire Rollup CommonJS output inside that factory (export default require => { ...${cjs}... }), so this source-level “module” variable is actually initialized inside every factory call. Each replacement EStepperView therefore still receives a fresh {}, resetting the orientation and divider; persist the state in scope outside the generated factory or otherwise reuse it across factory calls.

Useful? React with 👍 / 👎.

@chatgpt-codex-connector

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-10-11T05:04:30.093661Z 3b62071 Manual request
ℹ️ 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.

…led again on every Run

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@martin-henz

Copy link
Copy Markdown
Member Author

Good catch, the module-level variable lives inside the factory that wrap.mjs generates, so it is new on every Run. The layout is now kept on globalThis under a Symbol.for key, which the factory calls share for the page. Description and changeset updated.

🤖 Generated with Claude Code

@martin-henz
martin-henz merged commit be71c8b into main Oct 11, 2026
2 checks passed
@martin-henz
martin-henz deleted the estepper-layout-module branch October 11, 2026 05:11
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.

1 participant