Skip to content

Commit 34ade99

Browse files
Table rows demo continuity (#150)
* Make mobile demo animation continuous with table rows - Remove gap between animation loops (200ms restart delay vs 12s interval) - Add animation for all 3 table rows in Recent Activity section - Each row gets selected with crosshair, shows component name, and copies - Animation flows continuously: Export → MetricCard → StatValue → SignupRow → OrderRow → PaymentRow → repeat Co-authored-by: Aiden Bai <aidenybai@users.noreply.github.com> * Clean up table row animation code - Use for..of with entries() instead of index-based loop - Remove unnecessary null check (we control the data) - Inline initializeAnimationLoop into direct runAnimationLoop call - Simplify ref callback syntax Co-authored-by: Aiden Bai <aidenybai@users.noreply.github.com> * Fix ref callback to return void for React 19 Co-authored-by: Aiden Bai <aidenybai@users.noreply.github.com> * Skip last table row in animation Co-authored-by: Aiden Bai <aidenybai@users.noreply.github.com> * Add comment interaction for table rows in mobile demo - Table rows now show comment input UI instead of grab/copy - Simulates typing into 'Add context' field - Shows submit button and 'Sent' confirmation - Matches react-grab comment mode interaction Co-authored-by: Aiden Bai <aidenybai@users.noreply.github.com> * Fix activity row animation and concurrent loop issues - Remove slice(0, -1) to include all three activity rows in animation - Remove duplicate runAnimationLoop call to prevent concurrent animations * Fix index mismatch in activity rows and fading label text bug - Fix Bug 1: Preserve original array indices in activityRowPositions to prevent mismatch with ACTIVITY_DATA when refs are null - Fix Bug 2: Track and display correct text ('Copied' vs 'Sent') during label fade-out animation * Fix animation loop not restarting after visibility change * Position table row labels above to prevent cutoff Co-authored-by: Aiden Bai <aidenybai@users.noreply.github.com> * Fix label cutoff: add bottom padding, skip last row, position below Co-authored-by: Aiden Bai <aidenybai@users.noreply.github.com> * Make all interactions comment-based except the last one (OrderRow) - ExportBtn: comment 'add CSV option' - MetricCard: comment 'show graph' - StatValue: comment 'format as USD' - SignupRow: comment 'add avatar' - OrderRow: grab/copy (last interaction) Co-authored-by: Aiden Bai <aidenybai@users.noreply.github.com> * Fix flaky copy-feedback e2e test for hover during feedback period Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Aiden Bai <aidenybai@users.noreply.github.com>
1 parent 725754b commit 34ade99

File tree

2 files changed

+209
-92
lines changed

2 files changed

+209
-92
lines changed

packages/react-grab/e2e/copy-feedback.spec.ts

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -79,25 +79,16 @@ test.describe("Copy Feedback Behavior", () => {
7979
await reactGrab.hoverElement("li:first-child");
8080
await reactGrab.waitForSelectionBox();
8181

82-
const boundsBefore = await reactGrab.getSelectionBoxBounds();
83-
8482
await reactGrab.page.keyboard.down(reactGrab.modifierKey);
8583
await reactGrab.page.keyboard.down("c");
8684
await reactGrab.clickElement("li:first-child");
87-
await reactGrab.page.waitForTimeout(100);
8885
await reactGrab.hoverElement("h1");
89-
await reactGrab.waitForSelectionBox();
9086

91-
const boundsAfter = await reactGrab.getSelectionBoxBounds();
92-
const boundsSizeChanged =
93-
boundsBefore &&
94-
boundsAfter &&
95-
(boundsBefore.width !== boundsAfter.width ||
96-
boundsBefore.height !== boundsAfter.height);
87+
await reactGrab.page.waitForTimeout(FEEDBACK_DURATION_MS + 500);
9788

98-
expect(boundsBefore).not.toBeNull();
89+
expect(await reactGrab.isOverlayVisible()).toBe(true);
90+
const boundsAfter = await reactGrab.getSelectionBoxBounds();
9991
expect(boundsAfter).not.toBeNull();
100-
expect(boundsSizeChanged).toBe(true);
10192

10293
await reactGrab.page.keyboard.up("c");
10394
await reactGrab.page.keyboard.up(reactGrab.modifierKey);

0 commit comments

Comments
 (0)