Repository navigation
fix(expand): treat Figma's unset swap id as no swap - #259
Conversation
Figma writes 4294967295:4294967295 in overriddenSymbolID to mean "not swapped" (seen in storytold/figcraft#2206's reporter file). Expansion of override rows already ignored it via guid_key, but three Json readers took it as a component id: REST componentId named a node that does not exist, search read no component properties for that instance, and an instance-swap assignment holding it swapped to a missing main, so the nested instance lost its children. rest::node_guid now owns the check that rest/semantics' definition_id already made, so the sentinel lives in one place.
|
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. 🚀 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9ba8dffada
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| .and_then(|s| s.get("guid")) | ||
| && let (Some(session), Some(local)) = | ||
| (guid["sessionID"].as_u64(), guid["localID"].as_u64()) | ||
| .and_then(crate::rest::node_guid) |
There was a problem hiding this comment.
Invalidate persisted indexes after changing swap expansion
For a workspace indexed before this fix, an unchanged .fig containing an unset instance-swap assignment will continue to have its default-main children missing from workspace search after upgrading. The generation compatibility key in src/search/store.rs::versions() is unchanged, and src/workspace/jobs.rs:2591–2609 returns unchanged before parsing when that key and the snapshot match, so even index refresh preserves the incorrect results while reporting a complete generation. Revise the persisted-generation compatibility key alongside this extraction change so existing indexes require rebuilding.
Useful? React with 👍 / 👎.
Summary
Figma writes the unset GUID
4294967295:4294967295inoverriddenSymbolIDto mean "not swapped" (storytold/figcraft#2206: a real file had it on a nested instance). Override rows already ignored it throughguid_key; three Json readers did not.rest::node_guidtakes over the checkrest/semantics::definition_idalready made (unset id, out-of-range parts);definition_idnow calls it, so the sentinel is written once.Evidence
Three new unit tests, one per reader. With
node_guidtemporarily reduced to plainguid(the old behaviour):rest::tests::an_unset_swap_guid_keeps_the_instance_on_its_main:componentIdwas"4294967295:4294967295", expected"1:2".expand::tests::an_unset_swap_property_keeps_the_default_main_and_its_children:Iinst;1:3;icon;leafwas missing (the nested instance had no children).search::semantic::input_tests::an_instance_with_an_unset_swap_guid_reads_its_mains_properties: properties were[].cargo test(841 lib tests plus the integration suites, all pass),cargo fmt --check,cargo clippy --all-targets -D warningsandpython3 scripts/ai-context.py check, all in Docker.Local evidence is limited. In 7 local sample files the unset id never appears in
nodes 0:0output, so the rule is recorded as Pending (external evidence only) inwiki/instances.md.Interfaces: CLI, MCP, Pi, OpenCode and OMP all read the same
nodesand search output. There is no new option or field, so help, READMEs, the skill and the site need no change.Not changed:
prop_value_source: RESTcomponentPropertiesvalues can still show the unset id for an instance-swap property, because Figma's REST output for that case is unknown.Merge Danger
Door: two-way
Blast Radius: narrow
Only instances whose swap field holds the unset id change: they now resolve to their default main instead of a missing id. Every other GUID is accepted exactly as before.