extensions
extensions copied to clipboard
Update Ploi extension (related to #12786)
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
- [x] I read the extension guidelines
- [x] I read the documentation about publishing
- [x] I ran
npm run build
and tested this distribution build in Raycast - [x] I checked that files in the
assets
folder are used by the extension itself - [x] I checked that assets used by the
README
are placed outside of themetadata
folder
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 to15
(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 ausePromise
. Instead ofuseEffect
, we can utilizeonWillExecute
of the hooks to carry out the related LocalStorage actions.