lumen icon indicating copy to clipboard operation
lumen copied to clipboard

Prompt Update - UI

Open Pkcarreno opened this issue 7 months ago • 6 comments

Closes https://github.com/lumen-notes/lumen/issues/348

This time taking what was done in the previous PR and adding the visual/interaction side of the process.

There are two ways in which the user is "notified" that there is a new update, the first is through buttons on the interface that only appear when an update is available.

Screenshot 2024-06-29 132718 Screenshot 2024-06-30 151856

The second is by making use of the sonner library, showing a toast on the screen.

Screenshot 2024-06-29 132808 Screenshot 2024-06-30 144207 When clicking on the toast the app is immediately updated

In the case of clicking on one of the two buttons in the layout it generates a alert dialog before updating.

Screenshot 2024-06-29 132736

In this version only 2 dependencies were installed:

Also I created a context of the service worker state and placed it in the form of a provider to maintain consistency of the data in the app.

I placed this provider in src/index.tsx, if you don't like the position I gave it you can modify it without problem, the important thing is to keep the <Toaster /> component at the same level or higher than <PromptUpdateProvider />.

And the icon of "refresh" that was added is taken from featherIcon

Only one issue remains, it is ideal to check before updating that the status is "synchronized" or at least force the synchronization of the notes before refreshing the page. I left a comment to manage this, I could not fully understand the synchronization process and how to integrate it yet.

image The above file is src/components/nav-bar.tsx line 329

What do you think of the UI and implementation? I look forward to any changes or suggestions.

Pkcarreno avatar Jun 30 '24 19:06 Pkcarreno