Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Experimental merge main #10611

Merged
merged 42 commits into from
Jul 16, 2024
Merged

Experimental merge main #10611

merged 42 commits into from
Jul 16, 2024

Conversation

bvaughn
Copy link
Contributor

@bvaughn bvaughn commented Jul 16, 2024

Bringing the experimental branch up to date with main. Biggest source of change is the removal of breakpoints UI. Obviously this would be a squashed merge (single commit). Preferably it would be a rebase but I noticed the experimental branch already had a merge commit so rebasing would probably be more annoying at this point. (We could always flatten things after this was merged though.)

bvaughn and others added 30 commits June 14, 2024 07:16
… be found (#10561)

### [Loom overview](https://www.loom.com/share/6d697c9136274fb8892325d39283fdac)

Looking at [go/r/bb82f5c3-af5c-4e20-9f1c-5efa4ee6bd29](https://app.replay.io/recording/appreplayio--bb82f5c3-af5c-4e20-9f1c-5efa4ee6bd29), I observed that the `getCypressMarkerFrame` lookup fails to find a "marker frame" because there are only two sources in the call stack– the Replay plugin itself and Cypress. That method expects to find user code in between for some reason, so this breaks the jump-to-source behavior.

In this case, the source is:
```js
cy.contains('Product added to cart!').should('be.visible');
```

That gets rendered in the UI as this:

![Screenshot 2024-06-13 at 10 46 16 PM](https://github.com/replayio/devtools/assets/29597/63920c23-82c8-45b4-9bb9-29443984b3b9)

Clicking on the failed _assert_ (or trying to "jump to source") would ideally jump to the `should('be.visible')` but it fails because of the "marker frame" issue I mentioned above. The idea occurred to me that in this case, jumping to the parent command (`contains('Product added to cart!')`) is probably better than nothing. (In this case, they're even on the same line, but that won't always be true.)
Support multi-line print statements to improve readability and text editing experience.
)

* Revert "Improve message shown when async stack can't be loaded (#10557)"

This reverts commit 585e560.

* Fix detection of async parent pauses outside of the focus window
#10576)

* Improve heuristics for finding the user frame that dispatched a Redux action

The original logic was iterating backwards across the point stack frames looking for an applyMiddleware frame, and going backwards one more frame from there. This is problematic because I'm seeing variance in whether or not applyMiddleware actually shows up in stack frames. For some reason it shows up in Metabase recording stack traces, but not in our own E2E tests (and we're both using RTK).  That meant that the existing logic could keep right on walking backwards long past the frame it "should" have found.

What I've settled on is using the logic we had that tries to identify "is this function in a Redux middleware" based on source outlines (looking for the triply-nested function signature of a middleware definition), and stopping at the first frame that appears to be not a middleware and not applyMiddleware.  This seems to be producing pretty reasonable results.

* Update to a recent `breakpoints-01` recording

* Force re-running the J2C routine

* Add a util for verifying J2C behavior

* Add a test for Redux J2C behavior

* Ignore wrong lint error

* Update RDT-02 test to match current example recording
Print statement panel dynamic sizing bug fixes:
- Fixed minor font-size and line-height inconsistencies for print statement panel
- Handle edge case with empty last line (aka Shift+Enter)

![Screenshot 2024-06-21 at 10 58 36 AM](https://github.com/replayio/devtools/assets/29597/1a8e9514-1c56-4998-84e0-7b71a1d022b7)

Also updated the `useSourceListCssVariables` hook to reevaluate CSS variables (width of line numbers and hit counts) when the font size preference changes.
* Extract utils to check for user click/keyboard test steps

* Simplify UserActionEventRow J2C checks

* Use mouse event times for hover display for click steps

* Narrow time that we show a mouse click indicator

* Only show mouse clicks within the current focus window

* Revert focus window filtering for mouse cursors
)

* Update cypress/bankaccounts.spec example

* Add test for Cypress cursor positioning

* Use dashed/camel-cased data names
* Update RDT fork for 2024-07

* Fix broken string replacement for RDT injection
bvaughn and others added 11 commits July 8, 2024 09:37
This is my reasoning:
- These button confuse all of us. (Domi, Josh, Mark, and I just chatted about this in Discord.)
- Mixpanel data shows that [almost no one uses the buttons](https://mixpanel.com/project/2349904/view/2894968/app/insights#2NaEPayGGLnB).
- The rewind/fast-forward buttons (available via hover click and context menu) are easier to use. (After all, Replay is fundamentally different from a traditional browser/debugger. Let's lean into that and simplify our UI!)

![Screenshot 2024-07-05 at 6 00 02 PM](https://github.com/replayio/devtools/assets/29597/97eab27f-4e20-4811-a9f6-2a6391263677)
The log point panel was recently update (#10570) to support multi-line print statements. Part of that change included trying to merge some of the icons (e.g. visible, edit toggle, avatar, and badge picker) so there were fewer possible combinations (which complicated multi-line measuring logic) and so they took up less space overall.

Multi-line print statements made it more obvious how our icons were taking up crucial space:
<img src="https://github.com/replayio/devtools/assets/29597/cd1b2b53-03fd-475e-b899-89e7e4cecf57)" width="50%" />

Fewer icons would mean more available space which is better for the user when editing large text:
<img src="https://github.com/replayio/devtools/assets/29597/83ad2ba9-388e-44ae-a64f-96232bfccbaa)" width="50%" />

This PR combines things a bit further– merging the badge picker and disabled icon, as well as the user avatar and edit icon:

https://github.com/replayio/devtools/assets/29597/ce36aec4-373c-48e3-a67a-80b6fb307886

This feels like a good trade off in terms of the concerns I mentioned above.
- Add several new "report a problem" links into areas of Devtools that users might encounter problems with
- Add option to "_allow Replay support to view this recording_" (to auto-share the recording)
- Change discard-pending-message UI to flow better
- Rework the Support Form component to be more flexible (e.g. supporting extra context args) and more accessible to `replay-next` components (aka not routing it through Redux)
- Removed a lot of unnecessary passing around of props to components that could already retrieve those props from context directly
- Removed some unnecessary Redux `connect` functions that made code harder to read through

<table>
<tr>
<td colspan="2"><strong>Source viewer</strong></td>
</tr>
<tr>
<td>Source with source-maps</td>
<td><img title="screenshot-source-has-source-map" src="https://github.com/replayio/devtools/assets/29597/442307b2-9a67-4641-ad20-0eb03f18030f" /></td>
</tr>
<tr>
<td>Source with no source-maps</td>
<td><img title="screenshot-source-no-source-map" src="https://github.com/replayio/devtools/assets/29597/09dffb3a-5d30-4e32-b51f-67cb667fcc9e" /></td><tr>
<td colspan="2"><strong>Quick open modal</strong></td>
</tr>
<tr>
<td>Lots of results</td>
<td><img title="screenshot-typeahead-many-items" src="https://github.com/replayio/devtools/assets/29597/281117e1-7c6a-4bfa-9a8c-2f88bdff24d1" /></td>
</tr>
<tr>
<td>Fewer than 5 results</td>
<td><img title="screenshot-typeahead-3-items" src="https://github.com/replayio/devtools/assets/29597/2e183741-3a50-4352-bd03-bb13a9c0a75a" /></td>
</tr>
<tr>
<td>No results</td>
<td><img title="screenshot-typeahead-empty" src="https://github.com/replayio/devtools/assets/29597/af2cff72-b71c-4ecd-863c-6de203072030" /></td>
</tr>
<tr>
<td colspan="2"><strong>Terminal expressions</strong></td>
</tr>
<tr>
<td>Evaluates successfully</td>
<td><img title="screenshot-terminal-result" src="https://github.com/replayio/devtools/assets/29597/a285b386-94a6-46b2-8d2e-4229afab58c6" /></td>
</tr>
<tr>
<td>Throws an exception</td>
<td><img title="screenshot-terminal-exception" src="https://github.com/replayio/devtools/assets/29597/ed317fcd-8abf-4557-ac1e-4ea29615c5dd" /></td>
</tr>
<tr>
<td colspan="2"><strong>Video player</strong></td>
</tr>
<tr>
<td>Context menu</td>
<td><img src="https://github.com/replayio/devtools/assets/29597/4e5c581c-57bc-4da6-a974-79610293f778" /></td>
</tr>
<tr>
<td colspan="2"><strong>Loading screen</strong></td>
</tr>
<tr>
<td>When recording is still processing</td>
<td><img src="https://github.com/replayio/devtools/assets/29597/25006c89-2192-4115-94c9-a6252887e010" /></td>
</tr>
</table>


This PR also changes the discard confirmation screen to be more connected to the content you were editing.

| Editing | Discard confirmation (before) | Discard confirmation (after) |
| :--- | :--- | :--- |
| ![Screenshot 2024-07-04 at 5 50 50 PM](https://github.com/replayio/devtools/assets/29597/a416fd35-2590-4ae4-a855-9464c3dcddd4) |![Screenshot 2024-07-04 at 5 52 37 PM](https://github.com/replayio/devtools/assets/29597/73891b08-9e1c-4bf8-911d-755765461cc7) | ![Screenshot 2024-07-04 at 5 51 06 PM](https://github.com/replayio/devtools/assets/29597/d0b3c0a8-dfab-49b3-8310-79949e3e494b) |
Follow on to #10601

- Delete breakpoint UI and protocol-related code
- Remove unnecessary abstractions (now that there aren't two types of "points" in the app)
- Rename Nag/Tour related code that had potentially confusing references to breakpoints
- Update any e2e tests that got broken by this change
Use of the space previously occupied by the breakpoint toggle to show fast-forward and rewind buttons on hover. These are super useful but they are currently very hard to discover (since they require hovering while pressing cmd/ctrl).
* Display matched selector priority

* Include priority as a separate property of `MatchedSelectorState`

* fixed things
Copy link

vercel bot commented Jul 16, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
devtools ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 16, 2024 2:50pm

@bvaughn bvaughn changed the base branch from main to experimental July 16, 2024 14:38
Copy link

replay-io bot commented Jul 16, 2024

E2E Tests

Status Complete ↗︎
Commit b679f2f
Results
⚠️ 2 Flaky
  • inspector-computed-01: Basic computed styles can be viewed (Replay 1, Replay 2)
  • jump-to-code-02: Redux J2C functionality (Replay 1, Replay 2, Replay 3)
  • 99 Passed
  • async-stack: should detect async stacks outside the focus window
  • authenticated/comments-01: Test add, edit, and delete comment functionality
  • authenticated/comments-02: Test shared comments and replies (Replay 1, Replay 2)
  • authenticated/comments-03: Comment previews
  • authenticated/logpoints-01: Shared logpoints functionality (Replay 1, Replay 2)
  • authenticated/passport-01: Time travel
  • authenticated/passport-02: Infrared inspection
  • authenticated/passport-03: Swiss army knife
  • authenticated/passport-04: Multiplayer
  • console_async: support console evaluations in async frames
  • console_dock: Should show the correct docking behavior for recordings with video
  • console_errors: Test that errors and warnings from various sources are shown in the console
  • console_eval: support console evaluations
  • console_warp-01: should support warping to console messages
  • console_warp-02: support pausing, warping, stepping and evaluating console messages
  • console-expressions-01: should cache input eager eval and terminal expressions per instance
  • cypress-01: Basic Test Suites panel functionality
  • cypress-02: Test Step timeline behavior
  • cypress-03: Test Step interactions
  • cypress-04: Test Step buttons and menu item
  • cypress-05: Test DOM node preview on user action step hover
  • deleted-recording: Show error message for deleted recording
  • elements-search: Element panel should support basic and advanced search modes
  • fe-1875 :: verify that steps go to the right point in time
  • file-search-01: should search files
  • focus_mode-01: should filter messages as regions based on the active focus mode
  • highlighter: element highlighter works everywhere
  • inspector-computed-02: Complex computed styles can be viewed
  • inspector-elements-01: Basic DOM tree node display
  • inspector-elements-02_node-picker: element picker and iframe behavior
  • inspector-elements-03: Nested node picker and selection behavior
  • inspector-elements-04: Keyboard shortcuts should select the right DOM nodes
  • inspector-elements-05_search: element picker and iframe behavior
  • inspector-rules-01: Basic CSS rules should be viewed
  • inspector-rules-03: Shorthand CSS rules should be viewed
  • jump-to-code-01: Test basic jumping functionality
  • logpoints-01: log-points appear in the correct order and allow time warping
  • logpoints-02: conditional log-points
  • logpoints-03: should display event properties in the console
  • logpoints-04: should display exceptions in the console
  • logpoints-05: should auto-complete based on log point location
  • logpoints-06: should be temporarily disabled
  • logpoints-07: should use the correct scope in auto-complete
  • logpoints-08: should support jumping directly to a hit point via the capsule input
  • logpoints-09: should support pending edits
  • logpoints-10: too-many-points-to-find UX
  • logpoints-11: too-many-points-to-run-analysis UX
  • logpoints-12: should auto save when removing conditions
  • logpoints-13: Test log point in a sourcemapped file
  • network-01: should filter requests by type and text
  • network-02: should show details for the selected request
  • network-03: should sync and display the current time in relation to the network requests
  • node_console_dock: Should show the correct docking behavior for recordings without video
  • node_console-01: Basic node console behavior
  • node_console-02: uncaught exceptions should show up
  • node_control_flow: catch, finally, generators, and async/await
  • node_logpoint-01: Basic node logpoints
  • node_object_preview: Showing console objects in node
  • node_quick_open_modal-01: Test basic searching functionality
  • node_spawn: Basic subprocess spawning
  • node_stepping-01: Test stepping in async frames and async call stacks
  • node_worker-01: make sure node workers don't cause crashes
  • object_preview-01: expressions in the console after time warping
  • object_preview-02: should allow objects in scope to be inspected
  • object_preview-03: Test previews when switching between frames and stepping
  • object_preview-04: Test scope mapping and switching between generated/original sources
  • object_preview-05: Should support logging objects as values
  • object_preview-06: HTML elements
  • object_preview-07: inspect objects in the console while paused somewhere else
  • object_preview-08: should render ellipsis for collapsed objects with truncated properties
  • playwright-01: Basic Test Suites panel functionality
  • playwright-02: Test Step timeline behavior
  • playwright-03: Test Step interactions
  • playwright-04: Test Step buttons and menu item
  • playwright-05: Test DOM node previews on user action step hover
  • react_devtools-01: Basic RDT behavior
  • react_devtools-02: RDT integrations (Chromium)
  • react_devtools-03: process and display multiple React versions in page
  • react_devtools-04: Component selection is maintained when seeking to a new point
  • redux_devtools: Test Redux DevTools.
  • repaint-01: repaints the screen screen when stepping over code that modifies the DOM
  • repaint-02: repaints on hover
  • repaint-03: repaints on seek
  • repaint-04: prefers nearest (<=) paint when seeking between paints
  • repaint-05: prefers current time if pause creation failed outside of the focus window
  • repaint-06: repaints the screen screen when stepping over code that modifies the DOM
  • resizable-panels-01: Left side Toolbar and Video should be collapsible
  • restart-session: restart debugging session
  • scopes_rerender: Test that scopes are rerendered
  • session-destroyed: errors caused by session failure should bubble to the root
  • source-line-highlights: Test source line highlighting
  • sourcemap_stacktrace: Test that stacktraces are sourcemapped
  • stacking: Element highlighter selects the correct element when they overlap
  • stepping-01: Test basic step-over/back functionality
  • stepping-02: Test fixes for some simple stepping bugs
  • stepping-04: Test stepping in a frame other than the top frame
  • stepping-05: Test stepping in pretty-printed code
  • stepping-06: Test stepping in async frames and async call stacks
  • stepping-07: Test quick stepping using the keyboard
  • @bvaughn bvaughn requested a review from markerikson July 16, 2024 14:48
    @bvaughn bvaughn marked this pull request as ready for review July 16, 2024 14:57
    @bvaughn bvaughn merged commit 819b904 into experimental Jul 16, 2024
    23 checks passed
    @bvaughn bvaughn deleted the experimental-merge-main branch July 16, 2024 15:03
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    None yet
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    6 participants