fix(explore): open the skill before closing the ☰ menu#125
Merged
Conversation
Clicking a skill in the ☰ registry did nothing on the live (HTTP) gateway — the menu closed but the skill page never opened, with an opaque release-mode `Uncaught Error` in the console. `_SkillsPanel._open` closed the overlay *before* awaiting `focusSkill`, which awaits a real `resolve` round-trip and then reads the overlay's `ref`. `close()` disposed that overlay first, so the post-await `ref.read` hit a defunct element and threw; navigation never ran. The fixture's microtask-fast `resolve` hid it locally; the gateway's network latency made it deterministic. Await `focusSkill` first, close last, so `ref` is still mounted when `navigateToInstance` runs. Adds a no-mock `skill_page_render_test` (the instance pane renders a skill page over the real corpus without throwing) and a discovered-note explaining why no widget test can catch the ordering regression — `flutter_test` keeps the container alive across the async gap, so the buggy order stays green; the real net is the rodney browser check. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Summary
Clicking a skill in the ☰ skills registry did nothing on the live (HTTP) gateway — the menu closed but the skill page never opened, with only an opaque release-mode
Uncaught Errorin the console. Every widget test passed, so the regression was invisible to the suite.Cause.
_SkillsPanel._openwasclose(); focusSkill(ref, skillId);.focusSkillisasync— it awaits a realresolveround-trip, thennavigateToInstance(ref, …). Butclose()tore down the OverlayPortal that ownsreffirst, so the post-awaitref.readhit a defunct element and threw; navigation never ran. The fixture's microtask-fastresolvemasked it locally; the gateway's network latency made it deterministic.Fix. Await
focusSkillbeforeclose(), so the overlay'srefis still mounted whennavigateToInstanceruns.Verified live via chrome-devtools against the seeded gateway on
:8080: with the clean release bundle the ☰ → skill click now opens and renders the skill manifest (frontmatter + body), minimizes the event pane, and shows the back button.Test plan
test/crm/skill_page_render_test.dart(new, no-mock):the instance pane renders a skill page without throwing— pumpsInstancePaneover the realexamples/crm-democorpus withcurrentPageIdset to a skill page.test/crm/skills_menu_test.dart: existingthe ☰ menu lists grouped skills and opens one on tapstays green.flutter analyzeclean; fullflutter testsuite green (93 tests).docs/notes/discovered/2026-05-30-overlay-ref-disposed-during-async-nav.mddocuments the bug and why no widget test catches it (flutter_testkeeps the container alive across the async gap, so the buggy ordering stays green — verified by reverting the fix and re-running). The real safety net is the rodney/verify-demo.shbrowser check, not a unit test.🤖 Generated with Claude Code