Register the recent-entries widget in window.openStationWidgets - #60
Merged
AllTerrainDeveloper merged 1 commit intoSep 26, 2026
Merged
AllTerrainDeveloper merged 1 commit into
AllTerrainDeveloper merged 1 commit into
Conversation
…Widgets OpenStation looks up mount callbacks by id in window.openStationWidgets (window.desktopModeWidgets on older Desktop Mode builds). The widget only exported render on window.allTerrainFormsWidget, so the shell never found it and logged a mount failure on every desktop load. Fixes AllTerrainDeveloper#59
AllTerrainDeveloper
approved these changes
Sep 26, 2026
AllTerrainDeveloper
left a comment
Owner
There was a problem hiding this comment.
Thanks, Juan. I checked this against OpenStation’s widget loader: it reads openStationWidgets by widget ID, and this registers the existing mount callback while preserving the other widgets and the standalone export. The CI checks are green. Nice fix.
AllTerrainDeveloper
merged commit Sep 26, 2026
f87c619
into
AllTerrainDeveloper:main
3 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #59.
OpenStation looks up widget mount callbacks by id in
window.openStationWidgets(window.desktopModeWidgetson older Desktop Mode builds).src/widget.tsonly exportedrender, which the IIFE build places atwindow.allTerrainFormsWidget.render, so the shell never foundallterrain-forms/recentand logged a mount failure on every desktop load.Change
src/widget.tsregisters the existingrenderWidgetunderallterrain-forms/recent. It merges into whichever registry already exists and never replaces it, since other plugins' widgets live in the same object.renderexport stays, somountStandaloneand anything reading the IIFE global keep working. The registry is a different global from the one the IIFE's final assignment overwrites, so the hand-assignment issue described in the existing comment doesn't apply. That comment is updated to say so.assets/js/widget.jsandwidget.min.jsare rebuilt withnpm run build:widget.Verified
npm run typecheck: clean.npm test: 469 passed, 2 skipped.widget.min.jsagainst a stubwindowthat already held another plugin's widget. AfterwardopenStationWidgetsheld both keys (other/w,allterrain-forms/recent), anddesktopModeWidgetspointed at the same object.Not tested in a live OpenStation desktop yet.