GTK/libadwaita regression: No progress indication while testing/validating a CalDAV / Webcal / HTTPS link to subscribe to
See on_url_entry_text_changed_cb
, validate_url_cb
, and particularly pulse_web_entry
in gcal-new-calendar-page.c.
In the "Add Calendar" page of the "Manage Calendars" dialog, when you type or paste an online calendar link (like GNOME's) into the "Subscribe to a Calendar" text entry widget, GNOME Calendar's backend checks for the validity of that URI and the file it contains, before letting you add the calendar. If it fails, it shows up in red, otherwise it makes the "Add Calendar" button sensitive. However, this validation process can take a while, especially on slower networks.
While it is happening, we should be showing a progress indication (like pulsing status, or a GtkSpinner widget next to the textentry), to let the user know the app is processing/testing the link and needs to wait (otherwise they may wonder why the "Add Calendar" button is insensitive). When the progress indication visual disappears, the user knows they have some sort of result.
The code in gcal-new-calendar-page.c
apparently already has provisions for this, to make the text entry "pulsating", as you can see with the code below:
toggle_url_entry_pulsing (self, state == ENTRY_STATE_VALIDATING);
static void
toggle_url_entry_pulsing (GcalNewCalendarPage *self,
gboolean pulsing)
{
gtk_entry_set_progress_fraction (self->calendar_address_entry, 0);
if (pulsing && self->calendar_address_id == 0)
self->calendar_address_id = g_timeout_add (ENTRY_PROGRESS_TIMEOUT, pulse_web_entry, self);
else if (!pulsing && self->calendar_address_id != 0)
g_clear_handle_id (&self->calendar_address_id, g_source_remove);
}
But for some reason, it's not working, even with desktop animations activated.
An easy way to test this is using the test links at https://www.caldavserver.com/ with the provided usernames and passwords on that page (be very careful to copy-paste them to a text editor first, because copying from the website always adds an extra whitespace in front of the username and password). Before and after the password prompt in GNOME Calendar, it always takes at least 2 seconds before the response is complete, so we should be showing a pulsing status progress indication in the textentry at least.
Note: if you use a GtkSpinner and hide it (instead of destroying it), you MUST stop the spinner when no longer needed, because otherwise it will eat the CPU in the background.
Edit: this appears to be a GTK regression at gtk#6201 (closed)