feat(editor): semantic Before/After drop + fix Memo::get outside tracked context#179
feat(editor): semantic Before/After drop + fix Memo::get outside tracked context#179
Conversation
Picks up loom PRs #79 and #80: - Migrate ReactiveParser to use get_result()/Signal::get() for dual-context reads - Fix dependency tracking regression (rt.read() dropped tracking in derived memos) - Add regression test for derived memo invalidation through term() Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…get outside tracked context Before/After drop was using raw text splice (delete source + insert unparse), which left invalid syntax (e.g. `let id = ` with empty RHS). Now mirrors Exchange: extracts expression text from source map, replaces source with placeholder via Renderable::placeholder(), preserving valid syntax. Also fixes pre-existing Memo::get() abort when called outside tracked context (broke editor unit tests and ideal editor web app). All projection accessors now use rt.read(memo) which is safe in both contexts. Adds Playwright E2E tests for drag-drop Before/After/Inside/self-drop. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 20 minutes and 5 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Benchmark Comparison ReportComparing PR branch against Main Module BenchmarksBase branch: PR branch: event-graph-walker BenchmarksBase branch: PR branch: Benchmarks run with |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ce7e08db19
ℹ️ 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".
| await expect(page.getByLabel('Code editor')).toBeVisible(); | ||
| await page.waitForFunction(() => { | ||
| const ce = document.querySelector('canopy-editor'); | ||
| return ce?.shadowRoot?.querySelector('.structure-block') !== null; |
There was a problem hiding this comment.
Make structure-block wait condition actually block
The waitForFunction predicate can return true before the editor is ready: when canopy-editor or shadowRoot is missing, optional chaining yields undefined, and undefined !== null evaluates to true. That means setup may proceed immediately instead of waiting for .structure-block, which can make the new drag/drop tests flaky or mask real regressions depending on render timing. Use a null-safe truthy check (for example != null or an explicit boolean cast) so the wait only passes once a block is present.
Useful? React with 👍 / 👎.
Summary
Renderable::placeholder(), inserted text extracted from source map (whitespace-aware, like Exchange). Prevents invalid syntax likelet id =with empty RHS.get_proj_node,get_source_map,get_registry, etc.) andLambdaCompanionmemo reads now usert.read(memo)instead ofmemo.get(). Fixes pre-existing abort that broke 14 editor unit tests and crashed the ideal editor web app on load.Test plan
moon test— 879 passed, 0 failed (was 829/50 before the Memo fix)moon check— cleannpx playwright test e2e/drag-drop.spec.ts)🤖 Generated with Claude Code