Bubble loading UX improvement (Blue loading bar)

So I was fed up with the loading bar, and wanted a more UX friendly way to show that Bubble was up to something with my data or workflow etc.. so I have this, no blue bar loading.

vivaldi_Cc71s08f2n

I added an html element to the page and have a little JavaScript running observing for when Bubble dynamically injects its loading bar with “#nprogress” and watch for the presents of it, or not.

Then with the toolbox plugin I wait for the JavaScript to bubble events to fire off and use the notifier plugin with a loading message and trigger the success message (blank) once its done.

This is nice for use (in this case) with auto binding enabled because you don’t need to do anything other than have this running on the page. It can be a pain when you want to give your users feedback that something has happened, and even when Bubble does something in the background it will show there is activity.

I also hide with css the Bubble loader. (blue bar at the top of the page)

here is the code:

<style>
#nprogress { visibility: hidden; }
</style>
<script>
(function() {
  var fnName = 'loading';
  var lastState = null;
  function fire(state) {
    console.log('[DEBUG] nprogress state:', state);
    if (lastState === state) return;
    lastState = state;
    if (window['bubble_fn_' + fnName]) {
      console.log('[DEBUG] Calling bubble_fn_' + fnName + ' with:', state);
      window['bubble_fn_' + fnName](state);
    } else {
      console.log('[DEBUG] bubble_fn_' + fnName + ' not defined');
    }
  }
  function checkBar() {
    var nBar = document.getElementById('nprogress');
    var visible = false;
    if (nBar) {
      visible = window.getComputedStyle(nBar).display !== 'none';
    }
    fire(visible);
  }
  // Observe DOM changes globally (childList/attributes)
  var observer = new MutationObserver(function() {
    checkBar();
  });
  observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });
  // Initial check
  checkBar();
})();
</script>

Plugins:
Toolbox: Toolbox Plugin | Bubble
Notifier: Toast Notifications Plugin | Bubble


9 Likes

It’s a solid improvement. Thank you! @stuart4

1 Like

@Efe glad you liked it.. and it is pretty handy when you just need the one code block to trigger the events you need when things change, update etc without configuring them all. it would ne handy if this was available natively (like when a page is loaded events) so you dont have to watch for injected bubble logic… but anyway… it works :grinning_face_with_smiling_eyes:

Thanks I’ve been looking for this for quite a while now. Loading bar seems ultra generic to me.

let me know how you get on, maybe share a little animate gif of what you design :slight_smile:

Works like a charm! (Avoid the horrible UI, designs are on their way :joy:)
GIF looks kind slow as well but it runs super smooth. I used AirAlert for the toast.

Thanks for the contribution !

Screen Recording 2025-06-30 at 11.02.39

Magic! there are a number of things you could do depending on use case like disable buttons based on this same logic, just using the one condition. full screen floating group with blur and opacity’s so no other elements are clicked… obviously tis is more ux/ui rather than actually preventing things happening - but cool nevertheless :slight_smile: thanks for the gif! @ramaarana7

Sounds cool but very experimental.

Bubble has been injecting the loading bar when data changes or things are in progress since as long as I can remember and there is no event type (that i am aware of, I could be wrong) that would allow for use to natively check against (data processing etc) and show conditions. Using Observer is pretty common in modern web apps for changing data and pretty good performance wise, so it not really experimental exactly - however, as ever its best you test it in your set up :slight_smile:

Ah. Okay. I Unterstand. Thanks a Lot. I will Test it :grinning_face:

1 Like

Very nice! Thank you for sharing. I’ve always been mildly annoyed by the blue bar. Will definitely give this a try for a custom implementation in our app.

1 Like

Share what magic you create!