fix(core): auto-detect manifest decryption in PreprocessBuildCatalog#625
fix(core): auto-detect manifest decryption in PreprocessBuildCatalog#625JasonXuDeveloper wants to merge 10 commits intomasterfrom
Conversation
Add a serializable BootstrapText struct that externalizes all ~30 user-facing strings from Bootstrap, enabling per-project localization and branding without modifying framework code. Closes #622 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: JasonXuDeveloper - 傑 <jason@xgamedev.net>
- Add BootstrapText.SafeFormat helper with try/catch fallback for malformed user-edited format strings - Replace all string.Format calls with SafeFormat in Bootstrap.cs - Use nameof(BootstrapText.*) instead of string literals in editor UI - Use BindProperty for JTextField binding (proper undo/prefab support) - Add tests for SafeFormat, Default field validation, exact field count, sub-headers, and reset logic Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: JasonXuDeveloper - 傑 <jason@xgamedev.net>
- Add JTabView tabbed container component with configurable maxTabsPerRow - Refactor BootstrapEditorUI Text Settings into 6 categorized tabs (3x2 grid) - Add 46 new tests across 8 components using reflection for private methods (JButton, JCard, JObjectField, JTextField, JDropdown, JStack, JTabView, BootstrapEditorUI) - Update GitHub instructions to require 93%+ coverage for non-core packages with support for both EditMode and non-interactive PlayMode tests Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: JasonXuDeveloper - 傑 <jason@xgamedev.net>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: JasonXuDeveloper - 傑 <jason@xgamedev.net>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: JasonXuDeveloper - 傑 <jason@xgamedev.net>
- Add null guard to BootstrapText.SafeFormat for null templates - Make JTabView._maxTabsPerRow readonly - Use evt.currentTarget instead of evt.target in JTabView handlers - Add SafeFormat null template test Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: JasonXuDeveloper - 傑 <jason@xgamedev.net>
The currentTarget setter is internal in UIElements. Use reflection with a null check so tests gracefully skip if the API changes. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: JasonXuDeveloper - 傑 <jason@xgamedev.net>
Replace the hardcoded null IManifestRestoreServices parameter with a try-all approach that attempts each registered decryption method from EncryptionMapping until one succeeds. This fixes a NRE when building with encrypted manifests (YooAsset#730). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: JasonXuDeveloper - 傑 <jason@xgamedev.net>
Add .claude/rules/yooasset-extensions.md to track custom modifications to YooAsset Extension Samples, ensuring the PreprocessBuildCatalog decryption fix is preserved across YooAsset updates. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: JasonXuDeveloper - 傑 <jason@xgamedev.net>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: JasonXuDeveloper - 傑 <jason@xgamedev.net>
There was a problem hiding this comment.
Pull request overview
This PR updates JEngine’s bootstrap and build pipeline to better support encrypted YooAsset manifests and improves the Bootstrap inspector UX by introducing configurable, serialized user-facing text (including safer formatting for editable templates).
Changes:
- Add
BootstrapText(default strings +SafeFormat) and switchBootstrapruntime dialogs/status strings to use it. - Add “Text Settings” UI to the enhanced Bootstrap inspector (UI package) and the default core Bootstrap editor, including reset-to-defaults behavior.
- Introduce
JTabView(editor UI component) with extensive EditMode test coverage; update generated build outputs / streaming assets.
Reviewed changes
Copilot reviewed 52 out of 84 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| UnityProject/Packages/com.jasonxudeveloper.jengine.core/Runtime/Bootstrap.cs | Adds serialized BootstrapText and uses it for status + dialog strings. |
| UnityProject/Packages/com.jasonxudeveloper.jengine.core/Runtime/BootstrapText.cs | New struct containing all Bootstrap user-facing strings + safe formatting helper. |
| UnityProject/Packages/com.jasonxudeveloper.jengine.core/Editor/CustomEditor/BootstrapEditor.cs | Adds “Text Settings” group and reset-to-defaults button in default inspector. |
| UnityProject/Packages/com.jasonxudeveloper.jengine.ui/Editor/Internal/BootstrapEditorUI.cs | Adds “Text Settings” section using a tabbed UI and reset-to-defaults logic in enhanced inspector. |
| UnityProject/Packages/com.jasonxudeveloper.jengine.ui/Editor/Components/Navigation/JTabView.cs | New tab view control used by the enhanced inspector. |
| UnityProject/Packages/com.jasonxudeveloper.jengine.ui/Tests/Editor/Internal/BootstrapEditorUITests.cs | Adds tests covering the new Text Settings inspector section and callbacks. |
| UnityProject/Packages/com.jasonxudeveloper.jengine.ui/Tests/Editor/Components/Navigation/JTabViewTests.cs | New comprehensive EditMode tests for JTabView. |
| UnityProject/Packages/com.jasonxudeveloper.jengine.ui/Tests/Editor/Components/Navigation/JTabViewTests.cs.meta | Unity meta for the new test file. |
| UnityProject/Packages/com.jasonxudeveloper.jengine.ui/Tests/Editor/Components/Layout/JStackTests.cs | Adds reflection-based tests for internal child-gap logic. |
| UnityProject/Packages/com.jasonxudeveloper.jengine.ui/Tests/Editor/Components/Layout/JCardTests.cs | Adds reflection-based hover handler tests. |
| UnityProject/Packages/com.jasonxudeveloper.jengine.ui/Tests/Editor/Components/Form/JTextFieldTests.cs | Adds reflection-based tests for internal styling method stability. |
| UnityProject/Packages/com.jasonxudeveloper.jengine.ui/Tests/Editor/Components/Form/JObjectFieldTests.cs | Adds reflection-based tests for internal styling/cursor logic. |
| UnityProject/Packages/com.jasonxudeveloper.jengine.ui/Tests/Editor/Components/Form/JDropdownTests.cs | Adds reflection-based tests for internal styling + pointer handlers. |
| UnityProject/Packages/com.jasonxudeveloper.jengine.ui/Tests/Editor/Components/Button/JButtonTests.cs | Adds reflection-based tests for internal mouse/focus/click handlers. |
| CLAUDE.md | Adds reference to a new Claude rule file. |
| .claude/rules/yooasset-extensions.md | Documents how to preserve YooAsset extension customizations across vendor updates. |
| .github/instructions/jengine.instructions.md | Documents unit testing scope/coverage expectations. |
| .github/instructions/code-review.instructions.md | Adds unit test coverage requirements to review checklist. |
| UnityProject/Assets/Obfuz/SymbolObfus/symbol-mapping.xml | Updates obfuscation symbol mapping output. |
| UnityProject/Assets/HotUpdate/Compiled/AOT/Assembly-CSharp.dll.bytes | Updates compiled build output (generated). |
| UnityProject/Assets/StreamingAssets/yoo/main/* | Updates YooAsset streaming assets/catalog/version/bundles (generated build output). |
| [Header("Text Settings")] | ||
| [SerializeField] private BootstrapText text = BootstrapText.Default; | ||
|
|
There was a problem hiding this comment.
PR description/title focuses on manifest decryption in PreprocessBuildCatalog, but this PR also introduces a new serialized BootstrapText system and updates runtime dialog/status strings to use it. Please update the PR description/scope (or split into separate PRs) so reviewers can evaluate these user-facing behavior changes explicitly.
| if (_maxTabsPerRow > 0) | ||
| { | ||
| // Reduce basis to account for per-tab margins; flexGrow fills remaining space | ||
| var percent = (100f - (_maxTabsPerRow * 2f)) / _maxTabsPerRow; | ||
| tabButton.style.flexBasis = new StyleLength(new Length(percent, LengthUnit.Percent)); | ||
| tabButton.style.flexGrow = 1; | ||
| tabButton.style.flexShrink = 1; | ||
| } |
There was a problem hiding this comment.
JTabView computes flex-basis percent using a hardcoded 2f per tab to “account for margins”, but the actual tab margins are pixel-based (Tokens.Spacing.Xs). This makes sizing unpredictable across different container widths/themes. Consider either removing the subtraction, making it a named constant with a clear rationale, or computing layout purely via flex + minWidth instead of mixing pixel margins with percent basis.
| private static void OnTabClicked(MouseDownEvent evt) | ||
| { | ||
| if (evt.currentTarget is Label tab && tab.userData is int index) | ||
| { | ||
| // Walk up to find the JTabView parent | ||
| var parent = tab.parent?.parent; | ||
| if (parent is JTabView tabView) | ||
| { | ||
| tabView.SelectTab(index); | ||
| } | ||
| } |
There was a problem hiding this comment.
OnTabClicked locates the owning JTabView via tab.parent?.parent, which is fragile (any hierarchy change inside the control will break tab selection). Prefer a more robust lookup (e.g., GetFirstAncestorOfType<JTabView>()) or store the owning JTabView in the callback/userData when registering the handler.
Summary
PreprocessBuildCatalogwhen building with encrypted manifests by replacing the hardcodednullIManifestRestoreServiceswith a try-all approach that tests each registered decryption method fromEncryptionMapping(YooAsset#730).claude/rules/yooasset-extensions.mdto track custom modifications to YooAsset Extension Samples, ensuring fixes are preserved across YooAsset updatesTest plan
nullpath succeeds immediately🤖 Generated with Claude Code