Skip to content

Diff View #1: UI & Logic #268

@NghiaTranUIT

Description

@NghiaTranUIT

Description

It's time to implement the built-in Diff view from Monaco Editor (Diff Mode): https://microsoft.github.io/monaco-editor/

Please play around with the Diff View in Proxyman for macOS.

Demo:

CleanShot.2023-07-13.at.13.45.28.mp4

Acceptance Criteria

1. Right Menu Context

  • Able to add 1 or multiple selected flows to the Pool
  • Open new Tab with the Diff View

Screenshot 2023-07-13 at 13 35 35

2. Menu UI

  • Implement the Diff View, which consists of 2 parts: The Pool Data Source and the Monaco Diff View

Screenshot 2023-07-13 at 13 35 57

3. Diff Option

  • Diff in Request / Response
  • Unified or Side By Side
  • Default option is: Request + Side By Side
  • Able to switch different options -> The UI should be updated too.
Screenshot 2023-07-13 at 13 43 44

4. Diff request/response

  • See the Demo Video to understand the behavior because it's hard to explain in words.
  • Diff Pool Data Source: Reuse the Table of the Main Table View with some pre-defined columns
  • Have 2 new columns (Left and Right) -> Able to select the position of the request
  • Left / Right -> Only 1 column is enabled at the time
Screenshot 2023-07-13 at 13 47 05

5. How to build the Request/Response Diff data

  • The Diff data is:
  1. The Raw Data (Reuse the code that generates the Raw data from the Raw Tab)
  2. However, for the the Body part -> We must try to beautify the Body (JSON)

CleanShot 2023-07-13 at 13 52 16@2x

5. Notice

  • The Pool Data Source doesn't persist for the next launch. It's clear when we close the app -> No need to save to disk.
  • In the Diff View -> If we add Comment -> The flow on the main table view should be updated too -> It's the same instance. See the video demo below:
CleanShot.2023-07-13.at.13.50.11.mp4
  • Do not need to implement the Highlight Color

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request✅ DoneTicket is resolved

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions