extensions icon indicating copy to clipboard operation
extensions copied to clipboard

Update Ploi extension (related to #12786)

Open xmok opened this issue 7 months ago • 7 comments

Description

As per Issue #12786, this half-addresses the issue by paginating Servers. Sites are not paginated because the way the Sites components are currently structured, the Sites are in List Items on the top and the other List Items are Actions so native pagination might require some UI changes.

I've wrapped an API call in usePromise which allows us to natively paginate the Servers. There are some flickers and state changes happening but I am able to reproduce them in the current version installed from the Store as well so that will need further refactoring of the code and is out of scope for this PR.

Screencast

Here is a "real" screencast using an actual Ploi instance that has 1 server.

https://github.com/raycast/extensions/assets/30526133/1dcf3890-3f66-4c82-b4d0-589f226ece86

Here is a "fake" screencast in which I mocked the server response locally in order to show more servers and pagination in action.

https://github.com/raycast/extensions/assets/30526133/074eed2e-0dff-4727-9de1-e8c9ebb82b71

Checklist

Dev Notes
  • We can't simply set the PLOI_PER_PAGE to a number greater than 50 as 50 is max and a larger number defaults to 15 (https://developers.ploi.io/27-getting-started/81-pagination)
  • One way we could tackle the initial flickering and related is to replace existing API call w/ a useFetch or wrap in a usePromise. Instead of useEffect, we can utilize onWillExecute of the hooks to carry out the related LocalStorage actions.

xmok avatar Jun 30 '24 20:06 xmok