Make start session and finish session not reload the whole page #52

Closed
opened 2023-09-20 16:52:26 +00:00 by lukas · 3 comments
Owner

This is very slow.

This is very slow.
lukas closed this issue 2023-09-20 16:55:31 +00:00
lukas reopened this issue 2023-09-20 16:55:38 +00:00
Author
Owner

Not closing yet because the current solution is POC at best.

Using HTMX (https://htmx.org) we start/end session using AJAX and then replace parts of the page without reloading.
However, these need to be fixed/improved before it would be considered fixed:

  • The hx-select are suuuper ugly and hacky
    ** This is because the session list "table" is rendered using grid
    *** This means instead of being able to replace a single row, we have to use 2x :nth-child CSS selectors to select a range of divs. VERY BAD. #53
    *** This also means we cannot use HTMX to only get nice partial HTML, instead we render the whole page and select only part of it. Probably still slow despite not reloading the whole page.
Not closing yet because the current solution is POC at best. Using HTMX (https://htmx.org) we start/end session using AJAX and then replace parts of the page without reloading. However, these need to be fixed/improved before it would be considered fixed: * The `hx-select` are suuuper ugly and hacky ** This is because the session list "table" is rendered using grid *** This means instead of being able to replace a single row, we have to use 2x `:nth-child` CSS selectors to select a range of `div`s. VERY BAD. #53 *** This also means we cannot use HTMX to only get nice partial HTML, instead we render the whole page and select only part of it. Probably still slow despite not reloading the whole page.
lukas added a new dependency 2023-09-20 17:04:03 +00:00
Author
Owner

I've already did a POC of returning HTML partials with Django in 3f037b4c7c, additionally there are packages for improving working with partials.

Further reading:

I've already did a POC of returning HTML partials with Django in 3f037b4c7c, additionally there are packages for improving working with partials. Further reading: - https://github.com/spookylukey/django-htmx-patterns/blob/master/separate_partials.rst - https://mitchel.me/slippers/docs/introduction/ - https://github.com/carltongibson/django-template-partials
Author
Owner

Done properly in 0cf3411f63 and 44f49e5974

Done properly in 0cf3411f6335be8fe8611d858189c450985a48fa and 44f49e597483a34b9a8792841254505987260949
lukas closed this issue 2024-01-10 14:55:51 +00:00
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Depends on
Reference: lukas/timetracker#52
No description provided.