Skip to content

Commit d53ae85

Browse files
chore: cleanup for user input visualization PR
- Remove unused Snapshot import from backend index - Fix snapShot.ts JSDoc (fiberRoot param) - Shorten content script comments and reference implementation doc Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 53d6f24 commit d53ae85

3 files changed

Lines changed: 21 additions & 17 deletions

File tree

src/backend/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import linkFiber from './routers/linkFiber';
1010
// timeJumpInitialization (actually uses the function timeJumpInitiation but is labeled here as linkFiberInitialization, returns a function) returns a function that sets jumping to false and handles timetravel feature
1111
import timeJumpInitialization from './controllers/timeJump';
1212
import { initUserEventCapture } from './controllers/userEventCapture';
13-
import { Snapshot, Status, MsgData } from './types/backendTypes';
13+
import { Status, MsgData } from './types/backendTypes';
1414
import routes from './models/routes';
1515

1616
// -------------------------INITIALIZE MODE--------------------------

src/backend/routers/snapShot.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,10 @@ import { getLastUserEvent } from '../controllers/userEventCapture';
66

77
// -------------------------UPDATE & SEND TREE SNAP SHOT------------------------
88
/**
9-
* This function creates a new `snapShot` fiber tree with the provided `fiberRoot`, then send the updated snapshot to front end.
10-
* This runs after every Fiber commit if mode is not jumping.
11-
* This
12-
* @param snapshot The current snapshot of the fiber tree
13-
* @param fiberRoot The `fiberRootNode`, which is the root node of the fiber tree is stored in the current property of the fiber root object which we can use to traverse the tree
9+
* Creates a new snapshot of the fiber tree and sends it to the front end.
10+
* Runs after every Fiber commit when not in jumping mode.
11+
* @param fiberRoot - The fiber root; the root node is in its `current` property.
1412
*/
15-
// updating tree depending on current mode on the panel (pause, etc)
1613
export default function updateAndSendSnapShotTree(fiberRoot: FiberRoot): void {
1714
// This is the currently active root fiber(the mutable root of the tree)
1815
const { current } = fiberRoot;

src/extension/contentScript.ts

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ const REACTIME_POINTER_STYLES_ID = 'reactime-pointer-styles';
146146
function getOrCreatePointerOverlay() {
147147
let overlay = document.getElementById(REACTIME_POINTER_OVERLAY_ID);
148148
if (!overlay) {
149-
// Inject styles once pointer designed to draw attention (larger, ripple, glow)
149+
// Inject styles once for pointer overlay (dot + ripple, high contrast)
150150
if (!document.getElementById(REACTIME_POINTER_STYLES_ID)) {
151151
const style = document.createElement('style');
152152
style.id = REACTIME_POINTER_STYLES_ID;
@@ -177,28 +177,35 @@ function getOrCreatePointerOverlay() {
177177
opacity: 0;
178178
}
179179
#${REACTIME_POINTER_OVERLAY_ID}.reactime-pointer-visible .reactime-pointer-dot {
180-
animation: reactime-dot-in 0.25s ease-out;
180+
animation: reactime-dot-pulse 2s ease-in-out;
181+
animation-iteration-count: infinite;
181182
}
182183
#${REACTIME_POINTER_OVERLAY_ID}.reactime-pointer-visible .reactime-pointer-ripple {
183-
animation: reactime-ripple 0.8s ease-out 1;
184+
animation: reactime-ripple 1.2s ease-out;
185+
animation-iteration-count: infinite;
184186
}
185-
@keyframes reactime-dot-in {
186-
from { transform: translate(-50%, -50%) scale(0); opacity: 0; }
187-
to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
187+
@keyframes reactime-dot-pulse {
188+
0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 1; box-shadow: 0 0 0 1px rgba(0,0,0,0.2), 0 0 20px 4px rgba(13,148,136,0.5); }
189+
10% { transform: translate(-50%, -50%) scale(1); opacity: 1; box-shadow: 0 0 0 1px rgba(0,0,0,0.2), 0 0 20px 4px rgba(13,148,136,0.5); }
190+
50% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; box-shadow: 0 0 0 1px rgba(0,0,0,0.2), 0 0 28px 8px rgba(13,148,136,0.7); }
188191
}
189192
@keyframes reactime-ripple {
190-
0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0.8; }
193+
0% { transform: translate(-50%, -50%) scale(0.6); opacity: 0.7; }
191194
100% { transform: translate(-50%, -50%) scale(3); opacity: 0; }
192195
}
193196
@media (prefers-reduced-motion: reduce) {
194-
#${REACTIME_POINTER_OVERLAY_ID}.reactime-pointer-visible .reactime-pointer-dot,
195-
#${REACTIME_POINTER_OVERLAY_ID}.reactime-pointer-visible .reactime-pointer-ripple {
196-
animation: none;
197+
#${REACTIME_POINTER_OVERLAY_ID}.reactime-pointer-visible .reactime-pointer-dot {
198+
animation: reactime-dot-in 0.25s ease-out;
197199
}
198200
#${REACTIME_POINTER_OVERLAY_ID}.reactime-pointer-visible .reactime-pointer-ripple {
201+
animation: none;
199202
opacity: 0;
200203
}
201204
}
205+
@keyframes reactime-dot-in {
206+
from { transform: translate(-50%, -50%) scale(0); opacity: 0; }
207+
to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
208+
}
202209
`;
203210
(document.head || document.documentElement).appendChild(style);
204211
}

0 commit comments

Comments
 (0)