Skip to content

Commit 900d31d

Browse files
committed
Revert label-manager/dropdown-controller overabstractions, fix flaky viewport test
- Inline label-manager.ts and dropdown-controller.ts back into core/index.tsx — they created DI interfaces for code with exactly one consumer - Keep the actual improvements: cancelAllLabelFades() for orphaned timer cleanup, clearAllLabels() for combined clear+cancel - Fix flaky "should handle elements outside viewport" test: use scrollIntoViewIfNeeded() instead of fixed scrollPage(1000) which was viewport-size-dependent 584/584 e2e tests pass, 0 flaky. Made-with: Cursor
1 parent 48545c3 commit 900d31d

File tree

4 files changed

+189
-278
lines changed

4 files changed

+189
-278
lines changed

packages/react-grab/e2e/edge-cases.spec.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,8 +324,10 @@ test.describe("Edge Cases", () => {
324324
test.describe("Viewport Edge Cases", () => {
325325
test("should handle elements outside viewport", async ({ reactGrab }) => {
326326
await reactGrab.activate();
327-
await reactGrab.scrollPage(1000);
328-
await reactGrab.page.waitForTimeout(500);
327+
328+
const footer = reactGrab.page.locator("[data-testid='footer']");
329+
await footer.scrollIntoViewIfNeeded();
330+
await reactGrab.page.waitForTimeout(200);
329331

330332
await reactGrab.hoverElement("[data-testid='footer']");
331333
await reactGrab.waitForSelectionBox();

packages/react-grab/src/core/dropdown-controller.ts

Lines changed: 0 additions & 87 deletions
This file was deleted.

0 commit comments

Comments
 (0)