Feature: Integrate SBN v2 encoding with base-85 codec and compound history support#28
Open
itadrous73 wants to merge 12 commits intomainfrom
Open
Feature: Integrate SBN v2 encoding with base-85 codec and compound history support#28itadrous73 wants to merge 12 commits intomainfrom
itadrous73 wants to merge 12 commits intomainfrom
Conversation
Updated version number to 2.3.1 and added SBN v2 script.
Updated the API documentation and improved the updateUrlWithSbn function to use encodeURIComponent for SBN strings.
Updated the API management script for the Star Battle application to version 1.2.1, including improvements to puzzle fetching, importing, and exporting functionalities.
Enhanced backward compatibility check for SBN v1 dimension codes.
Enhanced backward compatibility for v1 dimension codes in universalImportV2 function.
Joey-Bryant
approved these changes
Apr 20, 2026
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.
Integrates the SBN v2 encoder/decoder across the desktop and mobile applications,
replacing all v1 encoding call sites while maintaining full backward compatibility
with existing v1 puzzle strings and saved data. This is tracked by branch WASN01.
What changed
encodeToSbn()calls replaced withencodeToSbnV2()(9 call sites)universalImport()calls replaced withuniversalImportV2()(2 call sites)encodeURIComponent()added to desktop URL construction for base-85 URL safetysbn.jsadded to both desktop and mobile script loadingsbn.jsfor offline/PWA supportWhy
SBN v2 provides:
shared puzzle where placeStarAndAutoX modified 9 cells now undoes as a single
step instead of 9 individual steps
Backward compatibility
AA2e...) are auto-detected byuniversalImportV2()and delegated to the existinguniversalImport()44–99, i.e. 4×4 through 9×9 boards)are disambiguated from v2 via a length check: the main part (before
~) iscompared against the minimum v2 string length for that candidate dimension.
Since v2 dim-44+ requires 594+ chars and a v1 4×4 string is at most ~14 chars,
the gap is unambiguous
10B...) are decoded nativelykept intact — nothing was removed
decodeSbn()calls for puzzle file loading are untouched (different contract)