Skip to content

fix(resource): exclude inline payloads from fallback searches - #269

Open
cangen185-sudo wants to merge 1 commit into
antvis:mainfrom
cangen185-sudo:codex/fix-inline-resource-fallback
Open

cangen185-sudo wants to merge 1 commit into
antvis:mainfrom
cangen185-sudo:codex/fix-inline-resource-fallback

Conversation

@cangen185-sudo

Copy link
Copy Markdown

Failed inline SVG/image resources currently use their raw payload as an icon-search query. getFallbackQuery() returns cfg.data before reaching its existing inline/data-URI/SVG exclusions, so an item label, description, or the default icon/illustration query is never selected for nonempty inline data.

Apply those exclusions before accepting the configured query. Preserve the current priority of searchable configuration text, including bare icon names such as plane; only fall back to the item context and scene default when the configured data is excluded or empty. Successful primary loading is unchanged.

Validation on main 5ae0d9394ac6280cb688eb4b4345881e291b9209:

  • Added 11 regression cases through loadResource; the original code fails 8 and passes 3, while the patch passes all 11.
  • Resource and SSR tests: 51 passed, including all existing SSR SVG snapshots without updates.
  • npm run build:esm, npm run check:test, and ESLint/Prettier on the two changed files passed.
  • A separate smoke check used the built ESM package, real resource parser/loaders and a mocked HTTP response, confirming the fallback query and installed SVG symbol without external network access.

This PR was prepared with AI assistance. Local validation used Windows and Node.js 24; the repository's macOS/Node.js 20 CI remains the remote validation boundary.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant