The title bar stops loading the whole builder - #58
Merged
AllTerrainDeveloper merged 1 commit intoSep 26, 2026
Merged
AllTerrainDeveloper merged 1 commit into
AllTerrainDeveloper merged 1 commit into
Conversation
…builder OpenStation runs title-bar provider scripts at every boot, so registering allterrain-forms-builder made each station load the 505 KB builder bundle even when no Forms window was opened. The preview eye now lives in src/titlebar.ts (assets/js/titlebar.min.js, 1,008 bytes), registered as allterrain-forms-titlebar. The builder no longer registers the button; it publishes a view onto its open form through providePreviewSource(), and the button previews the most recently loaded builder's form, as before. Fixes AllTerrainDeveloper#57. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AllTerrainDeveloper
approved these changes
Sep 26, 2026
AllTerrainDeveloper
left a comment
Owner
There was a problem hiding this comment.
Thanks, Juan. I verified this against OpenStation’s title-bar script loader and tested the PR merged with current main. The preview behavior and packaged bundle checks pass, and the provider now loads about 1 KB instead of the full builder at boot. Nice performance improvement.
AllTerrainDeveloper
merged commit Sep 26, 2026
0ad6011
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.
Summary
OpenStation runs every title-bar provider script at boot so buttons can paint on restored windows.
includes/openstation.phpregisteredallterrain-forms-builderas that provider, so every station load ran the full builder bundle (builder.min.js, 505 KB) even when no Forms window was ever opened.The preview eye now has its own entry:
src/titlebar.tscallsregisterPreviewButton()and nothing else. It imports onlysrc/preview-button.ts, which has no runtime imports.assets/js/titlebar.js/titlebar.min.jsby a newtitlebarVite target (npm run build:titlebar, included inbuild:bundles), registered inincludes/assets.phpasallterrain-forms-titlebar, and passed toregister_titlebar_button_scriptin place of the builder. Still gated on$has_builder.providePreviewSource()with the same view onto its open form (current,isDirty,save). The click previews the most recently loaded builder's form, saving first when dirty, which is what the single button registration did before. Before any builder has loaded, the click does nothing.id, label, icon, placement, order andmatchpredicate are unchanged.owneris nowallterrain-forms-titlebar.bin/package.mjsandbin/deploy.mjsrequiretitlebar.min.js.Size
builder.min.js(previous provider)titlebar.min.js(new provider)Both
assets/jsbundles were rebuilt withnpm run build:bundles, and a second run left the tree unchanged, so the CI "Committed bundles match source" check holds. Thebuilder.jsdiff is only the moved registration code.Tests
tests/vitest/titlebar.test.ts:register_titlebar_button_scripthandle inincludes/openstation.phpisallterrain-forms-titlebar;titlebar.min.jsis under 10 KB and carries no builder markup;allterrain-forms-preview-7once one does, and does nothing again after it is withdrawn.All three fail against
main(handle isallterrain-forms-builder, bundle missing,providePreviewSourcenot a function) and pass on this branch. Full suite: 472 passed, 2 skipped.tsc --noEmitclean, PHPCS clean on the changed PHP files.Fixes #57
🤖 Generated with Claude Code