Repository navigation
e-stepper: the layout survives a Run - #170
Conversation
…a new plugin Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
🦋 Changeset detectedLatest 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 |
|
@codex review |
There was a problem hiding this comment.
💡 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 = {}; |
There was a problem hiding this comment.
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 👍 / 👎.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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>
|
Good catch, the module-level variable lives inside the factory that 🤖 Generated with Claude Code |
#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.mjswraps 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 onglobalThis(Symbol.forkey), 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