You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(unencoded): bundle custom-forms.json.gz asset and resolve custom-component subtractions - #1087
TL;DRCustom-forms asset bundling: bundles custom-forms.json.gz in demo/vite.config.js (ENGINE_OUTLINES), scripts/og-assets.mjs, and worker/render.js, and resolves custom-component subtractions (such as 雋隹 for X-00033) via custom.drawable('&X-…;') in Unencoded.svelte.
ELI5 On unencoded.html, components like X-00033 ({33} / &CDP-8DDF; / 雋隹) showed blank dashes across all six font faces and no positional cuts. Two causes combined: demo/vite.config.js did not include custom-forms.json.gz in ENGINE_OUTLINES, so cutForms never loaded at runtime, and Unencoded.svelte tried to compose 雋隹 raw (which fails with an approximate subtraction) instead of resolving &X-00033; through custom.drawable.
flowchart LR
A["Unencoded component X-00033"] --> B["Load bundled custom-forms.json.gz"]
B --> C["Render Sans and Serif cuts and positional hosts"]
A --> D["Resolve &X-00033; via custom.drawable"]
D --> E["Render Woodblock, Fangsong, Regular, Pen"]
Loading
Root cause
demo/vite.config.js omitted custom-forms.json.gz from ENGINE_OUTLINES (and scripts/og-assets.mjs / worker/render.js omitted it from OG assets), so engineOutlines['custom-forms.json.gz'] was undefined at runtime.
fallbackSequenceOf(row) in demo/Unencoded.svelte fell straight through to raw row.subtractions[0] (雋隹), which han-compose cannot subtract cleanly because 雋 has no encoded-only decomposition, instead of resolving &X-00033; via custom.drawable().
Screenshots
Light
Dark
Checked
bun run check (tsrs + svelte-check: 0 errors, 0 warnings)
bun run lint (oxlint: 0 errors)
bun run i18n (x18n check passed)
bun run build:demo (emits dist/assets/custom-forms.json.gz)
Visual verification in headless Chromium (2× light and dark screenshots on unencoded.html?q=X-00033)
Summary by CodeRabbit
Bug Fixes
Improved rendering for rows whose existing shown-form sequence cannot be used. A valid custom form for the row’s identifier can now be displayed, while the existing fallback remains available when the custom form is unsuitable.
Improvements
Added the custom-form data asset to the demo’s available rendering resources.
The change adds custom-forms.json.gz to the demo asset list, asset build, and worker asset matcher. The row identifier fallback now tries its custom drawable when the shown form cannot be used directly.
Changes: Custom Forms
Layer / File(s)
Summary
Custom forms asset delivery demo/vite.config.js, scripts/og-assets.mjs, worker/render.js
The demo asset list and worker matcher include custom-forms.json.gz. The asset build copies it into data and reports it in the copy log.
Custom drawable fallback demo/Unencoded.svelte
When the shown-form text cannot be used directly, fallbackSequenceOf tries the row identifier’s custom drawable. It accepts the result only if it differs from the identifier and parses without errors or remaining custom components. Otherwise, it continues to the existing subtraction fallback.
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title names the two changes in the PR: bundling the custom-forms.json.gz asset and resolving custom-component subtractions in Unencoded.svelte. The raw summary confirms both: the asset is added to…
Full details: Title check
Explanation
The title names the two changes in the PR: bundling the custom-forms.json.gz asset and resolving custom-component subtractions in Unencoded.svelte. The raw summary confirms both: the asset is added to ENGINE_OUTLINES, the og-assets copy list, and the loadFor matcher, and fallbackSequenceOf now resolves custom forms. The title is specific and matches the changeset. It is slightly long at 91 characters, but it is still clear.
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
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
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.
TL;DR Custom-forms asset bundling: bundles
custom-forms.json.gzindemo/vite.config.js(ENGINE_OUTLINES),scripts/og-assets.mjs, andworker/render.js, and resolves custom-component subtractions (such as雋隹forX-00033) viacustom.drawable('&X-…;')inUnencoded.svelte.ELI5 On
unencoded.html, components likeX-00033({33}/&CDP-8DDF;/雋隹) showed blank dashes across all six font faces and no positional cuts. Two causes combined:demo/vite.config.jsdid not includecustom-forms.json.gzinENGINE_OUTLINES, socutFormsnever loaded at runtime, andUnencoded.sveltetried to compose雋隹raw (which fails with an approximate subtraction) instead of resolving&X-00033;throughcustom.drawable.Root cause
demo/vite.config.jsomittedcustom-forms.json.gzfromENGINE_OUTLINES(andscripts/og-assets.mjs/worker/render.jsomitted it from OG assets), soengineOutlines['custom-forms.json.gz']wasundefinedat runtime.fallbackSequenceOf(row)indemo/Unencoded.sveltefell straight through to rawrow.subtractions[0](雋隹), whichhan-composecannot subtract cleanly because雋has no encoded-only decomposition, instead of resolving&X-00033;viacustom.drawable().Screenshots
Checked
bun run check(tsrs+svelte-check: 0 errors, 0 warnings)bun run lint(oxlint: 0 errors)bun run i18n(x18n checkpassed)bun run build:demo(emitsdist/assets/custom-forms.json.gz)unencoded.html?q=X-00033)Summary by CodeRabbit