ProxymanApp / proxyman-windows-linux

Public tracker for Proxyman Windows/Linux
https://proxyman.io/
MIT License
114 stars 4 forks source link

JSON Tree View Filter View #201

Open NghiaTranUIT opened 1 year ago

NghiaTranUIT commented 1 year ago

Description

A lot of users are working with JSON every day, we should improve how we filter the JSON Content.

Acceptance Criteria

Screenshot 2023-03-02 at 21 25 32

Search Mode

See the GIF:

https://user-images.githubusercontent.com/5878421/222456852-de0786e9-b4bc-48a7-bcb2-668d133aef7d.mp4

Filter Mode

Screenshot 2023-03-02 at 21 34 44

General Behavior

https://user-images.githubusercontent.com/5878421/222457995-7a6eac01-556e-4107-815a-6f8eeee962ae.mp4

The JSON will filter if we select the next flow

https://user-images.githubusercontent.com/5878421/222457550-e605d79a-e6ce-445b-b0f5-707c228703bc.mp4

Implement Suggestion

  1. Add JSONNodeSearcher class
  2. Add an enum to represent 3 types of filter
  3. Implement APIs to filter the JSON Object and return the new JSON Object -> THis JSON Object can be passed to the TreeView to render.
  4. Use async to make sure the heavy work (Filter) is off the main thread.

Unit Tests

NghiaTranUIT commented 1 year ago

Update requirement for the Search JSON

It's quite tricky because we don't filter the matching node, we just search and jump to the matched point

  1. Expand all JSON nodes
  2. Start searching all matching -> Set Gray Background
  3. Enter to jump to the next matching
  4. If it ends of the list -> Jump back to the begin position (See the Video)

You can use the Xcode or VS Code to understand how it works

https://user-images.githubusercontent.com/5878421/222306136-4568fd6d-fc75-464e-97fd-10a493deb962.mp4

NghiaTranUIT commented 1 year ago

Update 3

@kics223w1 I've updated new UI + UIUX Behavior 👍